WordPress.org

Forums

bbPress Like Button
[resolved] Likes of topic is the same as replies (19 posts)

  1. Topher Jamero
    Member
    Posted 1 year ago #

    When I liked a topic, replies on that topic are liked to. I only liked the topic.

    https://wordpress.org/plugins/bbpress-like-button/

  2. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Topher,

    Which versions are you using of?

    • WordPress
    • bbPress
    • bbPress Like Button plugin

    Thank you,
    Jordi

  3. Topher Jamero
    Member
    Posted 1 year ago #

    Hi Jordi

    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.

    Regards

  4. ciaran_oh
    Member
    Posted 1 year ago #

    Hi there I'm getting the exact same issue. This plug in seems perfect apart from this.

    WordPress 3.9.1
    bbPress Like Button 1.4
    bbpress v2.5.4

    Also running Buddypress 2.0.1

    Be great if we could get a solution for this.

    Cheers

    Ciaran

  5. ciaran_oh
    Member
    Posted 1 year ago #

    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

    Ciaran

  6. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    Hi guys,

    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.

    Jordi

  7. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    By the way, are you using any specific theme for bbPress?

  8. Topher Jamero
    Member
    Posted 1 year ago #

    Hi, currently using twentytwelve theme.

  9. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    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?

    On wp-content/plugins/bbpress-like-button/class.bbpress_like.php

    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?

    Thanks,
    Jordi

  10. Topher Jamero
    Member
    Posted 1 year ago #

    Hi Jordi,

    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

    12

    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

    12

    and also the main topic which is already has 2 likes
    displays

    22

    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.

    Regards,
    Chris

  11. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris,

    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?

    Thank you,
    Jordi

  12. Topher Jamero
    Member
    Posted 1 year ago #

    Hi Jordi,

    Thanks for the prompt reply, I'm currently using the latest version of Firefox.

    Regards

  13. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris,

    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.

    Thank you,
    Jordi

  14. Topher Jamero
    Member
    Posted 1 year ago #

    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.

    Regards
    Chris

    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!

  15. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris,

    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.

    Thanks,
    Jordi

  16. Topher Jamero
    Member
    Posted 1 year ago #

    I see, please take your time.

    With regards to my request, I'll be waiting =).

    Thanks!

  17. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris,

    I just checked the fix and on my testing environment is working fine. Are you sure you don't have any problem with another javascript that may break the subsequent execution?

    You can easily check that with Firebug (Firefox) or Chrome Developer Tools (Chrome), on the console tab. If there are any javascript errors you should see it logged on the console.

    Alternatively you can provide me a link to your site privately to info@jordiplana.com and a sample user with Forum Participant role, and I can test it my self.

    I'll wait for your feedback.

    Thank you,
    Jordi

  18. Topher Jamero
    Member
    Posted 1 year ago #

    Hi Jordi,

    Yes it is working now, I might have mis-copied the lines since a red underline was showing on Komodo edit.

    Thank you very much Jordi!

    Regards

  19. JordiPlana
    Member
    Plugin Author

    Posted 1 year ago #

    Great news, I will publish the fix officially in the next release of the plugin, that is expected to be delivered at some point during the next week.

    Thank you very much for all your feedback and your patience.

    Please feel free to rate the plugin :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • bbPress Like Button
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags