The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
VB IF with custom field
I'm not very familiar with VB IF statements. I don't even know if I'm calling it the right thing. However, I do remember using an example I found on here some time ago to make text appear only for a certain usergroup.
I'm wondering if it is possible to link this with a custom field. Basically, I want to be able to allow the user to select if they want avatars on or off, on a particular template. Any help would be greatly appreciated. |
#2
|
||||
|
||||
If you set up a custom user field (fieldx) and then if you want to turn off avatars if that is set to yes, then you could just write a plugin to do it or you could modify the template to do it. Something like:
<if condition="$bbuserinfo['fieldx'] == 'yes'"> stuff </if> |
#3
|
||||
|
||||
That would be:
<vb:if condition="$bbuserinfo['fieldx'] == 'yes'"> stuff </vb:if> |
#5
|
|||
|
|||
Thanks guys. I'll give it a go!
--------------- Added [DATE]1387754786[/DATE] at [TIME]1387754786[/TIME] --------------- Hi guys, I tried the above with no luck. Can you see if I've done something wrong here? Code:
<p> <vb:if condition="$bbuserinfo['field19'] == 'On'"><a></a> <vb:else /> <vb:if condition="$show['avatar'] AND $post['avatarurl']"> <img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" /> <vb:else /> <img src="{vb:stylevar imgdir_misc}/unknown.gif" /> </vb:if> </vb:if> </p> </a> I got it to work by taking out the else statement and only using the conditional. Thanks very much guys, appreciate it! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|