Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2004, 10:45 PM
restless's Avatar
restless restless is offline
 
Join Date: Jan 2002
Location: Canada
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default multiple selection custom profile field in postbit

i've been trying to add a multiple-selection profile field for "Sex" with the options, "boy", "girl" and "yes, please." to my postbit.

i know how to add a custom field to the postbit, but the multiple-selection thing is putting "1", "2" or "3" in the postbit instead of the actual option names.
Reply With Quote
  #2  
Old 01-20-2004, 01:31 AM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, what variable are you using right now for displaying the field which gives you 1, 2 or 3?

Also, exactly what type of profile field is the Sex one?
Reply With Quote
  #3  
Old 01-20-2004, 09:16 PM
restless's Avatar
restless restless is offline
 
Join Date: Jan 2002
Location: Canada
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<b>Sex:</b> $post[field10]
it's a multiple-selection checkbox.
Reply With Quote
  #4  
Old 01-20-2004, 10:46 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have to unserialize the field, etc. in order to get the proper answer. Maybe someone could help you out with this as I don't have the time to do this at the moment, although it shouldn't take too long to do for most coders
Reply With Quote
  #5  
Old 01-21-2004, 02:20 AM
Cassidy's Avatar
Cassidy Cassidy is offline
 
Join Date: Mar 2003
Location: Bham. England
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If your using RC1 or 2:

Change your custom user profile field to: "Yes, including a first blank option" ALSO make sure it's editable by the user.
Then in your postbit (or Postbit legacy) put the code:
PHP Code:
Sex: <if condition="$post[field99]">$post[field99]</if> 
Probebly above 'Rank' would be best.

Change all the "field99" to the number of the profile field. For example if it's 'Biography' it would be profile "field1". And that should work for you.
Reply With Quote
  #6  
Old 01-21-2004, 02:25 AM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cassidy
If your using RC1 or 2:

Change your custom user profile field to: "Yes, including a first blank option" ALSO make sure it's editable by the user.
Then in your postbit (or Postbit legacy) put the code:
PHP Code:
Sex: <if condition="$post[field99]">$post[field99]</if> 
Probebly above 'Rank' would be best.

Change all the "field99" to the number of the profile field. For example if it's 'Biography' it would be profile "field1". And that should work for you.
That option isn't available for this profile field type.
Reply With Quote
  #7  
Old 01-24-2004, 12:45 AM
restless's Avatar
restless restless is offline
 
Join Date: Jan 2002
Location: Canada
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone? :nervous:
Reply With Quote
  #8  
Old 01-24-2004, 01:27 AM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use
<if condition="$userinfo[field99]==1">$vbphrase[boy]</if>
<if condition="$userinfo[field99]==2">$vbphrase[girl]</if>
<if condition="$userinfo[field99]==3">$vbphrase[yes_please]</if>
Reply With Quote
  #9  
Old 01-24-2004, 01:53 AM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by princeton
use
<if condition="$post[field99]==1">$vbphrase[boy]</if>
<if condition="$post[field99]==2">$vbphrase[girl]</if>
<if condition="$post[field99]==3">$vbphrase[yes_please]</if>
No, it won't work. The values are stored in bitwise format.
Reply With Quote
  #10  
Old 01-24-2004, 02:22 AM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry, it should be $bbuserinfo not $post
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 07:45 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.04505 seconds
  • Memory Usage 2,262KB
  • 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
  • (1)bbcode_code
  • (2)bbcode_php
  • (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
  • (2)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