News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Need help coding a Global Mod Tab

Started by Bec, September 12, 2008, 08:57:10 PM

Previous topic - Next topic

Bec

Hi Guys,

I need some help coding a new tab so only my global moderators can see it, this is my code so far...

echo '<li' , $current_action=='#' ? ' class="active"' : '' , '><a href="#">Mod Tools</a>
<ul style="overflow: hidden; visibility: visible; opacity: 1;">
<li><a href="index.php?action=mlist">Members</a></li>
<li><a href="index.php?action=stats">Stats</a></li>
<li><a href="index.php?action=who">Whos Online</a></li>
</ul>
</li>';


I just need for only my global moderators to be able to see it, they have permission to view the memberlist, online list etc but all members at the moment can the tab..... I want it hidden from everyone else but the global mods..

Any ideas?

I am using 1.1.6, Urban design by DzinerStudio

Thanks  :D


Also just as an example this is the code I have for my admin button....

if ($context['allow_admin'])
{
echo '<li' , $current_action=='admin' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=admin">' , $txt['2'] , '</a>
<ul style="overflow: hidden; visibility: visible; opacity: 1;">
<li><a href="index.php?action=mlist">Members</a></li>
<li><a href="index.php?action=stats">Stats</a></li>
<li><a href="index.php?action=who">Whos Online</a></li>
</ul>
</li>';
}

[SiNaN]

Use this if for your buttons:

if(in_array(2, $GLOBALS['user_info']['groups']))
Former SMF Core Developer | My Mods | SimplePortal

Bec

[SiNaN],
THANK YOU!!! I love ya!!! Thank you so much it worked a charm :)

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

Advertisement: