Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 08-24-2013, 11:38 PM
B-runner B-runner is offline
 
Join Date: May 2013
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Profile Field in SHOWTHREAD

I am trying to add a User Profile field in SHOWTHREAD but can't get it to work-- and am not sure if it's even possible.

These posts have some good info:
http://www.vbulletin.com/forum/forum...tbit-templates

http://www.vbulletin.com/forum/forum...var-name-again

I have tried this with a Single-Selection Radio Buttons and a single Multiple-Selection Checkbox - neither work. For the checkbox, I tried the following condition:

<vb:if condition="$show['field17'] & 1">

Which is just like the example in the first link: <vb:if condition="$post['fieldx'] & 1">


Can this work? Is "show" the correct variable? (It's used throughout the SHOWTHREAD template). Post didn't work either.

Is there info on what variables are available where?

Thank you for any help.
Reply With Quote
  #2  
Old 08-31-2013, 08:18 AM
RickyH RickyH is offline
 
Join Date: Dec 2011
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Show should be the correct variable. Basically show works like this:

If user has the field filled in -> Show the field.

From there then you would need to POST the field contents, if it's going in Postbit_Legacy.
Reply With Quote
  #3  
Old 08-31-2013, 04:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why are you using $show['field17'] instead of $post['field17'] ? I would guess that $show['field17'] isn't even defined unless you have some other code you added somewhere to define it.
Reply With Quote
  #4  
Old 09-05-2013, 04:10 AM
B-runner B-runner is offline
 
Join Date: May 2013
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you both. Lynne, I tried using "post" first, but it didn't work, so I tried "show" after that (didn't work either). I'm not sure of the docs that help understand what to use where.

By "didn't work", I mean all evaluations of the field were 0, regardless of the set data.

So I'm wondering if I have any setup problems - is there something I need to make sure is done before this would work? Is there anything I can check?

I'm actually not interested in posting the field content, I just want to use it as a switch to do one of two different actions, that the user can select.

Thanks again.
Reply With Quote
  #5  
Old 09-05-2013, 04:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wait a sec... you are putting this in the SHOWTHREAD template - so you aren't trying to post the field of the posters, but of the viewer instead? If so, you need to use $bbuserinfo['field17']
Reply With Quote
Благодарность от:
tbworld
  #6  
Old 09-06-2013, 12:56 AM
B-runner B-runner is offline
 
Join Date: May 2013
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's it! Using $bbuserinfo['field17'] worked. Yes, I want the viewer.

Thanks so much Lynne!
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:47 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.03830 seconds
  • Memory Usage 2,202KB
  • 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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (1)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete