The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Adding a user profile option that controls template outputs
I would like to add a checkbox option to the registered user profiles that will allow them to choose to display the site header banner.
Now I know how to add the new profile option through admin CP. and I know how to edit the header template to include an if condition check around the header banner html. What I do not know is what the condition is I am checking. Could anybody point me in the right direction? |
#2
|
||||
|
||||
The condition you want to check is the profile field, lets say you make a checkbox, if it has value (i.e. its been ticked), display the header.
something like this in your header: Code:
<if condition="$userinfo[fieldx] == 1"> Header code </if> |
#3
|
|||
|
|||
Thanks for that, just tried it and something has gone a bit odd. Although I originally suggested a check box, I have since decided to use a Single-Selection Menu.
I have added the menu item with two options (Show, Hide), this displays correctly in Profile - Edit Options - Miscellaneous Options. It also seems be accepting saves etc etc. This was added as "field7". I have then added the following condition around the header logo table: <if condition="$userinfo[field7] != 'Hide'"> Header code </if> However this doesnt seem to work, I wasn't sure if using the single quotes around "Hide" was correct so I have also tried without them. Interestingly if I put the following into the template <a>X.$userinfo[field7]</a> it outputs "X." so it seems the field7 value is empty which is why the condition check doesn't work. If it helps at all, this is how the field is configured: Quote:
Any ideas? |
#4
|
|||
|
|||
$bbuserinfo not $userinfo
|
#5
|
|||
|
|||
|
#6
|
||||
|
||||
aha whoops yes... Using bbuserinfo is for the logged in user, userinfo would be for say someone elses profile data and so on. glad its sorted.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|