MyBB Community Forums

Full Version: Group defined link viewal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Is it possible to set links that certain user groups can/cannot see? I want to place the {$modcplink} link on the navigation bar, so in the 'header' template, when I tried that, everyone could see the Moderator control panel, they couldn't access it though, of course.

I know that there is a template called 'header_welcomeblock_member_moderator' - I've had a look at that, but it hasn't been much help.

So is there any way to add the {$modcplink} on the header navigation bar and allow only Moderators and higher to view it?

Thanks.s
The $modcplink will only be set if the user is a moderator. Otherwise it will be blank.
Open ./global.php and add the following code just after the global_start hook;
if (in_array($mybb->user['usergroup'],array(3,4,6))
{
   $mod_link = $modcplink;
}
else
{
   $mod_link = "";
}

Now add the {$mod_link} in header template.
(2011-06-01, 05:17 PM)Aries-Belgium Wrote: [ -> ]The $modcplink will only be set if the user is a moderator. Otherwise it will be blank.

Strange, when I tried that earlier, it didn't work. Just tried it again, and it did.

Oh well, thanks.
(2011-06-01, 05:20 PM)Morsec0de Wrote: [ -> ]Oh well, thanks.

No problem Wink