View Full Version : How to turn the "Post Thank You" hack into a "Likes" system similar to vBulletin.org
BirdOPrey5
06 Jul 2011, 12:05
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
http://www.vbulletin.org/forum/attachment.php?attachmentid=130766&stc=1&d=1309952895
You need the latest version Abe1's Post Thank You Hack (7.7): Here. (http://www.vbulletin.org/forum/showthread.php?t=165673)
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Note: The above template will work correct if you use the "Post Groan Hack (http://www.vbulletin.org/forum/showthread.php?t=193489)" 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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and change it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Change it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
And delete it.
Find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Add BELOW it:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
----
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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. :up:
MagicThemeParks
06 Jul 2011, 12:15
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! :up:
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.
BirdOPrey5
06 Jul 2011, 12:19
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?
MagicThemeParks
06 Jul 2011, 12:24
"Sorry, you are not allowed to 'Like' this post."
Wasn't the standard, "you've liked this guy's posts too much" message :)
Tasking Mickey
06 Jul 2011, 12:31
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.
BirdOPrey5
06 Jul 2011, 12:34
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
In the plugin confirm you have the right hook in the eval statement : postbit_signature_end
Tasking Mickey
06 Jul 2011, 12:39
If your postbit_legacy template confirm you have the line:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
That's what I have in the plugin, and this is my postbit_legacy's template.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
BirdOPrey5
06 Jul 2011, 12:58
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.
BirdOPrey5
06 Jul 2011, 13:01
Did you have the Thank You mod working right before this?
Tasking Mickey
06 Jul 2011, 13:04
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?
BirdOPrey5
06 Jul 2011, 13:11
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.)
Tasking Mickey
06 Jul 2011, 13:38
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?
BirdOPrey5
06 Jul 2011, 13:48
pm sent.
BCP Hung
06 Jul 2011, 14:56
@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 !
BirdOPrey5
06 Jul 2011, 18:35
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.
BirdOPrey5
06 Jul 2011, 22:13
OK The problem with Tasking Mickey was that he was using the standard postbit, not legacy. I updated the instructions above for use with either the regular postbit or postbit_legacy.
On the plus side it's another forum I can confirm this works on. :up:
rootsxrocks
07 Jul 2011, 01:46
I don't see a reason to limit the likes thus farI want them to use the heck out of it.
BirdOPrey5
07 Jul 2011, 10:47
I don't see a reason to limit the likes thus farI want them to use the heck out of it.
Not sure what that has to do with this article? The "Post Thank You" mod can be configured for unlimited thanks/liking.
tobybird
07 Jul 2011, 14:06
First, thank you for sharing. :)
I'll test this on my test board, but thought I'd ask here first in case you might have any insight...
I'm currently running a modified version of Post Thanks similar to this. I've wanted to add a Like button to my site and was thinking of editing Post Thanks again...similar to what you have provided.
Do you think there would be any issue with, let's say... a site running (an unedited) Post Thanks and your Like system simultaneously?
TIA!
@BOP5 : How can you reduce more "Likes" showing in a post like Facebook or here ?
BirdOPrey5
07 Jul 2011, 15:06
First, thank you for sharing. :)
I'll test this on my test board, but thought I'd ask here first in case you might have any insight...
I'm currently running a modified version of Post Thanks similar to this. I've wanted to add a Like button to my site and was thinking of editing Post Thanks again...similar to what you have provided.
Do you think there would be any issue with, let's say... a site running (an unedited) Post Thanks and your Like system simultaneously?
TIA!
I would strongly suggest installing the "Post Groan Mod" also by Abe1 and turning that into a Likes system since both "Thanks" and "Groan" were made to run simultaneously.
BirdOPrey5
07 Jul 2011, 15:08
@BOP5 : How can you reduce more "Likes" showing in a post like Facebook or here ?
It would need some custom coding- not something I've tried.
Tasking Mickey
07 Jul 2011, 17:22
It would need some custom coding- not something I've tried.
I was just about to mention that, if your forum has lets say, 100 members, and you import the likes system, something like here, it would show
Likes (12): Tasking Mickey, Bird0Prey5, Lynne, Princetoon and 15 others
The 15 others, would show the other people who liked that post, it'd be much better, since it won't take up the whole post with like 20 usernames in the like box.
I would strongly suggest installing the "Post Groan Mod" also by Abe1 and turning that into a Likes system since both "Thanks" and "Groan" were made to run simultaneously.
BUT don't do that if you have any designs on moving to vB4 as there is no "Groan" equivalent for vB4.
reddyink
07 Jul 2011, 21:55
Can you please update instructions for latest version 4.1.4
I can't find template hook postbit_display_start (I have postbit_display_complete)
BirdOPrey5
07 Jul 2011, 22:23
Can you please update instructions for latest version 4.1.4
I can't find template hook postbit_display_start (I have postbit_display_complete)
Maybe eventually but I don't normally use 4.1.4 and never even knew there was a Thank You hack for it. I've got other things on my plate right now. If/when I do I will post a notice here. If anyone else does before me feel free to post here and I'll link it in the first post.
reddyink
07 Jul 2011, 22:42
Maybe eventually but I don't normally use 4.1.4 and never even knew there was a Thank You hack for it. I've got other things on my plate right now. If/when I do I will post a notice here. If anyone else does before me feel free to post here and I'll link it in the first post.
Please note that this will not work (properly) for vb 4.x.x versions as post thank you hack has phrase changes and plugin changes which are different from 3.8x version.
I am only making a note as you have posted on post_thanks vb4.0x version
http://www.vbulletin.org/forum/showthread.php?t=231666&page=110
example: There is no plugin with hook postbit_display_start (instead there is postbit_display_complete)
BirdOPrey5
08 Jul 2011, 00:30
Please note that this will not work (properly) for vb 4.x.x versions as post thank you hack has phrase changes and plugin changes which are different from 3.8x version.
I am only making a note as you have posted on post_thanks vb4.0x version
http://www.vbulletin.org/forum/showthread.php?t=231666&page=110
example: There is no plugin with hook postbit_display_start (instead there is postbit_display_complete)
Oh wow... very sorry about that. I posted in the wrong thread. :o. I have deleted the post to avoid confusion.
I will take a look at the VB4 version as soon as I get a chance.
I have also updated the link and version number in this thread because it was also linking to the 4.x version.
kevin.kool
08 Jul 2011, 06:56
I would kiss you BirdOPrey5 ;) Thank you for this article.
BirdOPrey5
08 Jul 2011, 17:57
I would kiss you BirdOPrey5 ;) Thank you for this article.
Would probably have to pass on that Kevin :eek: but thanks.
FYI to all- Paul has reported the bug preventing the "Liking" of articles here on vb.org is fixed. :up:
reddyink
08 Jul 2011, 22:24
Actually, pretty simple to modify this article for 4.x.x as there are just couple of phrase differences and plugin differences.
Oh wow... very sorry about that. I posted in the wrong thread. :o. I have deleted the post to avoid confusion.
I will take a look at the VB4 version as soon as I get a chance.
I have also updated the link and version number in this thread because it was also linking to the 4.x version.
tobybird
10 Jul 2011, 21:03
I would strongly suggest installing the "Post Groan Mod" also by Abe1 and turning that into a Likes system since both "Thanks" and "Groan" were made to run simultaneously.
BUT don't do that if you have any designs on moving to vB4 as there is no "Groan" equivalent for vB4.
Thank you both :)
Post Reader
12 Jul 2011, 05:12
looks there is a problem when somone thanx the post the page needs to refresh again and AJAX feature is not working...
BirdOPrey5
12 Jul 2011, 12:13
looks there is a problem when somone thanx the post the page needs to refresh again and AJAX feature is not working...
AJAX is working fine for me. Was it working for you before you made the changes? What exactly is the problem?
michal72
18 Jul 2011, 20:10
Actually, pretty simple to modify this article for 4.x.x as there are just couple of phrase differences and plugin differences.
I have modified a little bit Joe's proposal to work with vb4
Change post_thanks_box template to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
In posbit_legacy template find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and add before:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
In Admin CP -> Plugin Manager, edit the plugin: Post Thank You Hack on hook: postbit_display_complete
Find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and replace with:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
You can also modify window's content:
In post_thanks_postbit template replace:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
with:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
BR
DS MrSinister
19 Jul 2011, 05:01
Thxs michal72
I made one change.. this will place it under the signature
In the postbit_legacy i did
Find
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Replace with.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Juggernaut
19 Jul 2011, 12:41
With this method though, you can't see the likes in your control panel, like you can here, with vbullletin 4.
MagicThemeParks
19 Jul 2011, 13:47
With this method though, you can't see the likes in your control panel, like you can here, with vbullletin 4.
If you select the option to work with reputation points you can.
BirdOPrey5
19 Jul 2011, 14:44
With this method though, you can't see the likes in your control panel, like you can here, with vbullletin 4.
I see them under Statistics.
Juggernaut
20 Jul 2011, 01:29
I see them under Statistics.
I see the total number under statistics, but not with links to the posts liked, like here on vbulletin.org, must be a limitation to that system in itself. But overall I like this implementation of the like system. :D
EDIT: Also for some reason the post thank you hack doesn't seem to be working with the reputation system, even though I've set for all likes to give all users 5 points of reputation, I don't see any reputation added with the likes. Could this be a error caused by these edits or some bug with the mod itself? I am running vbulletin 4.1.4 in my forum.
BirdOPrey5
20 Jul 2011, 01:54
I really can't test it on 4.x right now. I know it works fine on 3.8. I would revert back to the "Thank You" hack and see if it works then- that would confirm a bug with the changed code or just a limitation of the mod itself.
Juggernaut
20 Jul 2011, 02:16
I really can't test it on 4.x right now. I know it works fine on 3.8. I would revert back to the "Thank You" hack and see if it works then- that would confirm a bug with the changed code or just a limitation of the mod itself.
After checking the default postbit_display_complete plugin, it seems to be a bug with the changed code, as the reputation does work with the default code. Fixed, it seems I hadn't updated the code correctly, it was totally my fault.
Post Reader
21 Jul 2011, 13:37
BOP the problem is still there... AJAX feature is not working... when ever i click on the like button the page refreshes which in post thank you hack was not the case...
any solution?
BirdOPrey5
21 Jul 2011, 14:04
BOP the problem is still there... AJAX feature is not working... when ever i click on the like button the page refreshes which in post thank you hack was not the case...
any solution?
I suggest reverting back to the original Post Thank You Hack (re-install if you must and revert the templates) and see if AJAX is working before these edits are made.
Post Reader
21 Jul 2011, 16:04
have totally re installed the product but will try again now... let me do this, i'll get back to you... thank you
--------------- Added 1311308942 at 1311308942 ---------------
now its working fine... i have re-uploaded all files again and then imported the product.. Thanx BOP
Juggernaut
24 Jul 2011, 02:08
I was just about to mention that, if your forum has lets say, 100 members, and you import the likes system, something like here, it would show
Likes (12): Tasking Mickey, Bird0Prey5, Lynne, Princetoon and 15 others
The 15 others, would show the other people who liked that post, it'd be much better, since it won't take up the whole post with like 20 usernames in the like box.
This would be nice, if posible. Only thing is, I don't think the vbulletin 4 version of the thanks system keeps track of the likes given and received, like the likes system here on vbulletin.org. Still way better than the original layout, in my opinion. :D
I have modified a little bit Joe's proposal to work with vb4
The Likes box is centered under the post. How can I make it aligned left with the post and signature?
Also, I can clearly see where to change the width of the box, colors, etc, but where do I change the font and size of the text within the box?
Juggernaut
30 Jul 2011, 02:31
I have modified a little bit Joe's proposal to work with vb4
Change post_thanks_box template to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
In posbit_legacy template find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and add before:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
In Admin CP -> Plugin Manager, edit the plugin: Post Thank You Hack on hook: postbit_display_complete
Find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and replace with:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
You can also modify window's content:
In post_thanks_postbit template replace:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
with:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
BR
This tutorial is exellent, but I've found that I can't change the background color or size of the post thanks box, no matter where I change the code. Has anybody else been able to make changes to the post thanks display?
michal72
30 Jul 2011, 06:34
This tutorial is exellent, but I've found that I can't change the background color or size of the post thanks box, no matter where I change the code. Has anybody else been able to make changes to the post thanks display?
To be able to do it, first you have to modify post_thanks_postbit template.
Please try change it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
regards
PS. An appendix to post: http://www.vbulletin.org/forum/showpost.php?p=2222087&postcount=35
Juggernaut
30 Jul 2011, 08:00
To be able to do it, first you have to modify post_thanks_postbit template.
Please try change it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
regards
PS. An appendix to post: http://www.vbulletin.org/forum/showpost.php?p=2222087&postcount=35
Thank you Michal, but the plugin edit you provided seems to have stopped working with vbulletin 4.1.5, I can't get the edit to funcion.
Edit: it still works great, I had overlooked one of the template edits.
Hello,
First, thanks for the instructions to change this mod! I think it's great.
However, I am having a small problem in regards to the postbit_display_start change which brings the like into the post.
When I make this change, it "pushes" the rest of the bottom of the post (the buttons, quote, reply, etc) OFF of the post itself. So the green like line is at the bottom of the post, but for some reason it is screwing up the buttons that are supposed to be below it by pushing them completely outside of the post.
For reference - vb 3.8, postbit legacy being used.
BirdOPrey5
01 Aug 2011, 14:27
Hello,
First, thanks for the instructions to change this mod! I think it's great.
However, I am having a small problem in regards to the postbit_display_start change which brings the like into the post.
When I make this change, it "pushes" the rest of the bottom of the post (the buttons, quote, reply, etc) OFF of the post itself. So the green like line is at the bottom of the post, but for some reason it is screwing up the buttons that are supposed to be below it by pushing them completely outside of the post.
For reference - vb 3.8, postbit legacy being used.
Either the postbit_legacy edits were made wrong or perhaps you have a custom style? Custom styles may require different edits- these instructions are only for the default vbulletin style- you may need to make adjustments for custom styles.
Either the postbit_legacy edits were made wrong or perhaps you have a custom style? Custom styles may require different edits- these instructions are only for the default vbulletin style- you may need to make adjustments for custom styles.
Thanks for the quick response! I went through things about 5 times trying to figure it out, and then decided to once again look at legacy after your post and the error was right smack there in front. Unbelievable. Thanks again for the quick response.
How about that dislike on ur forums, will you share that with us? :D
BirdOPrey5
05 Aug 2011, 13:15
How about that dislike on ur forums, will you share that with us? :D
The "dislike" was the "Post Groan Hack" with the "Groan" changed to "dislike" pretty much exactly the same thing as changing "thanks" to "like."
Dear michal72 ,
How can i remove the small space at the bottom of the likebox ?
Like this image :
http://www.vbulletin.org/forum/attachment.php?attachmentid=130766&stc=1&d=1309952895
This image haven't any bottom margin .
Edit : I solve the problem . i just change .postrow in postbit.css and remove paddings ;)
viper357
24 Aug 2011, 19:45
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and change it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
OK This will move the "Like" box into the actual post table instead of below it.
Hi Joe, small problem, everything works 100% but as soon as I do the above edit, I get a blank page on any link except for my vbadvanced home page. If I undo the edit it makes no difference until I re-upload the xml file (which I assume then replaces the small plugin), then the forum works again. Any idea's? I'm desperate to have this display within the posts. ;)
BirdOPrey5
24 Aug 2011, 21:12
This code by definition is only run when viewing threads/posts... If something was causing all your pages to be blank (including forumhome, forumdisplay, etc...) then it wasn't this code. You might have other issues.
What version of vBulletin are you using?
viper357
25 Aug 2011, 06:07
My apologies, I should have said when trying to view any thread then I get a blank page. I'm on 3.8.5
--------------- Added 1314263167 at 1314263167 ---------------
Is there a way to manually edit the postbit legacy template and add the code for the thanks box, instead of using a plugin?
BirdOPrey5
25 Aug 2011, 17:21
Probably but it's not something I've spent time attempting.
Which postbit style do you use? Have you checked for the existence of the template hook in that template?
Can you try it on the default style and see if you have the same problem?
viper357
26 Aug 2011, 06:58
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
26 Aug 2011, 09:49
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Step 3- Edit the postbit_display_start plugin. Change the 1st Conditional to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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
28 Aug 2011, 06:05
Thanks Joe, much appreciated. :)
EddyMaxx
05 Sep 2011, 22:08
Great tutorial. I was able to follow it all the way through for both the LIKE and DISLIKE buttons.
Nice job Joe!
"Sorry, you are not allowed to 'Like' this post."
Wasn't the standard, "you've liked this guy's posts too much" message :)
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)
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)
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 1315278204 at 1315278204 ---------------
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Step 3- Edit the postbit_display_start plugin. Change the 1st Conditional to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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
06 Sep 2011, 03:48
Post #35 (http://www.vbulletin.org/forum/showpost.php?p=2222087&postcount=35) and Post #36 (http://www.vbulletin.org/forum/showpost.php?p=2222087&postcount=36) help you with the 4.x install instructions and alternate placement. :up:
Post #35 (http://www.vbulletin.org/forum/showpost.php?p=2222087&postcount=35) and Post #36 (http://www.vbulletin.org/forum/showpost.php?p=2222087&postcount=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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Upon taking another look, I changed it to the following which fixed the AJAX issue:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
So thanks for making take a second look! :)
BirdOPrey5
06 Sep 2011, 11:04
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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
21 Sep 2011, 16:18
Hope you will release this article for vB4 soon :)
HMBeaty
21 Sep 2011, 16:19
Hope you will release this article for vB4 soon :)
Read the previous posts to use this with vB 4
So I installed this, the Thanks template edits work great, however for Post Groan, the groan templates are still default (dont show in bar)
I have them integrated/connected with Post Thanks in settings
Running VB 3.8 any ideas? Do I have to do any other template edits? I saw the <IF> condition I assumed this was already built in.
BirdOPrey5
22 Sep 2011, 10:53
Yo have to do basically the same edits you did for Thanks on the Groan's hack now.
christon26
25 Sep 2011, 12:23
Awesome! Thanx :)
GavoTrav
16 Oct 2011, 20:07
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
You missed a Div tag on one of the boxes I Highlighted it!
BirdOPrey5
16 Oct 2011, 23:16
Thanks. I edited it into the first post. :up:
JimxJNM
12 Nov 2011, 04:00
Nice man, will this able to work on vBulletin 4.1.4?
BirdOPrey5
12 Nov 2011, 09:51
Nice man, will this able to work on vBulletin 4.1.4?
In an earlier post someone gave new instructions for 4.x.
JimxJNM
14 Nov 2011, 11:06
i'm using DBTech thanks v2 and i don't think it will work for me =/
BirdOPrey5
16 Dec 2011, 14:13
This is instructions for Abe1's mod. It won't work with any other thanks mod.
JimxJNM
01 Jan 2012, 06:55
Hello BirdOPrey
I don't have this code on postbit_legacy
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
I'm on 3.8.7 I got everything fixed.. but i don't have the code.. is it on postbit template?
EDIT: Also look what happens to my show thread..
IMAGE: http://puu.sh/c66Y
:(
Thanks
BirdOPrey5
01 Jan 2012, 21:18
You have a custom style so your code will be different, you will have to figure out where things need to be. The code I provided was for the default style.
clutchthese
27 Jan 2012, 18:58
Nevamind. :)
Crimdog
10 Apr 2012, 21:04
nvm fixed :)
wishtheend
18 Apr 2012, 23:06
Anyone have any luck with 4.1.12? The 4.x instructions don't seem to work anymore. The edits in this just seem to mess it up. Tried uninstalling and reinstalling but something is a little screwy.
BirdOPrey5
19 Apr 2012, 10:55
Anyone have any luck with 4.1.12? The 4.x instructions don't seem to work anymore. The edits in this just seem to mess it up. Tried uninstalling and reinstalling but something is a little screwy.
Do you mean the edits in post #35 weren't working for you or the original edits in the first post? (The first post is of course for VB 3.x and not intended to work on 4.x.)
wishtheend
19 Apr 2012, 21:32
Do you mean the edits in post #35 weren't working for you or the original edits in the first post? (The first post is of course for VB 3.x and not intended to work on 4.x.)Yes, installed 7.7 and went to follow the 4.x steps in post 35/36. I'm getting an error that runs across the top, or takes me to sql error page
Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: post_thanks_navbar_search in [path]/includes/functions.php on line 4337
I uninstalled it, and then reinstalled but no luck. And when I go to edit the posbit display complete hook, the text the instructions tell to replace is not even listed.
BirdOPrey5
19 Apr 2012, 22:49
You installed or are using the VB 3.x plugin on VB 4.x. You need the VB4 version of the mod, not the VB3 version.
wishtheend
19 Apr 2012, 23:19
Thanks. I just installed 7.8.3 and the steps in #35 seem broken still. I'm not sure why there would a discrepancy, but the first 3 steps seem broken. I follow them exact and it looks like this
Screenshot 1 (http://providermodule.com/Administrators/Cringeon/brokenlike.jpg)
It looks fine with the edits not performed, just looks like the normal white box underneath the post, but any edit doesn't seem to work. Anyone else tried it 4.1.12?
ForceHSS
20 Apr 2012, 00:45
Thanks. I just installed 7.8.3 and the steps in #35 seem broken still. I'm not sure why there would a discrepancy, but the first 3 steps seem broken. I follow them exact and it looks like this
Screenshot 1 (http://providermodule.com/Administrators/Cringeon/brokenlike.jpg)
It looks fine with the edits not performed, just looks like the normal white box underneath the post, but any edit doesn't seem to work. Anyone else tried it 4.1.12?
this is why it does not work for you
(The first post is of course for VB 3.x and not intended to work on 4.x.)
wishtheend
20 Apr 2012, 03:24
this is why it does not work for you
The only modifications I've made are the ones in post #35 which at least to my understanding the 4.x edits. I'm not making modifications from the first post of this thread.
--------------- Added 1334967415 at 1334967415 ---------------
Could someone post what it should look like after each edit? At least then I can maybe pinpoint where it's broken. For me, and on the default VB skin, the first edit on post #35 causes the regular thanks box to become some div that gets pushed behind the forum.
michal72
21 Apr 2012, 09:55
For me #35 is working fine on 4.1.12 .
See how it should more less look like.
137949
Please check if post #49 will help you: http://www.vbulletin.org/forum/showpost.php?p=2226708&postcount=49
wishtheend
21 Apr 2012, 17:30
For me #35 is working fine on 4.1.12 .
See how it should more less look like.
137949
Please check if post #49 will help you: http://www.vbulletin.org/forum/showpost.php?p=2226708&postcount=49
Thanks, probably still seems to lie with the first edit in #35. The thank box code is says to place in there seems to mess up the formatting. I've tried it from a fresh install of 4.1.12 so not sure where the problem is. But making the first two edits causes the formatting to become all jumbled and bleeding into other parts of a post like the message body.
Merriweather
21 Apr 2012, 21:18
Thanks to everyone who took the time to post their knowledge in this thread. I just got my vB 4.1.12 working with the hacked "Likes" system pretty easily. :)
However, I use this Lightweight style for mobile device users: http://www.vbulletin.org/forum/showthread.php?t=249277
So far, I've added the "Like" button in between the "Edit" and "Reply" on my mobile style, like this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Basically, all I need are the conditionals to wrap around it so it won't show to users who don't have access to the post. I've been trying (without success) to create my own conditionals.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Please Explain this step on screen shot for me please
BirdOPrey5
23 Apr 2012, 22:07
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Please Explain this step on screen shot for me please
In your Admin CP choose "Phrase Manager" from the side menu, it is under the "Languages & Phrases" group.
If you're noy sure where each phrase is use "Search in Phrases" instead. Put the phrase name in the "Search for Text" box, example: post_thanks_already
Choose the option: Phrase Variable Name Only
click find.
Click to edit the found phrase and on that page there is a box for an English translation (or whatever language you use) - Simply put in that box what you want it to say... So change "Thanks" to "Like"
Save.
Repeat for all phrases listed.
Crimdog
23 Apr 2012, 22:38
Loving this modification to the post thanks hack!
Working great.
I do have a question for you, if you don't mind pointing me in the right direction?
We use a star to like posts up next to the permalink. I'd like to have this button used as a "multi" button. In that when not liked, it's grayed (not yellow). Once you click "like" it changes to yellow. The text "remove like" would also be removed from the thanks box.
I've been digging around for a while with this conditional and haven't had any luck. Could you point me in the right direction so I could do the research? Much appreciated!
BirdOPrey5
23 Apr 2012, 23:24
Sorry swapping out images would likely involve editing the Ajax JavaScript and that is not something I am familiar with.
Crimdog
25 Apr 2012, 23:14
Sorry swapping out images would likely involve editing the Ajax JavaScript and that is not something I am familiar with.
Thank you for the response.
I intend to go about this a different way :)
If possible, please review this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
In testing this out, I've managed to get the images to display correctly to an extent. When you click the image, the image disappears, but the other image doesn't display until you refresh the page. When you refresh the page it looks fine again. Now, if you click "unlike this post", ajax refreshes immediately and you now have two images in the bar next to permalink (like and liked.png respectively) until you refresh the page.
I assume this is what you meant by the ajax function?
--------------- Added 1335397299 at 1335397299 ---------------
And apologies in advance, no matter what I do, copy/paste doesn't fully translate.
BirdOPrey5
26 Apr 2012, 12:52
The only work-around I could think of would be to disable AJAX in the mod completely which I don't think you'd want to do.
Crimdog
26 Apr 2012, 12:58
The only work-around I could think of would be to disable AJAX in the mod completely which I don't think you'd want to do.
Yeah, that would in turn prevent the images from auto-display, which kinda defeats the purpose. :) Thanks anyway. I've got a co-worker that will assist since she writes AJAX in her sleep.
If we come up with a solution I'll be happy to let you know. Maybe someone else out there would be interested.
blueperspective
28 Apr 2012, 21:39
Is there anyone who installed/tested this thing on VB 4.1.12 ? Does it work ?
Ummm... nope, doesn't.
Maybe vB should integrate in its own code a thanks/likes option.
Merriweather
30 Apr 2012, 00:50
Is there anyone who installed/tested this thing on VB 4.1.12 ? Does it work ?
Ummm... nope, doesn't.
Maybe vB should integrate in its own code a thanks/likes option.
It does work if you install the right version of the mod and follow the additional info added within this thread. :)
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.