vb.org Archive

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

MoB Dudditz MD 04-20-2007 05:39 PM

Profile Field Options
 
Does anyone know the values assigned to options
when using the multiple-selection checkbox option?

I was making a profile field of Attendance for Events.
Field: League Attendance:
Option 1
Option 2
Option 3
Option 4

I know how to add a conditional for the field to a template.
<if condition="$post[fieldX"> do something </if>

What I was attempting to achieve was a multiple conditional dependant upon the actual option selection.

<if condition="$post[fieldX option1"> do 1 </if>

<if condition="$post[fieldX option2"> do 2 </if>

Does anyone know the proper way to achieve this?
TY

WhaLberg 04-20-2007 05:56 PM

Try:
HTML Code:

<if condition="$post[fieldx] == option1">do 1</if>

MoB Dudditz MD 04-20-2007 07:12 PM

Quote:

Originally Posted by WhaLberg (Post 1232160)
Try:
HTML Code:

<if condition="$post[fieldx] == option1">do 1</if>

I have been trying different variations to no avail.
My exact profile field addition as follows: [field8]
Multiple-Selection Checkbox titled 'League Attendance' with 3 options as below.
MLG
WSVG
WCG

I have tried both in the template for postbit display:
<if condition="$post[field8] == option1"> do something </if>
<if condition="$post[field8] == MLG"> do something </if>

UPDATE

I removed one of the equal signs since there are multiple allowances and it seems to
be working great so far.
PHP Code:

<if condition="$post[fieldX] = option"


WhaLberg 04-20-2007 07:25 PM

Okay. Every option has an id for Multipe Selection Checkbox. So, you have to use it like that:
HTML Code:

<if condition="$post[field8] == x"]do</if>
x there is a number. It may be 1, 2, 3, 4. It is calculated from how you wrote the options.

MoB Dudditz MD 04-20-2007 07:43 PM

Youre correct.
I was wrong in my original update.
By removing the == all it did was allow things to happen without being dependant
on the selections.

Thank you very much. It works great now by simply providing the number of the option.
PHP Code:

<if condition="$post[field8] == x">do</if> 

The only problem is that it appears only to work with the first 2 options.
Below I will provide my actual postbit_legacy edit to make things easier.
I am trying to display an image for each selection.

PHP Code:

<if condition="$post[field8] == 1"><img src="images/ranks/mlg.png" border="0" /></if>
<if 
condition="$post[field8] == 2"><img src="images/ranks/wsvg.png" border="0" /></if>
<if 
condition="$post[field8] == 3"><img src="images/ranks/wcg.png" border="0" /></if>
<if 
condition="$post[field8] == 4"><img src="images/ranks/egl.png" border="0" /></if> 

I have a Multiple-Selction Checkbox in the user profile with four options.
MLG
WSVG
WCG
EGL

hmm... I forgot the options are binary storage so option3 is actually a value of 4
and option 4 is a value of 8.
This thread may have the answers.
http://www.vbulletin.com/forum/showpost.php?p=725845&postcount=2

WhaLberg 04-21-2007 08:34 AM

Please read this carefully: http://www.vbulletin.com/docs/html/m...e_conditionals


All times are GMT. The time now is 09:29 AM.

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.01662 seconds
  • Memory Usage 1,733KB
  • 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
  • (3)bbcode_html_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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