Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2007, 06:39 PM
MoB Dudditz MD MoB Dudditz MD is offline
 
Join Date: Dec 2006
Location: IL
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 04-20-2007, 06:56 PM
WhaLberg's Avatar
WhaLberg WhaLberg is offline
 
Join Date: Nov 2006
Location: Dersaadet
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try:
HTML Code:
<if condition="$post[fieldx] == option1">do 1</if>
Reply With Quote
  #3  
Old 04-20-2007, 08:12 PM
MoB Dudditz MD MoB Dudditz MD is offline
 
Join Date: Dec 2006
Location: IL
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by WhaLberg View Post
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"
Reply With Quote
  #4  
Old 04-20-2007, 08:25 PM
WhaLberg's Avatar
WhaLberg WhaLberg is offline
 
Join Date: Nov 2006
Location: Dersaadet
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 04-20-2007, 08:43 PM
MoB Dudditz MD MoB Dudditz MD is offline
 
Join Date: Dec 2006
Location: IL
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 04-21-2007, 09:34 AM
WhaLberg's Avatar
WhaLberg WhaLberg is offline
 
Join Date: Nov 2006
Location: Dersaadet
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06700 seconds
  • Memory Usage 2,228KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_html
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete