vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Checkbox enable question (https://vborg.vbsupport.ru/showthread.php?t=154648)

Stickers 08-08-2007 12:42 PM

Checkbox enable question
 
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 01:24 PM

What is "top10"?

Stickers 08-08-2007 03: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 03: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":

HTML Code:

<if condition="$userinfo[field5]=='Yes'">...TOP10 STUFF HERE...</if>

Stickers 08-08-2007 04: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 04: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 05: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:

HTML Code:

<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.


All times are GMT. The time now is 10:33 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02845 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete