View Full Version : template conditionals
Blackhat
03-14-2008, 09:49 PM
How can I exclude my ads for the users in my paid subscription group ?
I used this code, but it seems like the ads got removed for everyone but unregistered
<if condition="!$bbuserinfo['userid'] == 17">
** ad code here **
</if>
Thanks
snakes1100
03-14-2008, 10:03 PM
<if condition="in_array($bbuserinfo[usergroupid], array(1,2,3,4))">
Blackhat
03-14-2008, 10:08 PM
I tried to reverse it like this, but it wont work
<if condition="in_array(!$bbuserinfo[usergroupid], array(17))">
snakes1100
03-14-2008, 10:10 PM
Works fine, remove the ! in yours.
Blackhat
03-14-2008, 10:12 PM
I tried that, but I need to exclude it for the usergroup 17 so I thought I needed to have the ! in front
Opserty
03-14-2008, 10:21 PM
<if condition="!is_member_of($bbuserinfo, X)">
<!-- Advert Code here -->
</if>
X being the UsergroupId of your paid subscription usergroup.
snakes1100
03-14-2008, 10:23 PM
Add all the usergroups that you want to see the ads to that array, sorry wasnt paying attention, dont add 17 or any other group that you dont want to show the ads to.
Edit to add:
Do what Op stated, sorry wasnt paying attention, either way will work.
BrandiDup
05-11-2008, 03:27 PM
Very helpful, thank you! I'm in the process of reworking our ads system and I needed the conditional to show ads to ALL groups (we have many :D ) except for one (our paid subscribers) and this worked perfectly.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.