vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5 Connect Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=249)
-   -   [vB5] User Profile Fields in the postbit templates (https://vborg.vbsupport.ru/showthread.php?t=297041)

Spangle 07-31-2014 09:00 AM

I'm using 5.1.3 A6 and I still cannot get this to display the profile fields, here is the code I am using in the template conversation_fields

Code:

{vb:data userInfo, user, fetchProfileInfo, {vb:raw conversation.userid}}

<vb:if condition="$userInfo['field5']"><li><label>{vb:phrase field5_title}:</label> <span>{vb:raw userInfo.customFields.default.field5_title.val}</span></li></vb:if>

<vb:if condition="$userInfo['field2']"><li><label>{vb:phrase field2_title}:</label> <span>{vb:raw userInfo.customFields.default.field2_title.val}</span></li></vb:if>


Lynne 07-31-2014 04:28 PM

I just put your code into the template on my site and it works just fine.

If you are still getting the This is a Serious Error message on your page, then go into debug mode and see what the real error is.

To enable debug mode edit the /config.php file and change:

Code:

$config['debug'] = false;
To:
Code:

$config['debug'] = true;
Then edit the /core/includes/config.php file and change:

Code:

// $config['Misc']['debug'] = true;
To:
Code:

$config['Misc']['debug'] = true;
To set that up for only your IP address (replace xxx.xxx.xxx.xxx with your IP), put these lines around the code:

Code:

if($_SERVER['REMOTE_ADDR'] == "xxx.xxx.xxx.xxx") {
CODE HERE
}


DisasterDotCom 08-10-2014 02:16 AM

How would I display a piece of information in the postbit only if the user VIEWING the page is logged in and in the supermoderator or admin user group?

--------------- Added [DATE]1407644438[/DATE] at [TIME]1407644438[/TIME] ---------------

Actually, I think I got it... but this could probably be cleaned up... I'm also not 100% sure membergroupids is an array? This is vb5.1.2

<vb:if condition="in_array($bbuserinfo[usergroupid], array(5,6,16))">
<vb:if condition="in_array($userInfo['membergroupids'], array(14,15))">
<span style="color:red;font-weight:bold;">Display Stuff Here</span><br>
</vb:if>
</vb:if>

--------------- Added [DATE]1407645650[/DATE] at [TIME]1407645650[/TIME] ---------------

And one more update... userinfo['membergroupids'] shows up as a string when I do a debugvardump. How do I check to see if it contains the group ID? vBulletin doesn't allow you to search in a string according to http://bit.ly/1uBdO1U

Lynne 08-10-2014 03:54 PM

I believe is_member_of is the function your would want to use.

<vb:if condition="is_member_of($bbuserinfo, 5, 6, 16)">
<vb:if condition="is_member_of($userInfo, 14, 15)">

DesignMVD 09-03-2014 03:11 AM

1 Attachment(s)
Thanks for the tutorial!

I show my result :)

vvlo 09-04-2014 04:32 AM

hi
I can not find Admincp > Styles & Templates > Style Manager > Add New Template
Instead There is : Add New style
And there is no place to add code

Lynne 09-04-2014 05:04 PM

Add New Template is a dropdown next to the style. The default dropdown will say Style Variable Editor, so just click on that to see the other options.

vvlo 09-04-2014 06:05 PM

Quote:

Originally Posted by Lynne (Post 2513774)
Add New Template is a dropdown next to the style. The default dropdown will say Style Variable Editor, so just click on that to see the other options.

i use vBulletin Default Theme, and not see this option in dropdown.:(

dropdown option :edit setting
add child style
download
delete style

I added a child style and did change it and the problem was solved.
Thank you.

raynestorm 03-16-2015 08:51 PM

Hello--
I am following this tutorial and have created a new category called "Custom" and added a new field called "industry". "Industry" has several check boxes for the user to check. The "Custom" category has ID = 1 and the industry field is field=5. I created and added this code to a template called "conversation_fields":
PHP Code:

{vb:data userInfouserfetchProfileInfo, {vb:raw conversation.userid}}
<
vb:if condition="$userInfo['field5']"><li><label>{vb:phrase field5_title}:</label> <span>{vb:raw userInfo.customFields.category1_title.field5_title.val}</span></li></vb:if> 

The word "Industry: " displays in my postpit but the values (picked by checkbox) do not display. How can I get the value of the field "Industry" to also be displayed?

Thanks.

Lynne 03-17-2015 06:16 PM

That looks like it should work. Can I get a screen shot of your profile field 5?


All times are GMT. The time now is 10:08 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.01249 seconds
  • Memory Usage 1,747KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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