The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Profile field in condition?
Hi,
I've added a new profile field for the forum users. It looks like; Amazon.co.uk Search Box Single-Selection Menu Editable field14 [Edit] [Delete] Its basically a yes/no select-box option, which is shown on the user profile page. I'm basically trying to do something like; <if condition="$bbuser['amazon_profile'] ne "No"> .. show amazon code </if> Is this possible? TIA Andy |
#2
|
|||
|
|||
Certainly is, I use it a TON on the forumhome page as I have quite a few hacks in there so it lets people disable the ones they don't want to see
PHP Code:
|
#3
|
|||
|
|||
Hi,
Thanks for the reply However, it doesn't seem to be working :'( I have; field: $bbuserinfo[field14] <br> ..which prints; Quote:
<if condition="$bbuserinfo[field14] == 'Yes'"> ... in "navbar". Do I need to do anything special to load the user options? Also, may be pushing my luck here <G> Can anyone point me in the right direction, so I can do something like this with the nav bar; <if condition=IS_TOP> ... show one type of code </if> <if condition=IS_BOTTOM> ... show another type of code </if> Basically, I want to try and put 2 different codes on each page. One for the top navbar, and the other for the bottom one. TIA Andy |
#4
|
|||
|
|||
So what your trying to do is create a yes/no radio button that users select what kind of navbar they see?
|
#5
|
|||
|
|||
Hi,
Not really. I need a Yes/No option for the users, in their profile (which I have), and then a condition to see if the user option has been set, and show accordingly. If no option is set.. then it show the amazon search code To keep things simpler, I'll leave the other part until I've got this working <G> Cheers |
#6
|
|||
|
|||
This is a Single selection menu or Radio?
If it's a single selection, double check whether you have them selecting from yes no or Yes No The If statement IS case sensitive. If it's a radio, you'll need to use 0 or 1 if I recall right. |
#7
|
|||
|
|||
Hi,
Its definatly a Single-Select dropdown, with Yes/No as the values. Seems really weird that it doesn't seem to show up ... yet its obviously being set in their profile, as it gets selected ok when changed (i.e if they edit their profile). Is there a way to "dump" a list of the values/names of the info held in $bbuserinfo? Maybe a "foreach () "? That may be an easier way, so I can at least see if the value exists there, or whether it needs to be created somehow =) TIA Just put this together; <?php foreach ($bbuserinfo as $field => $value) { echo "$field => $value <br>"; } ?> Theoretically, this should give me all the values held in $bbuserinfo. Does anyone know where abouts I would put this? I guess PHP code isn't directly allowed in the templates? TIA |
#8
|
|||
|
|||
On a hunch, try a 0 or a 1 instead of Yes or No
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|