The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
If Profile Field Then Do Action
Ok, so basically what I got here is a dropdown profile field. If a member selects something specific from this profile field I want something to be displayed.
So if the profile field says "Red" I want certain things to be in red. So like: <if condition="$bbuserinfo[field1]" == red> <font color="red"> $content </if> </font> |
#2
|
||||
|
||||
The variable to use depends on what page/template you are trying to use it in and who the variable relates to - the person viewing the page or the page/post of another user?
|
#3
|
|||
|
|||
I want it so that any user who selects red via their usercp will see a certain page in red.
|
#4
|
||||
|
||||
Then $bbuserinfo is probably the correct variable to use.
|
#5
|
|||
|
|||
So I have it set up correctly? Should red be in quotations?
Example: <if condition="$bbuserinfo[field1]" == "red"> |
#6
|
||||
|
||||
single quotes.
HTML Code:
<if condition="$bbuserinfo[field1] == 'red'">
|
#7
|
||||
|
||||
Always better to quote array keys in conditionals (and you can and should use the identical operator, as it is faster).
Code:
<if condition="$bbuserinfo['field1'] === 'red'"> |
#8
|
|||
|
|||
Sweet thanks!
Huh? |
#9
|
||||
|
||||
I was just posting optimisations to the original code posted.
|
#10
|
|||
|
|||
I see, well thanks to both of you.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|