PDA

View Full Version : if condition question


AFMichael
02-13-2006, 02:23 AM
What are all of the conditions possible for the usergroups? For example, admin would be:

<if condition="$show['admin']">

And guest would be:

<if condition="$show['guest']">

But for Super Mods, Mods, Registered Members, etc. what would they be?

Adrian Schneider
02-13-2006, 03:32 AM
$show['whatever'] is only available in certain parts of the script (although those 2 I'm not so sure about).

<if condition="is_member_of($vbulletin->userinfo, X)">This will show to people who are in the usergroupID X.<else />This will show to all others.</if>

is_member_of checks primary and secondary usergroups. If you just want to check primary:

<if condition="$vbulletin->userinfo['usergroupid'] == X">yeah</if>

AFMichael
02-13-2006, 09:43 PM
How would I go about checking multiple usergroups in a single if condition line?

Ok, I tried the following below and it kind of worked, but didn't work. For myself, being an Admin, it showed "Admin Members" and for another registered member account, it shows "Guest". I'm using two browsers to check these at the same time. What am I doing wrong?

<if condition="is_member_of($vbulletin->userinfo, 6)">
Admin
<else if condition="is_member_of($vbulletin->userinfo, 2)">
Members
<else />
Guests
</if>

<if condition="$vbulletin->userinfo['usergroupid'] == 6">
Admin
<else if condition="$vbulletin->userinfo['usergroupid'] == 2">
Members
<else />
Guests
</if>

I found a solution. I'm using the code below.

<if condition="is_member_of($bbuserinfo, 6,9)">
Admin/HelpDesk
</if>
</else>
<if condition="is_member_of($bbuserinfo, 2)">
Members
</if>
</else>
<if condition="is_member_of($bbuserinfo, 1)">
Guests
</if>