vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   display content based on custom profile fields? (https://vborg.vbsupport.ru/showthread.php?t=224295)

wtrk 09-30-2009 04:47 PM

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>

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:

Code:

<if condition="$post[fieldX] == 'Answer Two'">
content shown here
</if>

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

Thanks.

Lynne 09-30-2009 05:01 PM

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 09-30-2009 05:29 PM

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

Lynne 09-30-2009 05:34 PM

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 09-30-2009 06:42 PM

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

thefarg 10-03-2009 10:49 PM

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 10-04-2009 03:30 AM

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 10-04-2009 06:46 PM

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 10-04-2009 07:59 PM

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

thefarg 10-10-2009 05:05 AM

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


All times are GMT. The time now is 12:55 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01368 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete