Log in

View Full Version : More Questions About Conditionals


InsaneContender
08-12-2004, 08:54 PM
I am having some trouble with conditionals. I am trying to display my Google Ads to everyone, except those of certian usergroups.

EG:

So everyone in groups: 1,2,3,5 would see the ad.

While everyone in groups: 4,6, and 7 would not.

What exactly should I put? Since there is no realy simple guide (that I could find) about using the conditionals... I am at a loss! lol.

I can get it to only show for one group, but that is it.

Please help! Much appreciated. :)

Modin
08-13-2004, 05:06 PM
<if condition="$bbuserinfo[usergroupid] != 4 && $bbuserinfo[usergroupid] != 6 && $bbuserinfo[usergroupid] != 7">
Google Ad
</if>


try that :)

Michael Morris
08-15-2004, 02:13 PM
Modin, that only checks the user's primary usergroup.

Use the is_member_of function, it's one of the few you can call in a template That function also checks ALL of the users groups, primary and secondary.


<if condtion="!is_member_of($bbuserinfo, 4) AND !is_member_of($bbuserinfo, 6)">

Ad

</if>

Modin
08-15-2004, 02:19 PM
nice tip mate, thanks :)

InsaneContender
08-15-2004, 04:03 PM
Alright, that did the trick. Thanks!

13th_Disciple
08-15-2004, 05:09 PM
got this from http://www.theadminzone.com - good site for find a bit of info on maybe a few possibilities for forum admins.. Keeps the ad from displaying on certain pages..


<if condition="THIS_SCRIPT != 'register' AND THIS_SCRIPT != 'search' AND THIS_SCRIPT != 'usercp' AND THIS_SCRIPT != 'sendmessage' AND THIS_SCRIPT != 'profile' AND THIS_SCRIPT != 'private' AND THIS_SCRIPT != 'subscriptions' AND THIS_SCRIPT != 'subscription' AND THIS_SCRIPT != 'member' AND THIS_SCRIPT != 'memberlist' AND THIS_SCRIPT != 'faq'">
Google AdSense Info
</if>

AN-net
08-15-2004, 05:40 PM
@disciple
would it not be simpler to put that information into an array and then make a condition?