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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2016, 06:42 PM
RobLeonard's Avatar
RobLeonard RobLeonard is offline
 
Join Date: Oct 2014
Location: London, England
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to show the users total "thanks" in header template

Hi there,

I have the "Post Thank You Hack" installed and set up on my forum.
https://vborg.vbsupport.ru/showthread.php?t=165673

I am using a custom theme I have created and I'm stuck on displaying the user's total thanks received within the 'header' template. A screenshot of the box is here:



I've not really done too much modification in terms of php, and have only really developed themes and used the code that vBulletin provides as standard.

Any help would be appreciated.

Many thanks,
Robbie
Reply With Quote
  #2  
Old 01-13-2016, 06:54 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would first take a look at the $vbulletin->userinfo array to see if that datum is already part of the array. Otherwise, you will likely have to create a plugin, with an SQL query, to compute it.
Reply With Quote
  #3  
Old 01-13-2016, 07:08 PM
RobLeonard's Avatar
RobLeonard RobLeonard is offline
 
Join Date: Oct 2014
Location: London, England
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
I would first take a look at the $vbulletin->userinfo array to see if that datum is already part of the array. Otherwise, you will likely have to create a plugin, with an SQL query, to compute it.
Where am I looking for this? (Complete newbie when it comes to this type of thing in vBulletin)
Reply With Quote
  #4  
Old 01-13-2016, 07:19 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Follow:

AdminCP -> Plugins & Products -> Add New Plugin

And then complete the resulting form as follows:

Product: vBulletin

Hook Location: forumhome_complete

Title: Test

Execution Order: 5

Plugin PHP Code:

PHP Code:
print_r($vbulletin->userinfo);
exit; 
Plugin is Active: Yes

Click "Save and Reload", and then go to your forum and look at the home page...you should get a screen full of data. Copy/Paste that data here so I can look at it, and then go back to your AdminCP and set:

Plugin is Active: No

Click "Save".

Once you post that data, I will be able to see if a user's total number of likes is already stared in that array, and we can go from there.
Reply With Quote
  #5  
Old 01-13-2016, 07:38 PM
RobLeonard's Avatar
RobLeonard RobLeonard is offline
 
Join Date: Oct 2014
Location: London, England
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Thank you for that - From that I was able to locate the correct code to place. Which, for anyone else who is curious/interested, is the following code:
Code:
$bbuserinfo[post_thanks_thanked_times]
Thank you for your help,
Reply With Quote
Благодарность от:
MarkFL
  #6  
Old 01-13-2016, 07:40 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From the image you posted in your first post, that appears to be a interesting style, this is vB3?

Would you mind providing a link to your site?
Reply With Quote
  #7  
Old 01-13-2016, 07:41 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RobLeonard View Post
Hi,

Thank you for that - From that I was able to locate the correct code to place. Which, for anyone else who is curious/interested, is the following code:
Code:
$bbuserinfo[post_thanks_thanked_times]
Thank you for your help,
Good deal! And thank you for being conscientious and courteous enough to post your finding for others in the future. :up:
Reply With Quote
  #8  
Old 01-13-2016, 07:50 PM
RobLeonard's Avatar
RobLeonard RobLeonard is offline
 
Join Date: Oct 2014
Location: London, England
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Max Taxable View Post
From the image you posted in your first post, that appears to be a interesting style, this is vB3?

Would you mind providing a link to your site?
I'd share a link, but the theme isn't publically visible yet as we're under development - If you want, you can drop me a private message and I can send some screenshots over to you

Quote:
Originally Posted by MarkFL View Post
Good deal! And thank you for being conscientious and courteous enough to post your finding for others in the future. :up:
I appreciate your help, I'm just not the type of person that wants to be spoonfed the whole way - I like a challenge and at a last resort will I ask for help. Your post helped a great deal!
Reply With Quote
Благодарность от:
Max Taxable
  #9  
Old 01-13-2016, 08:06 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RobLeonard View Post
I'd share a link, but the theme isn't publically visible yet as we're under development - If you want, you can drop me a private message and I can send some screenshots over to you
That would be cool but would really rather have a link when you have it, via PM as well if you want.
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 09:06 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.04131 seconds
  • Memory Usage 2,253KB
  • 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
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (2)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • 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