Log in

View Full Version : conditions Q


n1ckn4me
10-12-2005, 09:42 PM
How would you code if condition is NOT equal with the following codes:

<if condition="!$GLOBALS['FIRSTPOSTID']">
and:
<if condition="!$show['guest']">


also,

How would you code if you have multiple numbers:

<if condition="$vbulletin->userinfo['usergroupid']2">
(for example I want also usergroupid 3 and 4?)

Thanks in advance!

Adrian Schneider
10-12-2005, 10:24 PM
First one<if condition="$GLOBALS['FIRSTPOSTID']">

Note that the ! means NOT, so if a condition usually returns true, it will then return false (and vice versa)...

Same with your show guest one, removing it will reverse it.

If you want to do both...
<if condition="your_condition">
HTML Code
<else />
HTML CODE
</if>

I don't think that code is correct, you are missing the ==, also you should use is_member_of() because it checks secondary usergroups too (if you just want to do primary, by all means use yours.)

<if condition="is_member_of($vbulletin->userinfo, 2) OR is_member_of($vbulletin->userinfo, 3) OR is_member_of($vbulletin->userinfo, 4)">
...
</if>

Replace the ORs with ANDs if you want it displayed only if they are in all groups.

n1ckn4me
10-13-2005, 12:34 AM
cool! this is very helpfull! thank you...it's play time :p