View Full Version : Combine conditionals
Xtrigit
07-29-2010, 11:32 PM
I would like to combine these two conditionals:
<vb:if condition="is_member_of($bbuserinfo, 1,3,8)">show this to usergroups 1, 3, 8</vb:if>
<vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>
I tried:
<vb:if condition="is_member_of($bbuserinfo, 1,3,8) AND in_array($forum['forumid'], array(1,2,3))">show this to usergroups in forums</vb:if>
and it didn't work.
Thanks
Boofo
07-29-2010, 11:59 PM
<vb:if condition="is_member_of($bbuserinfo, 1,3,8) AND (in_array($forum['forumid'], array(1,2,3)))">show this to usergroups in forums</vb:if>
Xtrigit
07-30-2010, 01:43 AM
Thanks but that does not work.
Boofo
07-30-2010, 01:59 AM
Where are you using this?
--------------- Added 1280458795 at 1280458795 ---------------
<vb:if condition="is_member_of($bbuserinfo, 1,3,8) AND in_array($foruminfo['forumid'], array(1,2,3))">show this to usergroups in forums</vb:if>
Xtrigit
07-30-2010, 03:59 AM
SHOWTHREAD template inside the head tag <head> </head>.
Boofo
07-30-2010, 08:16 AM
Why don't you use one of the showthread hooks for this? What are you want to show if the condition is met?
Xtrigit
07-30-2010, 01:27 PM
I'm trying to show an ad that covers the whole screen but this ad should only be shown to guests and unconfirmed members in all forums but two.
At the moment <vb:if condition="is_member_of($bbuserinfo, 1,3,8)">show this to usergroups 1, 3, 8</vb:if> works for guests and unconfirmed members.
I had it working with 3.8.4 but I just upgraded like a day ago to vb 4.0.5.
Boofo
07-30-2010, 03:06 PM
What was the exact code for 3.8.4?
hmm, give this a try:
<vb:if condition="is_member_of($bbuserinfo, 1, 3, 8) AND in_array($threadinfo['forumid'], array(1, 2, 3))">
show this to usergroups in forums
</vb:if>
Xtrigit
07-31-2010, 03:45 AM
Thank you guys!
SecondV, that worked :D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.