PDA

View Full Version : Profile Field in SHOWTHREAD


B-runner
08-24-2013, 11:38 PM
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/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/vbulletin-4-quick-tips-and-customizations/371173-using-your-user-profile-fields-in-your-postbit-templates

http://www.vbulletin.com/forum/forum/customizing-vbulletin/vbulletin-templates-graphics-styles/353770-help-with-adding-custom-profiles-field-in-memberinfo-template-need-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, 08: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, 04: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, 04: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, 04: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-06-2013, 12:56 AM
That's it! Using $bbuserinfo['field17'] worked. Yes, I want the viewer.

Thanks so much Lynne! :)