Examples for SMF 1.1.1 themes using tabs
Using these codes will allow your theme to support my major mods and save yourself and users some trouble from editing themes.
First find
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
Replace with
if (in_array($context['current_action'], array('gallery','links','articles','staff', 'tag', 'contact', 'search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
Add these codes to your themes menu function you might have to adjust the code a little to work with your theme.
// the [SMF Gallery] button
if (isset($txt['smfgallery_menu']))
{
if ($context['allow_smfgallery_view'])
echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=gallery">' , $txt['smfgallery_menu'] , '</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
}
// the [Articles] button
if (isset($txt['smfarticles_menu']))
{
if ($context['allow_view_smfarticles'])
echo ($current_action == 'articles' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'articles' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=articles">' , $txt['smfarticles_menu'] , '</a>
</td>' , $current_action == 'articles' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
}
// the [tags] button
if (isset($txt['smftags_menu']))
{
echo ($current_action == 'tags' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tags' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tags">' , $txt['smftags_menu'] , '</a>
</td>' , $current_action == 'tags' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
}
// the [links] button
if (isset($txt['smflinks_menu']))
{
if ($context['allow_view_smflinks'])
echo ($current_action == 'links' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'links' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=links">' , $txt['smflinks_menu'] , '</a>
</td>' , $current_action == 'links' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
}
// the [staff list] button
if (isset($txt['smfstaff_stafflist']))
{
if ($context['allow_view_stafflist'])
echo ($current_action == 'staff' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'staff' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=staff">' , $txt['smfstaff_stafflist'] , '</a>
</td>' , $current_action == 'staff' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
}
// the [contact] button
if (isset($txt['smfcontact_contact']))
{
if ($context['allow_view_contact'])
echo ($current_action == 'contact' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'contact' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=contact">' , $txt['smfcontact_contact'] , '</a>
</td>' , $current_action == 'contact' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
}