The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
display content based on custom profile fields?
I need some help. Id like to display some different content depending on the answer to the custom profile field question, but Im having some issues and have a few questions.
1) Is this the correct code to display the content based on the profile field (check boxes): Code:
<if condition="$post[fieldX] == 'Answer'"> content shown here </if> Code:
<if condition="$post[fieldX] == 'Answer Two'"> content shown here </if> Thanks. |
#2
|
||||
|
||||
You really need to tell us what template you are using this in because that would determine what the variable name would be. If you are doing this in the postbit or postbit_legacy template, then $post would be used for the person who's post you are displaying.
|
#3
|
|||
|
|||
sorry, id like it to be used in the ad display templates, header_end template.
|
#4
|
||||
|
||||
And who's profile field are you looking at - the person who's viewing the page? If so, that is $bbuserinfo and that is the variable name throughout the templates.
(I don't know anything about the ad display templates since I've never used them.) |
#5
|
|||
|
|||
cool thanks, $bbuserinfo is the right one, i got it to work. thanks!
|
#6
|
|||
|
|||
So if I wanted to display in MEMBERINFO template, and wanted to view for the owner of the profile would I use $post[fieldX] ? is there a COMPLET variable list? I have looked in the [TUT] area but they are all incomplete. Any help much appreciated
|
#7
|
||||
|
||||
I think the variable to use in the MEMBERINFO template for the owner of the profile is $userinfo[fieldx] (or $prepared[fieldx]). The way to find out is to look at the code prior to the template being evaled and see the name of the variables used in there.
|
#8
|
|||
|
|||
ummmm, how would i do that? I have tried ($vbulletin->userinfo['fieldxx']) but it displays my field. I have tried ($userinfo['field65']) but it doesnt show anything
|
#9
|
||||
|
||||
Did you try $prepared like I also suggested may work?
|
#10
|
|||
|
|||
$vbulletin->userinfo
$bbuserinfo $post $userinfo $prepared The only one that works is $vbulletin->userinfo but it only allows me to view my own. Anyone else viewing gets nothing showing up. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|