Thread Rating:
  • 35 Vote(s) - 4.34 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011)
Thanks a lot carliv.

this very useful for me.

Thanks. Wink
I'm glad for you! Smile
Some users on my forum accidentally discovered a race condition which allows someone to like a post multiple times - there is a millisecond (or so) long window between checking for an existing like and inserting the like. Under the right conditions (The first few times it happened it was accidental) or with a flood of requests a post can end up with two likes from one user.

The solution was to change the index on (pid, uid) to a unique key as opposed to just a plain ol' index.

I've attached a patch for inc/plugins/thankyoulike.php so it will create the unique key on install.

.txt   0001-Patch-thankyoulike-install-to-create-unique-index.patch.txt (Size: 854 bytes / Downloads: 73)

If you've already got it installed the following queries (changing table names where needed) will replace the index with a unique one:

ALTER TABLE `mybb_g33k_thankyoulike_thankyoulike` DROP INDEX `pid`;
ALTER TABLE `mybb_g33k_thankyoulike_thankyoulike` ADD UNIQUE INDEX `pid` (`pid`, `uid`);

Note that I've not yet worked on adding a graceful way of handling an error on the insert (It just throws an error and the user never gets a message saying the post was already liked).
(2014-02-11, 03:32 PM)Tallon Wrote: Also, the thanks are not appearing below the post to show that it has been thanked

I'm using a custom theme
I had this same issue with the Thanks system not appearing in the 2.0_Inspired theme at all.

In the Admin CP > Configuration > Thanks - I kept the last setting "Separate table" set to On.

Then in Templates & Styles > Templates > 2.0_Inspired (or your custom theme name) > Postbit Templates > postbit_classic - I added the following piece of code at the very end of the file after the closing table tag:


This might not be the best way to accomplish this but it worked for me.
How to use this mod with hide until thanks? Or is there any way? Thank you
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
(2013-10-28, 09:19 AM)Dannymh Wrote: I am having the issue with "loading" when clicking thank you on the mobile theme of my site the javascript seems to be correct. Works fine on the normal version of my site.

This was working fine until I upgraded to 1.6.11 and had to reinstall the script.

Any thoughts on this?



Had to add the postbit part. The script was looking for "</tbody>" but because the mobile theme uses div it was never placed.

Added it manually as divs instead of tr's/td's and it now works

This worked perfectly. Thanks

There is a mod like this maded by me.

Thank You MyBB System + Re + MyAlerts

That mod includes hide tag and use AJAX and have more ots like this.
The only infinite thing is the universe and human stupidity, but the universe is not for sure

Plugins 1.6.x

Plugins 1.8.x

Any easy way to change "like" to something else like "Downloaded"?
This user has been denied support. This user has been denied support.
i have installed this but it now showing in plugin area in mybb admin panel .
^ check (again) the installing instructions available at the plugin page

@HeyyYouu : this plugin's main purpose is to encourage the poster for the post content.
if like / thanks is changed to something else then the main purpose doesn't fulfill

Forum Jump:

Users browsing this thread: 1 Guest(s)