M Member 10517 Guest Jan 5, 2014 #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?
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?
P Paul B XenForo moderator Staff member Jan 5, 2014 #2 Do it with a custom user field and conditional statements.
M Member 10517 Guest Jan 6, 2014 #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?
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?
P Paul B XenForo moderator Staff member Jan 6, 2014 #4 Use <xen:if is="{$user.customFields.field_id}"> to check if the option has been selected. If not, apply the default.
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 Jan 6, 2014 #5 Take a look here: There are 3 options: "blank, ja and nein" - but I only want "ja, nein".
Russ Well-known member Jan 6, 2014 #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
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
P Paul B XenForo moderator Staff member Jan 6, 2014 #7 If it's simple yes/no, why not just do a checkbox?
M Member 10517 Guest Jan 6, 2014 #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?
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?