PDA

View Full Version : User Profile Field with Multiple Options


Quest2be1
09-16-2011, 05:25 AM
I am trying to write a simple add-on for my website. However, I can't continue because I don't know what are the parameters to specify an option under a profile field given there are more than one options to choose from. The idea is that when a user chooses one of the 7 options under a user profile field depending on what he chooses results in a different image appearing.

I have tried this..
<vb:if condition="$post['field12'] & 1"></vb:if>
I have tried this..
<vb:if condition="$post['field12'] <option value="1" ></option></vb:if>
and this..
<vb:if condition="$post['field12 - 1']"></vb:if>

Basically the list goes on and on. I am trying to figure out what is the code that recognizes an "option" in a "user profile field." If you could help me out I would really really appreciate it. I am running v.4.1.5

kh99
09-16-2011, 06:49 AM
If you're talking about a "single selection" radio button or menu, the value will be a string with the name of the option selected, so that you'd want something like:

<vb:if condition="$post['field12'] == 'Second Option'></vb:if>


(where 'Second Option' is replaced with your actual option, of course).

Quest2be1
09-16-2011, 09:08 AM
Thanks for the help kh.

mfowler70
11-10-2011, 06:38 PM
I'm trying to do something similar to this, in that I want to give users an option of displaying a predefined image in their signature area. I understand how to setup the profile field and display the user's choice in the postbit. What I'm struggling with though is actually showing the image options in the Edit Profile page, so they will know what the images look like.

The textarea where you enter the different options for the profile field doesn't parse html or bbcode, so if I add a url in there, it just shows that url in plain text on the edit profile page. Is there some workaround that I need to do in order to accomplish this?

Thanks