View Full Version : Checkbox enable question
Stickers
08-08-2007, 01:42 PM
Hi there,
I want that people can enable the top10 in there UserCP with a checkbox
but how will look the <if condition="$bbuserinfo['fieldX']"> to enable this for all my members?
Thanks...
nico_swd
08-08-2007, 02:24 PM
What is "top10"?
Stickers
08-08-2007, 04:38 PM
the 10 hottest threads like the topxstats, some people on my forum like it and some dont, sow i want that my members can enable and disable it with a checkbox
Farcaster
08-08-2007, 04:45 PM
If I understand your question correctly, you could add a radio profile field and then reference that in a template conditional to prevent the stats from being displayed. For instance, if field5 was "Display Top 10?" with the possible answers: "Yes" or "No":
<if condition="$userinfo[field5]=='Yes'">...TOP10 STUFF HERE...</if>
Stickers
08-08-2007, 05:12 PM
Thanks Farcaster,
but is this also possible with a checkbox? otherwise a radio profile will do
Kind regards
Stickers :p
Opserty
08-08-2007, 05:44 PM
A single checkbox will do exactly the same as a Yes/No radio button. But I don't think there is an option to use a single checkbox option in vBulletin custom fields.
Farcaster
08-08-2007, 06:01 PM
You could use the multi-select checkbox and only provide one option. If the checkbox is selected, it is a bitwise field, so it will be set to 1 in this case. Otherwise it will be blank, so you could simply rewrite that condition to:
<if condition="$bbuserinfo[field5]">...TOP10 STUFF HERE...</if>
I think I misled you slightly. It should be $bbuserinfo[field5] not $userinfo[field5]. Woops. But you get the idea.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.