PDA

View Full Version : How do I set up an Invitation Code field that modifies header depending on value(s)


geoskep
10-18-2004, 05:14 PM
I would like to set up and Invitation Code field in user profiles that could have different and multiple values. Depending on the value(s), the user would see various header menu selections.

For example if the invitation code is 'ABC', I would like to see an ABC menu selection, if 'DEF', a DEF menu selection and if 'ABC DEF', both the ABC and the DEF menu selections.

I know how to set up the field; but I don't know how to make the '<if condition ' routine work in the header template when the Invitation Code field can have multiple values.


Any ideas. :rolleyes:

Thanks

Colin F
10-18-2004, 05:38 PM
Hi

Make a custom profile field with the value and then make conditionals like this:

<if condition="$bbuserinfo[fieldx] == abc">ABC</if>
<if condition="$bbuserinfo[fieldx] == def">DEF</if>

geoskep
10-18-2004, 05:52 PM
Thanks, but that only works for single value codes.

If there are multiple codes in the field, I need to know which codes they are, so I can select the appropriate multiple menu selections.

Colin F
10-18-2004, 06:03 PM
how are the multiple values stored? if they're stored seperated with commas, you can use array() and then in_array(), if they're in different profilefields, you can check each one individually.

geoskep
10-19-2004, 08:06 PM
Thanks for the quick response. P.S. I changed my initial response to this new code.

I am using comma separated values. abc,def,ghi in [fieldx] and the following condition code. It doesn't work. I'm lost.

<if condition="in_array(def,array($bbuserinfo[fieldx]))">
TEXT FOR DEF
</if>

Thanks