Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
How to turn the "Post Thank You" hack into a "Likes" system similar to vBulletin.org
BirdOPrey5
Join Date: Jun 2008
Posts: 10,580

The details of my life are quite inconsequential.

New York
by BirdOPrey5 BirdOPrey5 is offline 06 Jul 2011
Rating: (2 votes - 5.00 average)

Note: These instructions are for VB 3.8. See post #35 by michal72 for a VB4 adaptation.

First off, the "Likes" system on vBulletin.org is custom and does not use any other hacks- however it is too custom to be released. Instead you can modify an existing mod to do mostly the same thing.

Several people have asked me for info on how to do this so I figured I'd write it up and post it here.

You can see what it looks like on my live forum: http://www.juot.net/forums/showthread.php?t=60059



You need the latest version Abe1's Post Thank You Hack (7.7): Here.

What you can see above was done with this mod plus some phrase changes and template edits, and an optional plugin edit.

So step 1 is make sure you have the “Thank You” mod installed and working.

Step 2 is to change the following phrases. In Admin CP use Phrase Manager to "translate" these phrases from "Thank You" to "Like(s)":

You can of course use your own translations but this is what I used-

Phrase Name | Translation:
post_thanks_already | You have already liked this post!
post_thanks_remove_user | Remove Your Like
post_thanks_search | Find All Liked Posts
post_thanks_search_user | Find all liked posts by {1}
post_thanks_search_user_gave | Find all posts liked by {1}
post_thanks_thanked_post | Liked Post
post_thanks_thanks | Likes
post_thanks_time_post | Liked 1 Time in 1 Post
post_thanks_times_post | Liked {1} Times in 1 Post
post_thanks_times_posts | Liked {1} Times in {2} Posts
post_thanks_total_thanks | Total Likes
post_thanks_user_says | The Following User Likes This Post:
post_thanks_users_say | The Following {1} Users Like This Post:

Some of the above we won't actually use in my implementation but best to fix them all to be consistent.

Step 3:

At this point we need to have a "like.png" file in your images/buttons/ directory and the button directory for every custom style you have, if any. I will attach a couple of options but consider finding or making one unique to your forum.

Step 4:

Now we have to edit a couple of templates.

Edit the template: post_thanks_button

Replace it all with this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Note: The above template will work correct if you use the "Post Groan Hack" which I also use. You can convert the "Post Groan Hack" into an "dis-like" system basiclly the same way we are changing "Thank You" to "Likes."


Edit the template: post_thanks_postbit_legacy OR post_thanks_postbit (whichever postbit you use)

Replace it all with this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


At this point you should have a nice light-green "Like" box appearing below each post someone "Likes." You might want to stop here.

The last steps are only if you want to integrate the Like box INTO the posts like on my forum.

If you do the next step is pretty easy-

In Admin CP -> Plugin Manager, edit the plugin: Post Thank You Hack on hook: postbit_display_start

Find the line:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and change it to:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

OK This will move the "Like" box into the actual post table instead of below it.

Again this is a good place to stop if you are happy.

However there is one more template edit I did to keep the Like Box inside the post but at the very bottom of it regardless how short the post might be. In this case we must edit the postbit_legacy template. (I don't use the regular postbit template so I don't have any further instructions for people who use regular postbit. The following is ONLY for postbit_legacy.)

IMPORTANT- Copy all of your postbit_legacy template to a text file and save it as a backup in case you make an error or the instructions don't work for you. You can also "Revert" the template but that will undo ALL customizations you may have made.

Find in postbit_legacy:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change it to:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Find:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And delete it.

Find:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Add BELOW it:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

----

And that should do it.

Of course you are encouraged to make some customizations... Most of what you'll want to change is in the top part of the post_thanks_postbit_legacy template. The background color, border style, and the like are all controlled by this code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

On my forum I actually use a background image texture but did not include it here as it is an unnecessary complication.

Feel free to play around and tweak the box to your liking.
Attached Images
File Type: jpg Likes_ss.jpg (313.7 KB, 4121 views)
File Type: png like.png (1.7 KB, 3476 views)
File Type: png like2.png (2.0 KB, 3472 views)
Attached Files
File Type: txt Like System Converion by BOP5.txt (6.1 KB, 127 views)

Last edited by BirdOPrey5; 16 Oct 2011 at 23:15..
Views: 41410
Reply With Quote
Comments
  #2  
Old 06 Jul 2011, 12:15
MagicThemeParks's Avatar
MagicThemeParks MagicThemeParks is offline
 
Join Date: Sep 2009
I've already done most of these edits on one site and plan to do the same on others. But, this should help those searching for an option without doing a custom add-on. Great explanation as always Joe!

UNRELATED: Noticed on this article it will not allow me to "like" (clicking the heart icon) the thread. May want to look into permissions or something on this.
Reply With Quote
  #3  
Old 06 Jul 2011, 12:19
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by MagicThemeParks View Post
UNRELATED: Noticed on this article it will not allow me to "like" (clicking the heart icon) the thread. May want to look into permissions or something on this.
Thanks for the info. What message were you getting exactly?
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #4  
Old 06 Jul 2011, 12:24
MagicThemeParks's Avatar
MagicThemeParks MagicThemeParks is offline
 
Join Date: Sep 2009
"Sorry, you are not allowed to 'Like' this post."

Wasn't the standard, "you've liked this guy's posts too much" message
Reply With Quote
  #5  
Old 06 Jul 2011, 12:31
Tasking Mickey's Avatar
Tasking Mickey Tasking Mickey is offline
 
