View Full Version : If conditional for ads on forums controlled from usercp


Redline
5th March 2007, 06:01 AM
Ok all, I got this working halfway, just need help getting the other half. I have an option in usercp for my members to decide if they want to turn off the advertisements in the forum or not. Basically, I have it set up like this....

UserCP > Edit Profile >
Turn off Advertisements?
Turn off all advertising banners on Redline Motorsports. Select "No" to leave them on
[] No [] Yes
and I have this code in my templates.....
<if condition="$post['field68'] == No">BANNERS CODE</if>
Which will not show the banners if the "Yes" is selected.

Now, my question is.......how do I still show the banners to guests?

darnoldy
5th March 2007, 06:41 AM
how do I still show the banners to guests?I think you can turn it around:
<if condition="$post['field68'] != Yes">BANNERS CODE</if>which should also so the banner if field 68 has no value (like for guests).

Onimua
5th March 2007, 03:43 PM
Wouldn't the banners still show to guests, since guests don't have a field to fill out in the first place?

Unless you add an <else /> to the code, so that it shows up for everyone unless they selected "no."

Redline
5th March 2007, 06:21 PM
Got it working using this code
<if condition="$post['field68'] == No OR is_member_of($bbuserinfo, 1)">