![]() |
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. |
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? |
Code:
<b>Sex:</b> $post[field10] |
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 :)
|
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:
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. |
Quote:
|
anyone? :nervous:
|
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> |
Quote:
|
sorry, it should be $bbuserinfo not $post
|
Quote:
|
anyone?
|
Quote:
$bbuserinfo == user currently browsering $post == data posted into the postbit tempalte use post |
As I said, it's stored in bitwise format :rolleyes: So doing that wouldn't work anyways.
|
Quote:
|
I believe you can use $userinfo; but since it's in the postbit you can probaly use $post; however, I cannot test it.
----------------------------------- Not all custom profile fields work the same way (very confusing). In this case, it's saving the selected data in numerical values. It's much easier this way. let's say you have 5 choices (mulitple selections)... boy = 1 girl = 2 not sure = 4 again, not sure = 8 since, this is mulitple selection you may choose more than one; so, if you select boy/girl your value will now be a 3 and the numbers will change according to the selections you chooose. If you look closely you will see that there is a large combination of possibilities. Now, to display the correct data for boy/girl (3) onto any page ... you will use a conditional such as Code:
<if condition="$userinfo[field15]==3">$vbphrase[boy]$vbphrase[girl]</if> Code:
<if condition="$userinfo[field15]==5">$vbphrase[boy]$vbphrase[not_sure]</if> |
Quote:
$bbuserinfo is a global that will display the current USERS info, not user for that post |
sorry, should be $userinfo ... that's what I get for cutting and pasting
|
Quote:
|
this is what i used.... and it works.
Code:
<b>Sex:</b> |
Quote:
|
anybody able to help with this issue? i created a new selection field, and it's displayed in the postbit as a number that resembles the option the user chose instead of the text.
The code i used is: Quote:
maybe thats wrong. |
bump, need help with this
|
Quote:
this worked for me...so i dont know Zach...im still fresh so what do i kow lol |
All times are GMT. The time now is 09:18 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|