PDA

View Full Version : is_member_of


RobDog888
09-17-2007, 11:16 PM
I cant get the function to determine if the member is in one of the groups or not.

I know its something stupid but ...

if (!(is_member_of($user, 5, 6, 7)))
{
print_no_permission();
}



It works with ....
if (($vbulletin->userinfo['usergroupid'] <> 5) AND ($vbulletin->userinfo['usergroupid'] <> 6) AND ($vbulletin->userinfo['usergroupid'] <> 7))
but I know the is_member_of function is preferred.

Analogpoint
09-18-2007, 05:15 AM
This should work:

if (!is_member_of($vbulletin->userinfo, 5, 6, 7))
{
// not a member of those groups
}

RobDog888
09-18-2007, 06:34 AM
Cool, it worked. Thanks :)

But what does "$vbulletin->userinfo" do? I'm new to php :(

Analogpoint
09-18-2007, 07:05 AM
Just think of it as a variable. $vbulletin is an object, and userinfo is a property of that object.