[Resolved] Likes of topic is the same as replies
When I liked a topic, replies on that topic are liked to. I only liked the topic.
Which versions are you using of?
- bbPress Like Button plugin
Here are the versions
- WordPress 3.9.1
- bbPress v2.5.4
- bbPress Like Button 1.4 plugin
I just tested it again, but still when I like the topic, replies within that topic gets liked too.
Hi there I’m getting the exact same issue. This plug in seems perfect apart from this.
bbPress Like Button 1.4
Also running Buddypress 2.0.1
Be great if we could get a solution for this.
Looking through the code a bit it seems that when its looping out the individual like buttons for each reply the data-post attribute is just staying the same as the first forum post.
So in this example the id of the post is”9684″ but the data attribute is echoed as “9679”
<a href="#" data-user="193" data-post="9679" title="You liked this" class="bbpl_button liked">…</a>
Hope that helps
Many thanks for the replies, I’m going to have a deep look to this issue.
As soon as I get the fix I will publish it and post in this thread.
Sorry for any inconvenience and thanks for your patience.
By the way, are you using any specific theme for bbPress?
Hi Topher and Ciaran,
I can’t reproduce your problem, but I suspect what can be the issue.
Can you please try to temporary modify a file on the plugin, and let me know if it fixes the problem?
Line 324, on public function bbpl_show_button change this line
$post_id = $post->ID;
for this one
$post_id = bbp_get_reply_id();
After the edition, flush any caching plugins and refresh the page.
Did that solve your problem?
Working now thank you very much, but there might be a little work needed still. So, I liked a topic which has already 1 like, the thumbs up icon changes to a loader but then displays
Refreshed the page and shows 2 likes which is correct. Then I also liked the reply below the topic which has 1 like but then it displays
and also the main topic which is already has 2 likes
Refreshed the page, and the likes are back to normal. It does the same when another user likes a topic with 2 likes, instead of showing 3 already it shows 23.
Hoping for your help with regards to this too Jordi.
Thanks for the feedback I will include the fix on an upcoming release of the plugin.
Regarding this counter number, which browser are you using?
Thanks for the prompt reply, I’m currently using the latest version of Firefox.
Once again I cannot reproduce the error, so if you can modify a plugin file for me and let me know if it fixes your problem I would be really thankful.
Modify wp-content/plugins/bbpress-like-button/js/public_functions.js line 21 and 23.
Replace line 21
var likes_number = $('.bbpl_number');
With that line
var likes_number = button.parent('.bbpl_button_wrapper').children('.bbpl_number');
Replace line 23
likes_number.text(parseInt(likes_number.text(),10) + 1);
With that line
likes_number.text(+parseInt(likes_number.text(),10) + +1);
Once again, after you do the changes please be sure you flush any caching WordPress plugins and the browser cache.
Let me know if that solves you issue.
Hi again, thanks for the response. I replaced the code on the js file but when I click the like icon what it does is it directs me on top of the page, so basically the like button doesn’t function. I tried also on Chrome but still the same.
PS: Also is there a way to make the like count and icon visible but not click-able when a user is not logged in? Thanks!
Thanks for the feedback. I will try to find a proper fix for the counter later on today, unfortunately I don’t have access to my testing environment at the moment.
About the possibility of showing the button to not-logged user, is not yet supported by the plugin, but I will consider adding this feature in future releases.
- The topic ‘[Resolved] Likes of topic is the same as replies’ is closed to new replies.