vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=224295

display content based on custom profile fields?
by wtrk
30 Sep 2009 17:47

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.

Lynne 30 Sep 2009 18:01

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.

wtrk 30 Sep 2009 18:29

sorry, id like it to be used in the ad display templates, header_end template.

Lynne 30 Sep 2009 18:34

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.)

wtrk 30 Sep 2009 19:42

cool thanks, $bbuserinfo is the right one, i got it to work. thanks!

thefarg 03 Oct 2009 23:49

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

Lynne 04 Oct 2009 04:30

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.

thefarg 04 Oct 2009 19:46

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

Lynne 04 Oct 2009 20:59

Did you try $prepared like I also suggested may work?

thefarg 10 Oct 2009 06:05

$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.

Lynne 10 Oct 2009 17:32

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.


All times are GMT. The time now is 00:30.

Powered by vBulletin® Version 3.8.12
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.