Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: ruaduck - toukokuu 21, 2008, 01:00:33 IP

Otsikko: how do i make it so certain groups can't view certain links on nav bar?
Kirjoitti: ruaduck - toukokuu 21, 2008, 01:00:33 IP
I have a bunch of links up at the nav bar on the top of the page and i was wondering how i can make it so that people who are just regular members or in certain member groups can't view that link?
Otsikko: Re: how do i make it so certain groups can't view certain links on nav bar?
Kirjoitti: sawz - toukokuu 22, 2008, 06:19:10 AP
i'm not sure if you can do it for certain groups, but you can hide links from non members using this: if($context['user']['is_logged'])  as a part of your menu links.
Otsikko: Re: how do i make it so certain groups can't view certain links on nav bar?
Kirjoitti: Eliana Tamerin - toukokuu 23, 2008, 07:30:00 AP
if(in_array($user_info['group'],array(1,2,3,4)))
show the button

Make sure that the $user_info global is declared in index.template.php.