Log in

View Full Version : <if> variable for 2 usergroups?


SauravG
04-17-2008, 09:04 AM
I want the code below to be seen by two user groups - Guests (1) and Adminsitrators (6)

<if condition="$bbuserinfo[usergroupid] == 1">
MY TEXT HERE
</if>

That allows only guests to see the code, but I cant seem to work out how to get Administrators to see it too.

I tried the code below but it didnt work

<if condition="$bbuserinfo[usergroupid] == 1,6">
MY TEXT HERE
</if>

Regards,
Saurav

mxk101
04-17-2008, 03:57 PM
This should work.


<if condition="is_member_of($bbuserinfo,1 OR 6)">
YOUR TEXT HERE
</if>

Opserty
04-17-2008, 04:03 PM
<if condition="is_member_of($bbuserinfo, 1, 6)">
YOUR TEXT HERE
</if>

SauravG
04-18-2008, 05:09 AM
Thanks. I will try them later.

Opserty
04-18-2008, 10:56 AM
Oh forgot to mention the code posted in Post #2 is incorrect.

SauravG
04-18-2008, 03:04 PM
Oh forgot to mention the code posted in Post #2 is incorrect.

Yours worked perfectly, thank you :)