Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2009, 04:47 PM
wtrk wtrk is offline
 
Join Date: Jun 2005
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 09-30-2009, 05:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 09-30-2009, 05:29 PM
wtrk wtrk is offline
 
Join Date: Jun 2005
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry, id like it to be used in the ad display templates, header_end template.
Reply With Quote
  #4  
Old 09-30-2009, 05:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
  #5  
Old 09-30-2009, 06:42 PM
wtrk wtrk is offline
 
Join Date: Jun 2005
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool thanks, $bbuserinfo is the right one, i got it to work. thanks!
Reply With Quote
  #6  
Old 10-03-2009, 10:49 PM
thefarg thefarg is offline
 
Join Date: Aug 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 10-04-2009, 03:30 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 10-04-2009, 06:46 PM
thefarg thefarg is offline
 
Join Date: Aug 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 10-04-2009, 07:59 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you try $prepared like I also suggested may work?
Reply With Quote
  #10  
Old 10-10-2009, 05:05 AM
thefarg thefarg is offline
 
Join Date: Aug 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


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

Forum Jump


All times are GMT. The time now is 07:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07840 seconds
  • Memory Usage 2,250KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete