PDA

View Full Version : How to show the users total "thanks" in header template


RobLeonard
01-13-2016, 06:42 PM
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:

https://vborg.vbsupport.ru/external/2016/01/8.png

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

MarkFL
01-13-2016, 06:54 PM
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. :)

RobLeonard
01-13-2016, 07:08 PM
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)

MarkFL
01-13-2016, 07:19 PM
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:

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.

RobLeonard
01-13-2016, 07:38 PM
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:
$bbuserinfo[post_thanks_thanked_times]

Thank you for your help,

Max Taxable
01-13-2016, 07:40 PM
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?

MarkFL
01-13-2016, 07:41 PM
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:
$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:

RobLeonard
01-13-2016, 07:50 PM
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 :)

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!

Max Taxable
01-13-2016, 08:06 PM
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 youThat would be cool but would really rather have a link when you have it, via PM as well if you want.