vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to show the users total "thanks" in header template (https://vborg.vbsupport.ru/showthread.php?t=321487)

RobLeonard 01-13-2016 06:42 PM

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:

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

Quote:

Originally Posted by MarkFL (Post 2562593)
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:

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:
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

Quote:

Originally Posted by RobLeonard (Post 2562602)
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:

RobLeonard 01-13-2016 07:50 PM

Quote:

Originally Posted by Max Taxable (Post 2562603)
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 (Post 2562604)
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

Quote:

Originally Posted by RobLeonard (Post 2562606)
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.


All times are GMT. The time now is 06:51 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.01090 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete