Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Allow -1 only if previously liked?

This discussion is related to the Kudos Plugin addon.

Is there any way to make it so someone can unlike a post they previously liked (if they change their mind) but otherwise can not "downvote" posts? I don't want any post to ever have a negative number, in other words.

Comments

  • hgtonighthgtonight ∞ · New Moderator

    The following is untested, but should work.

    In default.php line 260 is a function called CanRemove($Options) replace that function with the following:

      public function CanRemove($Options)
      {
        $Kudos = $this->KudosModel->GetKudosFromOptions($Options);
        foreach($Kudos as $K)
        {
            if($K->UserID == $Options['UserID'] && $K->Action == 1) return true;
        }
        return false;
      }
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    UnderDog
  • Hm, that seems to prevent me from liking something to begin with.

  • hgtonighthgtonight ∞ · New Moderator
    edited April 2013

    While modifying this to suit your needs, I thought that you might be interested in the Thankful People plugin instead.

    Either way, I attached a version of Kudos that works as you would like it to. Oh, and I tested it this time. :D

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    peregrineCeleste
  • That's absolutely perfect, thank you so much! I checked out Thankful People, but for some reason nothing's showing up on my forum when I enable it — but your fix for Kudos looks like it will be exactly what I need. Thanks again!

  • peregrineperegrine MVP
    edited April 2013

    This plugin works also (on my server and many others) - Thankful People

    how are you installing things. did you set permissions correctly?

    If you have a link to your site - we could probably decipher all these mysterious happenings :).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Download the plugin, upload it to the plugins directory, enable it in the Dashboard. Do I need to manually set permissions for plugins? I haven't had to do that for any others.

    The site is still in testing phase, but here it is: http://fandomania.jtddev.com/forum/ I don't really need Thankful People now, though — Kudos is working exactly how I need it.

  • peregrineperegrine MVP
    edited April 2013

    Actually for thankful people - there is no permission setting in the roles and permissions. Just the normal permissions of the folder structure when you install it.

    Theoreticallym You should see a thank option on other people's posts but not on your own. But it may be your theme and vanilla version that could affect visibility of some plugins. I usually test on default theme, just to make sure, an always look in roles and permissions to see if there is a setting I missed (but thats just me :).

    But.... many plugins will not appear to work sometimes because the permissions are not set in the dashboard under the role.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Oh, that's why, then. ::smacks forehead:: I was the only one who had made posts so far =) Yup, it works. I'm gonna stick with Kudos but good to know I have the option! Thanks for the tip to test with the default theme, too.

    peregrine
  • peregrineperegrine MVP
    edited April 2013

    @Celeste

    I'll have to check out your site more thoroughly. I'm a fan of many books and movies, etc.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • CelesteCeleste New
    edited April 2013

    Our current site with more recent articles, etc. is fandomania.com but hopefully we'll be moved over to the redesign within a couple weeks =)

  • hgtonighthgtonight ∞ · New Moderator

    @Celeste I like the theme you have. :D

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    Celeste
Sign In or Register to comment.