The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How do I set up an Invitation Code field that modifies header depending on value(s)
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. Thanks |
#2
|
||||
|
||||
Hi
Make a custom profile field with the value and then make conditionals like this: Code:
<if condition="$bbuserinfo[fieldx] == abc">ABC</if> <if condition="$bbuserinfo[fieldx] == def">DEF</if> |
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
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.
|
#5
|
|||
|
|||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|