News:

SMF 2.1.2 has been released! Take it for a spin! Read more.

Main Menu

Buttons on top not highlighting (Home, Forums, ...)

Started by alexandervba, June 01, 2009, 08:53:45 AM

Previous topic - Next topic

alexandervba

Hello, im back already ^^

On the top of the forums it has a few buttons, and Ive added a few, but when you click one of the buttons I created extra, they dont seem to get highlighted... Why is this?

Here is the code of the buttons:

// Show the [forums] button.
    echo '<li', $current_action == 'home' ? ' class="chosen"' : '', '><a href="', $scripturl, '">Forums</a></li>';
// Link To Foetube [foetube]...
   echo '<li', $current_action == 'foetube' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=foetube">FoeTube</a></li>';
// Link To Teamspeak [teamspeak]...
   echo '<li', $current_action == 'teamspeak' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=teamspeak">Teamspeak</a></li>';   
// Link To PjIRC [IRC]...
   echo '<li', $current_action == 'irc' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=irc">IRC</a></li>';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
    echo '<li', $current_action == 'admin' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>';
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
    echo '<li', $current_action == 'profile' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>';
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
   echo '<li', $current_action == 'pm' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<font color=red><blink> '. $context['user']['unread_messages'] . ' </blink></font></color>]' : '' , '</a></li>';
// The [calendar]!
if ($context['allow_calendar'])
   echo '<li', $current_action == 'calendar' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>';
// The [member] list button.
if ($context['allow_memberlist'])
   echo '<li', $current_action == 'mlist' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></li>';
// How about the [search] button?
if ($context['allow_search'])
    echo '<li', $current_action == 'search' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';
// Show the [help] button.
    echo '<li', $current_action == 'help' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
   echo '<li', $current_action == 'register' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></li>';
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
   echo '<li', $current_action == 'login' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></li>';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
   echo '<li', $current_action == 'logout' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>';


The standard buttons work, but Foetube, Teamspeak & IRC dont work... Any idea's?

mashby

Right above where the tabs are generated, find something like this:
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];


Add 'foetube', 'teamspeak', 'irc', to that list (in the array dealio).
Always be a little kinder than necessary.
- James M. Barrie


Advertisement: