View Full Version : if statement for checking what forum i'm viewing.
MikeTrin
02-24-2011, 05:22 PM
I figured out how to block off code using if's for user groups. how can it do it for 1 or many forums by id number? Similar to what's below...
<vb:if condition="is_member_of($bbuserinfo, 4,5,6)">
LifesGreatestGift
02-28-2011, 01:06 AM
<vb:if condition="in_array($forum['forumid'], array(1,2,3))">code to display in forums</vb:if>
change the 1,2,3 to the forums you want the code to display in.
downloadsuk
03-02-2011, 07:37 AM
Isn't $forum['forumid'] a vb3 variable? foruminfo[] now right?
MikeTrin
03-06-2011, 07:04 PM
I do have vb 4 and this doesn't seem to work. I want to skip showing adsense code if they are browsing particular forums, 41, 12, 143. Tried both ways, neither worked.
<vb:if condition="!in_array($foruminfo['forumid'], array(41, 12, 143))">
<!-- adsense code -->
</vb:if>
--------------- Added 1299448314 at 1299448314 ---------------
I found a solution that seems to work.
<vb:if condition="!in_array($GLOBALS[forumid], array(41, 12, 143))">
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.