Join Date: Jun 2010
Hmm, I did everything you said Joe, from step 1 to step 4, plus I did the
"The last steps are only if you want to integrate the Like box INTO the posts like on my forum."
I did everything, went to a post, clicked on my liked button to like a post, and nothing showed, the button left of course, but nothing showed below the sig or anything, even when I refresh the page.

I may of did something wrong, maybe you can diagnose what's up? lol.
__________________
Just a simple kid who has a knack for procrastination and tries his best to help one anothers.
Be sure to read vB.org's primary rules!
Reply With Quote
  #6  
Old 06 Jul 2011, 12:34
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by Tasking Mickey View Post
Hmm, I did everything you said Joe, from step 1 to step 4, plus I did the

I did everything, went to a post, clicked on my liked button to like a post, and nothing showed, the button left of course, but nothing showed below the sig or anything, even when I refresh the page.

I may of did something wrong, maybe you can diagnose what's up? lol.
If your postbit_legacy template confirm you have the line:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

In the plugin confirm you have the right hook in the eval statement : postbit_signature_end
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #7  
Old 06 Jul 2011, 12:39
Tasking Mickey's Avatar
Tasking Mickey Tasking Mickey is offline
 
Join Date: Jun 2010
Originally Posted by BirdOPrey5 View Post
If your postbit_legacy template confirm you have the line:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

In the plugin confirm you have the right hook in the eval statement : postbit_signature_end
Yeppers, the plugin is correct, I'm checking it now


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That's what I have in the plugin, and this is my postbit_legacy's template.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Just a simple kid who has a knack for procrastination and tries his best to help one anothers.
Be sure to read vB.org's primary rules!
Reply With Quote
  #8  
Old 06 Jul 2011, 12:58
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
I uninstalled my Thank You hack and re-installed following the instructions here, just in case I missed a step, but it still is working fine following these exact instructions.

Your postbit_legacy template looks fine.

I'm at a loss right now.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #9  
Old 06 Jul 2011, 13:01
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Did you have the Thank You mod working right before this?
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #10  
Old 06 Jul 2011, 13:04
Tasking Mickey's Avatar
Tasking Mickey Tasking Mickey is offline
 
Join Date: Jun 2010
Originally Posted by BirdOPrey5 View Post
Did you have the Thank You mod working right before this?
Yes, I did, it was working all great.

Let me try removing the files, and uninstalling the product, and reverting the templates, and re-following the steps to see if it'd work.

I'll let you know once I've done this, and hopefully, it'd work, because it must of been an error I caused myself.

By the way, if I revert the postbit, and postbit_legacy templates, would it delete the templates? or revert them back to the original way?
__________________
Just a simple kid who has a knack for procrastination and tries his best to help one anothers.
Be sure to read vB.org's primary rules!
Reply With Quote
  #11  
Old 06 Jul 2011, 13:11
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
If you are in a style (NOT the Master Style) but in any installed style reverting the template will undo all customizations made to that template in that style. You wouldn't see the Master Style unless you were in debug mode.

No reason to delete the php files, those weren't changed.

Also if you uninstall the mod that will erase all the previous "thank yous" you had, I don't see any benefit to uninstalling the mod.

Just re-install the mod with "Allow Overwrite" set to YES.

Then go to your styles and revert the 2 mod templates edited above, you should be back to a stock Thank You install.

And can I have a link to your forum (PM me if you don't want to post it.)
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #12  
Old 06 Jul 2011, 13:38
Tasking Mickey's Avatar
Tasking Mickey Tasking Mickey is offline
 
Join Date: Jun 2010
Originally Posted by BirdOPrey5 View Post
If you are in a style (NOT the Master Style) but in any installed style reverting the template will undo all customizations made to that template in that style. You wouldn't see the Master Style unless you were in debug mode.

No reason to delete the php files, those weren't changed.

Also if you uninstall the mod that will erase all the previous "thank yous" you had, I don't see any benefit to uninstalling the mod.

Just re-install the mod with "Allow Overwrite" set to YES.

Then go to your styles and revert the 2 mod templates edited above, you should be back to a stock Thank You install.

And can I have a link to your forum (PM me if you don't want to post it.)
Oh, this is nice, before you replied, I had uninstalled anything, including the files (the agony) reverted those 2 templates, then re-uploaded the files, and imported the product, now nothing is working, great.

What should I do?
__________________
Just a simple kid who has a knack for procrastination and tries his best to help one anothers.
Be sure to read vB.org's primary rules!
Reply With Quote
  #13  
Old 06 Jul 2011, 13:48
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
pm sent.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #14  
Old 06 Jul 2011, 14:56
BCP Hung's Avatar
BCP Hung BCP Hung is offline
 
Join Date: May 2011
Real name: BCP Hung
@BOP5 : It awesome ! I will do it for my board, and that is for vBulletin 4. More change I will do.

Thanks again !
--------------
P.S : I still can not like your first post !
Reply With Quote
  #15  
Old 06 Jul 2011, 18:35
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
The Like Post issue has been logged in the big tracker. It will be fixed eventually.

Note- these instructions are for VB3.x only. VB4.x will need different template edits. I don't have the VB4 like button.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.

Last edited by BirdOPrey5; 06 Jul 2011 at 22:12.
Reply With Quote
Reply

Similar Article
Article Author Type Replies Last Post
Miscellaneous Hacks "Click to view latest posts in this category" -- Similar to vBulletin.org. DataHero vBulletin 3.8 Template Modifications 5 25 Nov 2012 19:01



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 14:12.

Layout Options | Width: Wide Color: