MyBB Community Forums

Full Version: Securing Pages with User Groups
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok, either the search feature sucks, or I am terrible at searching. I can never find anything on these forums that I know is here as I saw it only a couple days ago.

Basically, im looking for some instruction on how to secure pages with the mybb user groups. So, you know, if the user is logged in and if they are an administrator, show this, else if they are logged in but not an administrator, show that.

if ($user->groups['admin']) {

}

Or something.. anyway, can anyone help me out with this? Also, how on earth does anyone manage to actually find something via the forum search. I always seems to get what seem like completely random and off-topic results. Not to mention, I always seems to get a lot of the same topics no matter what I search.

Thanks.
What usergroups do you want to have different else if's?
if($mybb->user['usergroup'] == 4)
{
...
}
Inferno Wrote:What usergroups do you want to have different else if's?

Hey Inferno, I was looking for the Administrator usergroup.

LeX- Wrote:
if($mybb->user['usergroup'] == 4)
{
...
}

Thank you. That's precisely what I was looking for.

Take care.