The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Postbit conditional based on profile field
I'm probably using the wrong approach with what I'm trying to do:
I've added some custom profile fields and have them displayed on the postbit. Now, I would like to give users the option of turning the display of these fields off when they view threads. To enable the choice, I've created a user profile field of type Single Selection Radio buttons, with the values of 'Yes' and 'No', the question being "Do you wish to display blah". The field name is field25. In the postbit template, I want to surround my custom field display code with an if conditional that applies to the user viewing the page, and does not apply to the post, but I can't figure out quite how to do that. I've tried: HTML Code:
<if condition="$bbuserinfo['field25'] == Yes"> Custom code goes here</if> HTML Code:
<if condition="$userinfo['field25'] == Yes">Custom code goes here</if> I've even tried just printing out the value of field25 by using displaying it without any if conditionals ($userinfo[field25]) but it is empty. What am I doing wrong? |
#2
|
||||
|
||||
Try:
HTML Code:
<if condition="$post['field25'] == 'Yes'">Custom code goes here</if> |
#3
|
|||
|
|||
But surely the $post variable applies only to a particular user's post?
It won't have an effect on the person actually viewing the thread. So, if *I* set the option to No, only my own posts would not display the code, and nobody would be able to see it, despite the setting in their profile. I'm not sure if I'm getting my concept across correctly. I want my field25 code to behave similarly to the users own 'show signature' option. That is, if I set View Signatures to YES in my own profile, then I can see everybody's sigs on their posts. If I set it to NO in my profile, then I can't see anybody's sigs in their posts. |
#4
|
||||
|
||||
Then use postinfo instead of post.
|
#5
|
|||
|
|||
Code:
<if condition="$bbuserinfo[field25]=='Yes'">Code</if> If it doesn't work, let me know and I'll have another look at it when I have more time later tonight. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|