Well, the page that everyone is reffered to if they want to add a new tab or button is very bare bones, and doesn't really help that much. For adding a new tab, it gives this code
if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=forum">'.$txt['tp-forum'].'</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last"> </td>' : '';
Now, I named the tab "irc" in the array. Is this the proper code fro adding the tab now?
if($settings['TPortal_front_type']!='boardindex')
// Show the [IRC] button.
echo ($current_action=='irc' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='irc' ? 'active_back' : 'back' , '">
<a href="http://widget.mibbit.com/?settings=f814a0a9c46644a98d2d68c3a411b613&server=webirc.gamesurge.net%3A6007&channel=%23invictus&noServerNotices=true&noServerMotd=true&autoConnect=true" target="_blank">'.$txt['IRC'].'</a>
</td>' , $current_action=='irc' ? '<td class="maintab_active_last"> </td>' : '';
Technically, if action=irc doesn't exist on your forum you don't need to add the irc bits everyone in that code. All you need is the link, and the text for your link. If you have not defined $txt['IRC'] in one of the language files, then you will most likely get an undefined index error. You can do one of two things. Add $txt['IRC'] = 'IRC'; to your Modification.english.php file (or other language files). OR, you can change it to just be the text you want. Remove this (including periods and quotes) '.$txt['IRC'].' and just replace it with IRC (no quotes, commas, or periods etc).
Other than that, your button code should be fine. Of course, this button code assumes only the default theme. All other themes will most likely have a different button code.
Ok, so this is the code I added:
if($settings['TPortal_front_type']!='boardindex')
// Show the [IRC] button.
echo ($current_action=='irc' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='irc' ? 'active_back' : 'back' , '">
<a href="http://widget.mibbit.com/?settings=f814a0a9c46644a98d2d68c3a411b613&server=webirc.gamesurge.net%3A6007&channel=%23invictus&noServerNotices=true&noServerMotd=true&autoConnect=true" target="_blank">IRC</a>
</td>' , $current_action=='irc' ? '<td class="maintab_active_last"> </td>' : '';
And here is the result:
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi32.tinypic.com%2F1zb5d3m.jpg&hash=77bc15c8a31fe312e7e698f0c893b679d8da791e)
Any idea how I can remedy this? the link works as needed, just looks horrid, LOL.
If you copy the forum button code from the theme in use ( the one you want to add the button to ) you get the correct code for the tabs. seems like you are using the code from the default core them.
Copy the code from the theme, make the changes to that one instead and it will work :up:
Thanks, that worked perfectly!!
As a quick aside, is there a way to make it where only certain membergroups can see a certain tab?
Quoteis there a way to make it where only certain membergroups can see a certain tab?
Yes. It's easier to do it by whether they're an admin or a moderator, though.