vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   If ? (https://vborg.vbsupport.ru/showthread.php?t=118882)

rogersnm 06-17-2006 01:38 PM

If ?
 
I have made a costom profile field with the following:
Add new: Multiple Selection Checkbox.
Title: Postbit
Description: Show bits of info in the postbit?
Limit Selection: 0
Items Per Line: 1
Options: option 1
option 2
option 3
option 4
option 5
option 6
option 7
option 8
Display Order: 6
Field Required: No
Field Editable by User: Yes
Private Field: No
Field Searchable on Members List: No
Show on Members List: No
Which page displays this option?: Options: Other
In a template how do i use an if statement so if option 8 is checked then it will do whatever. And the same for option 1 and all the other options.

NOTE: there are multiple checkboxes in the 1 field and using <if condition="$post[fieldX] == 'option 1'"> didn't work.

peterska2 06-17-2006 08:46 PM

Option 1:
Code:

<if condition="$post[fieldx]=='1'">
Option 2:
Code:

<if condition="$post[fieldx]=='2'">
Option 3:
Code:

<if condition="$post[fieldx]=='4'">
Option 4:
Code:

<if condition="$post[fieldx]=='8'">
Option 5:
Code:

<if condition="$post[fieldx]=='16'">
Option 6:
Code:

<if condition="$post[fieldx]=='32'">
Option 7:
Code:

<if condition="$post[fieldx]=='64'">
Option 8:
Code:

<if condition="$post[fieldx]=='128'">
Note: With checkboxes, the total is cumlutive so if they have checked boxes 1,3,5 & 7 then they will have a fieldx value of 85 so you would need to calculate the values for each possible combination and use a large amount of if conditions to get the effect that you want.

I recommend using individual options for each one then you can toggle the information on and off.


All times are GMT. The time now is 05:02 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.01053 seconds
  • Memory Usage 1,713KB
  • 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
  • (8)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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