Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-16-2018, 05:46 PM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Display User Profile Fields Info in Thread Post

I have 6 user profile fields setup. All 6 show up in the "Edit User Profile" area for each member to fill in if they wish.

I would like at least one of these user profile fields to be displayed along with a members avatar, reputation, post count stats each time they post a reply in a thread.

This information used to be displayed...and now has somehow disappeared. I can't seem to find the Admin control panel setting to allow this user profile info to be displayed each time they post a reply to a thread.

Can someone please point me where this setting is located?

Thank You
Reply With Quote
  #2  
Old 08-17-2018, 10:43 AM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add this to your postbit or postbit_legacy template

<vb:if condition="$post['fieldX']"><dt>XXXXXXXXX</dt> <dd>{vb:raw post.fieldX}</dd></vb:if>

Get X from the custom userfield.
Reply With Quote
  #3  
Old 08-17-2018, 11:33 AM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by snakes1100 View Post
Add this to your postbit or postbit_legacy template

<vb:if condition="$post['fieldX']"><dt>XXXXXXXXX</dt> <dd>{vb:raw post.fieldX}</dd></vb:if>

Get X from the custom userfield.
Cool...thanks.

Do I just add that line of code anywhere in the postbit_legacy template...at the end for example?

And this will allow me to be able to display some extra user profile info below a members avatar, reputation, and post counts stats?

Thanks again.
Reply With Quote
  #4  
Old 08-17-2018, 12:13 PM
iA1 iA1 is offline
 
Join Date: Jul 2018
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add it after the post count in postbit_legacy template.

Or instead of modifying templates, simply create a new plugin at hook location postbit_display_complete and add the following:

Code:
if ($post['fieldX']) {
$template_hook['postbit_userinfo_right_after_posts'] .= "<dt>PHRASE TO DISPLAY</dt> <dd>" . $post['fieldX'] . "</dd>";
}
Adding a plugin is better than modifying templates because every time you upgrade your forum, you will have to modify the templates once again. Plugins can be easily enabled and disabled.
Reply With Quote
  #5  
Old 08-17-2018, 03:40 PM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wanted to be 100% sure I described what I want to do.

Here's screenshot of the info I want to show up with each thread post a member makes:




I want both the red arrow & purple arrow item's in the screenshot above to be displayed here below the "normal" info that is displayed with each members thread post (purple arrow, 2nd screenshot below):




Thank you.

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

Quote:
Originally Posted by snakes1100 View Post
Add this to your postbit or postbit_legacy template

<vb:if condition="$post['fieldX']"><dt>XXXXXXXXX</dt> <dd>{vb:raw post.fieldX}</dd></vb:if>

Get X from the custom userfield.
Hello Snakes1100. Thanks for the help. Given the info I posted with the screenshots. If I wanted both the:

- "Your Mac's Specs" (red arrow)
- And the info the user enters into the field (purple arrow)

Does the line of code you mentioned to add to the postbit_legacy template still do the trick?

Thanks

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

Quote:
Originally Posted by iA1 View Post
Add it after the post count in postbit_legacy template.

Or instead of modifying templates, simply create a new plugin at hook location postbit_display_complete and add the following:

Code:
if ($post['fieldX']) {
$template_hook['postbit_userinfo_right_after_posts'] .= "<dt>PHRASE TO DISPLAY</dt> <dd>" . $post['fieldX'] . "</dd>";
}
Adding a plugin is better than modifying templates because every time you upgrade your forum, you will have to modify the templates once again. Plugins can be easily enabled and disabled.
Hello iA1. Thanks for the help. Same question I asked Snakes1100. Given the info I posted with the screenshots. If I wanted both the:

- "Your Mac's Specs" (red arrow)
- And the info the user enters into the field (purple arrow)

Does the code you mentioned for creating a new plugin still do the trick?

Thanks
Reply With Quote
  #6  
Old 08-17-2018, 05:21 PM
iA1 iA1 is offline
 
Join Date: Jul 2018
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, the plugin does exactly that. Just change the X in fieldX to whatever field number you have in user profile fields manager https://www.yourdomain.com/admincp/p....php?do=modify

Reply With Quote
  #7  
Old 08-17-2018, 07:15 PM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by iA1 View Post
Yes, the plugin does exactly that. Just change the X in fieldX to whatever field number you have in user profile fields manager
Thanks very much iA1 for the expanded explanation. Adding the part about the "fieldX" I missed in your earlier post.

So just to make sure I understand 100%. If I take the line of code you mentioned earlier to create a new plug-in with:


if ($post['fieldX']) {$template_hook['postbit_userinfo_right_after_posts'] .= "<dt>PHRASE TO DISPLAY</dt> <dd>" . $post['fieldX'] . "</dd>";}



* I need to enter the proper user profile field where the 'fieldX' statement is located?
* What do I enter in the PHRASE TO DISPLAY part of the code? In the 1st screenshot I posted above...would this be the phrase "Your Mac's Specs"?

Thanks again.
Reply With Quote
  #8  
Old 08-17-2018, 07:21 PM
iA1 iA1 is offline
 
Join Date: Jul 2018
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by alfuzzy View Post

* I need to enter the proper user profile field where the 'fieldX' statement is located?
* What do I enter in the PHRASE TO DISPLAY part of the code? In the 1st screenshot I posted above...would this be the phrase "Your Mac's Specs"?

Thanks again.
Yes, for both the questions.
Reply With Quote
  #9  
Old 08-17-2018, 07:55 PM
alfuzzy alfuzzy is offline
 
Join Date: Jul 2018
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by iA1 View Post
Yes, for both the questions.
Awesome! Will give this a try shortly. Haven't created a plug-in before. Will post how it goes.

Thanks

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

Hey iA1. I believe I did everything correctly...but the user profile info I would like to display is not displaying.

Here's a screenshot of the plugin I created. As you can see it is "active". Only input area I wasn't sure about was the "Execution Order". For some reason it came up with a default setting of "5"...so I didn't change it.

If that wouldn't have caused any issue's...what else might I try? Thanks


Reply With Quote
  #10  
Old 08-18-2018, 01:43 AM
iA1 iA1 is offline
 
Join Date: Jul 2018
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Clear cache and check again. Which vB version are you using?

If it doesn't work, then edit the template and use the code given by snakes1100. Search for postbit_userinfo_right_after_posts in postbit_legacy template and add the code just above or below that line.
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 02:13 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.17914 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
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
  • (6)bbcode_quote
  • (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_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