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 08-31-2006, 08:16 PM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How To Display Multiple Selection Profile Fields

<a href="http://www.vbulletin.com/forum/showthread.php?t=108785" target="_blank">http://www.vbulletin.com/forum/showthread.php?t=108785</a>

Ok, so I've seen this thread and all, but I'm trying to figure out a way to have it automatically grab the appropriate field info for each checkbox. Not entirely sure where to look / call for that info. Any ideas?
Reply With Quote
  #2  
Old 09-05-2006, 12:53 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump. Anyone have an idea, or need more info?
Reply With Quote
  #3  
Old 09-05-2006, 10:46 PM
cavyspirit cavyspirit is offline
 
Join Date: Jan 2004
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ditto for me. I need this, too.

I can't figure out that post either. I need to be able to display the data.
Reply With Quote
  #4  
Old 09-05-2006, 10:56 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know what you are wanting to do, but to do it automatically without doing the massive conditional set I don't think is possible - I could be proven wrong there though.
Reply With Quote
  #5  
Old 09-06-2006, 12:02 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not looking for a way around the conditional, just a way to grab the appropriate info after the conditional is met.
Reply With Quote
  #6  
Old 09-06-2006, 01:54 AM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah, well the only way to do it properly is the way that is posted in the thread you linked to.
Reply With Quote
  #7  
Old 09-06-2006, 02:34 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The thread DOESN'T say how to show the info though.

To clarify:

that thread only gives code that allows you to detect if a particular checkbox is checked, and if so, to do <SOMETHING>. I'm looking for additional code that will ultimately display the checkbox field's name.

Example:

Let's say you have three checkboxes, A, B, C. You check A and C. Currently with the linked to code, you can detect which boxes were checked, but not pull and display the name of the checkbox, unless I'm missing something. If so, please correct me.
Reply With Quote
  #8  
Old 09-06-2006, 12:52 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With multiple selection profile fields I'm 99% sure that you have to hardcode what you want them to display as the output is the option number values.

So for example, lets say that field 7 is about pets, then you would have
Code:
<if condition="$comma = ''"></if>

<if condition="$post['field7'] & 1">
	$comma Dog
	<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field7'] & 2">
	$comma Cat
	<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field7'] & 4">
	$comma Rabbit
	<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field7'] & 8">
	$comma Hamster
	<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field7'] & 16">
	$comma Horse
	<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field7'] & 32">
	$comma Fish
	<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field7'] & 64">
	$comma Snake
	<if condition="$comma = ', '"></if>
</if>
<if condition="$post['field7'] & 128">
	$comma Bird
	<if condition="$comma = ', '"></if>
</if>
Of course, using phrases for the display text is much better, so you would do that automatically when inputting your code into the template.
Reply With Quote
  #9  
Old 09-06-2006, 01:54 PM
tommyxv tommyxv is offline
 
Join Date: Feb 2005
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have profile drop downs for Year, Make, Model for an automotive website and to display the info in the postbit I use this....

Code:
<if condition="$post['field11'] AND $post['field12'] AND $post['field13']"><div><b>$post[field11] $post[field12] $post[field13]</b></div></if>
They must have all 3 filled in for it to show.
Reply With Quote
  #10  
Old 09-08-2006, 05:39 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by peterska2
With multiple selection profile fields I'm 99% sure that you have to hardcode what you want them to display as the output is the option number values.
I'm looking for a way to get the field option names from the database though, and not having to hard code it. There are various hacks that slap profile fields into the postbit, and when multiple selection ones are done, it posts just the bitcount, which isn't helpful to the end user.


Quote:
Originally Posted by tommyxv
I have profile drop downs for Year, Make, Model for an automotive website and to display the info in the postbit I use this....

Code:
<if condition="$post['field11'] AND $post['field12'] AND $post['field13']"><div><b>$post[field11] $post[field12] $post[field13]</b></div></if>
They must have all 3 filled in for it to show.
Thanks for trying to help, but that's got nothing to do with my question, sorry! I'm trying to find out how to grab the name of each checkbox from the backend, or at least where they're located.
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 03:50 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.05857 seconds
  • Memory Usage 2,257KB
  • Queries Executed 11 (?)
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_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete