In SMF2 the tabs have moved from the index.template.php, just so themes can work fully, these are now located in Sources/Subs.php
To add a new tab search for:
// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
now a few lines down you will see:
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),
This is the start of the tabs, to add a new tab you would simply sort this, for this tutorial I will break each line up,
'home' => array(
This is simply call tag just for identifcation, it is important that you have this and the ' ' or the tab will not work, for this tutorial we will assume that I have a custom page made up called Rules the above line would then be
'Rules' => array(
Next we shall look at the next line:
'title' => $txt['home'],
Yes this is a text string you could hardcode this but its more advisable to use a txt string specially if we are using another language besides for english.
'title' => $txt['rules'],
For more information on txt strings please refer to Txt Strings (SMF Doc Site (http://docs.simplemachines.org/index.php?topic=892.msg1942#post_template)
now lets look at:
'href' => $scripturl,
This should be obvious to most people however this line is the link to the file this could be a direct link such as
'href' => 'http://www.smfthemes.org',
or a scripturl
'href' => $scripturl. '?action=rules',
Next we have the show tab or not for everyone to see you would leave as is
'show' => true,
but you could use
'show' => $context['allow_admin'],
if wanting only admins
now for final line
'sub_buttons' => array(
unless you wish for extra options in that new tab then you wouldnt need to change this.
So for final code for my nice new rules tab:
'Rules' => array(
'title' => $txt['rules'],
'href' => $scripturl . '?action=rules',
'show' => true,
'sub_buttons' => array(
),
),