This topic has 9 replies, 3 voices, and was last updated 9 years by sharmstr.

  • Author
  • #47388
     superflymarketing
    Participant

    Hi guys,

    How can we stop people from pressing the like button on a post many times? I’d like it to work so it’s one like per IP address.

    How can this be done?

    Cheers,

    Nick

    #47596
     sharmstr
    Moderator

    That would take a complete rewrite. The code as it works now sets a cookie. To limit to ip address, you’d have to write it to the database.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #47808
     superflymarketing
    Participant

    no problem,

    do I have to tick anything in the theme settings for the cookie to work?

    Cheers,

    Nick

    #47819
     sharmstr
    Moderator

    ? No. Just turn on likes. If its not working, then maybe you have a conflict somewhere.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #47953
     superflymarketing
    Participant

    The bug is on your theme demo. if you click multiple times to like a post the number increases. If you click, wait, and click again it doesn’t allow you.

    Anyway of fixing this?

    #47976
     sharmstr
    Moderator

    Its not really a bug. I doubt that 7th Queen anticipated people going crazy and clicking it multiple times quickly before the code had a chance to finish execution. I’ll assign this to abe to see if they can change the order of the code so that it disables further clicks soon in the code. Thanks.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #47978
     superflymarketing
    Participant

    Yeah that’d be awesome!

    If you could let us know what you amend we can implement it.

    Cheers,

    Nick

    #47987
     sharmstr
    Moderator

    I doubt this will be the final code, but you can try this.

    Go into theme options > misc and turn on dev mode. Then open up /kleo/assets/js/app.js. Around line 1081 you’ll see the likes function. After if(link.hasClass(‘liked’)) return false; add

    COPY CODE
    
    link.addClass('liked');
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #49689
     Abe
    Keymaster

    Hi, that is a good solution until the next update where we have added a fix for that.

    Thanks @sharmstr

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #49792
     sharmstr
    Moderator

    Thanks abe!

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘How to reduce likes to one per IP’ is closed to new replies.

Log in with your credentials

Forgot your details?