The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
ProfileFields
I've been looking for details on how to include profilefield information in templates. It used to be possible by the following commands:
<if condition="$userinfo['fieldxx'] == 8"></if> $bbuserinfo[fieldx] $post[fieldx] etc I want to utilize some unique profile fields by adding them to the header, but I'm struggling to find out what the new conditional commands are in vb4. Anyone able to help me out with this? Both the if command and the display command? |
#2
|
|||
|
|||
Code:
<vb:if condition="$my_php_var"> your HMTL </vb:if> Code:
<vb:if condition="$my_php_var == 'my condition' "> your HMTL </vb:if> To insert variables into VB4 you need to ensure the variables are registered for the template you wish to use them in. Read this article here for how to do it. Took me a while to get used to the system but now it all makes sense Article: https://vborg.vbsupport.ru/showthread.php?t=228078 |
#3
|
||||
|
||||
Thanks donottumbledry. So is there no way of doing similar to this vB3 article in vB4 without creating a plugin and registering the variables/arrays?
|
#4
|
|||
|
|||
All user profile fields are automatically available in the postbit template.
You will either need to modify postbit or postbit_legacy depending on what you are using. The variables are available through the following VB variable: {vb:raw post.field22} where 22 would be whatever the field of your choosing is. To write a conditional statement to test for the existence of a field then you would write something along the line of: Code:
<vb:if condition = "$post['field22']"> <span class="profile_description">Favourite Colour: </span> <span class="profile_field">{vb:raw post.field22}</span> </vb:if> VB4 seems to have a predefined style using <dd> and <dt> tags. If you look closely into the postbit_legacy template you will see that descriptions of the profile fields are wrapped in <dd> tags and the actual data is wrapped in <dt> tags. This seems to automatically give you a nice spaced seperation such as for post count, blog count etc. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|