vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to turn the "Post Thank You" hack into a "Likes" system similar to vBulletin.org (https://vborg.vbsupport.ru/showthread.php?t=266358)

viper357 08-26-2011 05:58 AM

Well that's really strange, I tested it on the default style and it worked, so went back to my modified style and it was still working, I made no other changes whatsoever, really odd, oh well, it's working now, I don't know how or why, lol. Thanks for the help and for this mod.

Joe, pretty please Joe :p, I noticed on your site that you give your users the option to switch off this hack in their usercp. Would you mind sharing how to do that? Thanks.:)

BirdOPrey5 08-26-2011 08:49 AM

Quote:

Originally Posted by viper357 (Post 2238201)
Well that's really strange, I tested it on the default style and it worked, so went back to my modified style and it was still working, I made no other changes whatsoever, really odd, oh well, it's working now, I don't know how or why, lol. Thanks for the help and for this mod.

Joe, pretty please Joe :p, I noticed on your site that you give your users the option to switch off this hack in their usercp. Would you mind sharing how to do that? Thanks.:)

Glad it's working.

Step 1- Make new user profile field, single selection radio box, options:
No
Yes

Step 2- Edit the postbit_display_complete plugin. Change the 2nd Conditional to:
Code:

if (can_thank_this_post($post, $thread['isdeleted']) && !thanked_already($post) && $vbulletin->userinfo['field29'] != "No" && $post['userid'] != 0)
Step 3- Edit the postbit_display_start plugin. Change the 1st Conditional to:
Code:

if ($vbulletin->userinfo['field29'] != "No" && !(defined('LOCATION_BYPASS')) && !(post_thanks_off($this->thread['forumid'], $this->post, $this->thread['firstpostid'], THIS_SCRIPT)))
Change "field29" in each to whatever field number is assigned to your custom profile filed... maybe field5 or field6, depends how many others you already have.

Note: Putting the "No" before the "Yes" and checking for "No" in the code is important so that it's active for everyone EXCEPT those who specifically opt-out of it.

viper357 08-28-2011 05:05 AM

Thanks Joe, much appreciated. :)

EddyMaxx 09-05-2011 09:08 PM

Great tutorial. I was able to follow it all the way through for both the LIKE and DISLIKE buttons.

Nice job Joe!

NTMID8 09-06-2011 01:43 AM

Quote:

Originally Posted by MagicThemeParks (Post 2217361)
"Sorry, you are not allowed to 'Like' this post."

Wasn't the standard, "you've liked this guy's posts too much" message :)

Quote:

Originally Posted by BirdOPrey5 (Post 2218236)
FYI to all- Paul has reported the bug preventing the "Liking" of articles here on vb.org is fixed. :up:

Any idea what Paul did to fix this error? I have a few users randomly reporting the same on my forum. (using v4.1.5)

Quote:

Originally Posted by Post Reader (Post 2219525)
looks there is a problem when somone thanx the post the page needs to refresh again and AJAX feature is not working...

Has anyone figured out how to get AJAX working again? (using v4.1.5)

Quote:

Originally Posted by MagicThemeParks (Post 2222407)
If you select the option to work with reputation points you can.

Probably right in front of me but I am not seeing it. Where do you set this up to work with reputation points?

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

Quote:

Originally Posted by BirdOPrey5 (Post 2238231)
Glad it's working.

Step 1- Make new user profile field, single selection radio box, options:
No
Yes

Step 2- Edit the postbit_display_complete plugin. Change the 2nd Conditional to:
Code:

if (can_thank_this_post($post, $thread['isdeleted']) && !thanked_already($post) && $vbulletin->userinfo['field29'] != "No" && $post['userid'] != 0)
Step 3- Edit the postbit_display_start plugin. Change the 1st Conditional to:
Code:

if ($vbulletin->userinfo['field29'] != "No" && !(defined('LOCATION_BYPASS')) && !(post_thanks_off($this->thread['forumid'], $this->post, $this->thread['firstpostid'], THIS_SCRIPT)))
Change "field29" in each to whatever field number is assigned to your custom profile filed... maybe field5 or field6, depends how many others you already have.

Note: Putting the "No" before the "Yes" and checking for "No" in the code is important so that it's active for everyone EXCEPT those who specifically opt-out of it.

Anyone know how to get this working under v4.1.5? I made the change to postbit_display_complete as shown above. There is no postbit_display_start in v4 but that line exists in postbit_display_complete so I made that edit there as well. Tested out and regardless of whether my option is set to No or Yes, I can still see the Like system.

MagicThemeParks 09-06-2011 02:48 AM

Post #35 and Post #36 help you with the 4.x install instructions and alternate placement. :up:

NTMID8 09-06-2011 03:13 AM

Quote:

Originally Posted by MagicThemeParks (Post 2242426)
Post #35 and Post #36 help you with the 4.x install instructions and alternate placement. :up:

I skimmed those but since I had it working other than AJAX I did not pay too much attention. Plus, they do not help with the user option to disable the whole system that BoP posted more recently.

However, I did fix my AJAX problem by going back and having a second look. For my site, the design of the Like box is all contained within the template post_thanks_postbit. Therefore the contents of my template post_thanks_box was simply:

PHP Code:

{vb:raw post_thanks_box

Upon taking another look, I changed it to the following which fixed the AJAX issue:

PHP Code:

<div id="post_thanks_box_{vb:raw post.postid}">
{
vb:raw post_thanks_box}
</
div

So thanks for making take a second look! :)

BirdOPrey5 09-06-2011 10:04 AM

Quote:

Originally Posted by NTMID8 (Post 2242415)
Anyone know how to get this working under v4.1.5? I made the change to postbit_display_complete as shown above. There is no postbit_display_start in v4 but that line exists in postbit_display_complete so I made that edit there as well. Tested out and regardless of whether my option is set to No or Yes, I can still see the Like system.

You can just edit the postbit_display_start and postbit_display_complete plugins... put the code that mentions the template hook inside this conditional:

PHP Code:

if ($vbulletin->userinfo['field29'] != "No")
{
     
//Original Code Here


again change "29" to whatever field number yours is.

As for your earlier question about what Paul did- it doesn't matter, the vb.org like system is completely custom and has nothing to do with the mod this article is based on- so nothing Paul did here is relevant.

kevin.kool 09-21-2011 03:18 PM

Hope you will release this article for vB4 soon :)

HMBeaty 09-21-2011 03:19 PM

Quote:

Originally Posted by kevin.kool (Post 2248634)
Hope you will release this article for vB4 soon :)

Read the previous posts to use this with vB 4


All times are GMT. The time now is 12:26 AM.

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.01379 seconds
  • Memory Usage 1,760KB
  • 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
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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