• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Let user decide about ads

M

Member 10517

Guest
#1
I want to give my user the choice to decide if they want to view ads or not.
Is there an addon to do this?
 
M

Member 10517

Guest
#3
Great idea! I have defined two options for a drop down menü. But there is also a blank default value.
Can I define the default to one of my field values?
 

Brogan

XenForo moderator
Staff member
#4
Use <xen:if is="{$user.customFields.field_id}"> to check if the option has been selected.

If not, apply the default.
 
M

Member 10517

Guest
#5
Take a look here:

Bildschirmfoto 2014-01-06 um 13.33.55.png

There are 3 options: "blank, ja and nein" - but I only want "ja, nein".
 

Russ

Well-known member
#6
You could approach it using a simple check box instead of a dropdown

Then your conditional would simply be:

Code:
<xen:if is="{$visitor.customFields.adsshowing.on} == 'on'">
ads on
</xen:if>
I think that's right :D
 
M

Member 10517

Guest
#8
Thank you guys - great support from you!

Perhaps one last thing:
Can you help me with a sql-query to count the forumusers who has checked this field?