vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Profile Field in SHOWTHREAD (https://vborg.vbsupport.ru/showthread.php?t=301585)

B-runner 08-24-2013 10:38 PM

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.

RickyH 08-31-2013 07:18 AM

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.

Lynne 08-31-2013 03:02 PM

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.

B-runner 09-05-2013 03:10 AM

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

Lynne 09-05-2013 03:13 PM

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']

B-runner 09-05-2013 11:56 PM

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

Thanks so much Lynne! :)


All times are GMT. The time now is 09:33 PM.

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.01798 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete