Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 30 Sep 2009, 17:47
wtrk wtrk is offline
 
Join Date: Jun 2005
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):


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

2) Is the answer the name of the check box? And if the check box name is two or more words, do I just put that in quotes like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

3) Is $user[filedX] better to use than $post[fieldX]?

Thanks.
Reply With Quote
  #2  
Old 30 Sep 2009, 18:01
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 30 Sep 2009, 18:29
wtrk wtrk is offline
 
Join Date: Jun 2005
sorry, id like it to be used in the ad display templates, header_end template.
Reply With Quote
  #4  
Old 30 Sep 2009, 18:34
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.)
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 30 Sep 2009, 19:42
wtrk wtrk is offline
 
Join Date: Jun 2005
cool thanks, $bbuserinfo is the right one, i got it to work. thanks!

Last edited by wtrk; 30 Sep 2009 at 19:49.
Reply With Quote
  #6  
Old 03 Oct 2009, 23:49
thefarg thefarg is offline
 
Join Date: Aug 2009
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
Reply With Quote
  #7  
Old 04 Oct 2009, 04:30
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #8  
Old 04 Oct 2009, 19:46
thefarg thefarg is offline
 
Join Date: Aug 2009
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
Reply With Quote
  #9  
Old 04 Oct 2009, 20:59
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Did you try $prepared like I also suggested may work?
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #10  
Old 10 Oct 2009, 06:05
thefarg thefarg is offline
 
Join Date: Aug 2009
$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.
Reply With Quote
  #11  
Old 10 Oct 2009, 17:32
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
I have a field14 on my test site to enter user names. I have a test user that put "Quake" in that field. I then put this code in the MEMBERINFO template and got output only on his profile page:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So, $userinfo is the variable you want to use in that template.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 04:29.

Layout Options | Width: Wide Color: