Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Removing Karma after deleting post with accepted answer

This discussion is related to the Karma Bank addon.

Hello, title say everything.
Is there anyway to after deleting thread (with answers) to automatically remove karma from profile of user that give correct answer?



  • Bump! I really need help about this. I need somehow to fix this and to set my forum to go live.

  • x00x00 MVP
    edited February 2013

    Sorry can't offer detailed tuition. If you are not a programmer then I would make do, I'm not taking sponsorship right now. Sorry.

    you need to use the DiscussionModel_DeleteDiscussion_Handler hook you can do you own operations in that.

    then some logic to pick out the Answered users IDs. And also they could have been accepted more than once.

    Hooking into KarmaRules could be non trivial right now. You would need to make use of the newer DiffEquals operation (and I can't vouch for it working properly yet), but theoretically should take off the same amount if it goes down by the target.

    you would have to do a query to the user table decrementing QnACountAcceptance field for each user by the number of answers of that user.

    if you wanted just force debit without rules you can do it like

    $KarmaBank = new KarmaBank($UserID);

    Again you are going to have to sort out how it going to actually work.

    The point being is removing Acceptance on deletion is just one person's interpretation of how it should work, though your is not trivial and not expected. Karma bank hooks into the meta, the case of QnA there was not meta as such so I have to log it according to an interpretation.

    Believe me everyone is the most urgent, and important. I hear this every day, the fact is you have to be more realistic, when you get this for nothing.

    grep is your friend.

  • x00x00 MVP
    edited February 2013


    Don't use the plugin if you don't like it. If you don't understand the operations is not my fault, the count is linked to the user not a particular discussions.

    I explicitly said the point to this plugin is to check meta and track it. So really it is not its job to set meta originally as that is done but other functions, so if you want the meta to go down then do it yourself.

    grep is your friend.

  • Good plugin but this is important. I tried with every and DiffEquals but it's same, delete one got in postive like I post new comment. Really don't understand.

    Thanks anyway.

  • it won't do anything beacuse the count is not goign down.

    DiscussionModel_DeleteDiscussion_Handler is the hook you could use to make those user counts go down.

    I'm super busy right now sorry.

    grep is your friend.

  • Part of the problem with your idea is if you said say if 5 questions are accepted the reward is x. Well if one is deleted this is just one. So you have reward, one is deleted not five. how do you resolve this? it would have to delete 5 before you loose. On the other hand they have lost 1 so they will need to make 6 to get their next reward.

    At the moment is in mostly focused on positive counts for this reason. Fluctuating counts are trickier.

    grep is your friend.

  • businessdadbusinessdad Stealth contributor MVP
    edited February 2013

    @milosdallas said:
    Thanks for answering. Now i think this is very stupid from plugin.

    That was an inappropriate remark. Defining "stupid" the result of someone else's work, which was provided (together with support) free of charge is rude at best. I can understand that the plugin doesn't suit you, as you have different requirements, but, as the author pointed out, you don't have to use it. Just keep in mind that plugin's behaviour is not due to a bug, it's by design.

    Good plugin but this is important. I tried with every and DiffEquals but it's same, delete one got in postive like I post new comment.

    Since fluctuating counts are an important requirement for you, I would recommend the following:

    • Write down some detailed specifications, covering as many use cases as possible. @x00 made a good example of a tricky situation, what would you expect to happen in such condition?
    • When the specifications are ready, publish a job posting on the Community, together with a budget and a preferred deadline. There are many valid Developers on this forum, I'm quite sure you can find someone who can extend the plugin for you in a timely manner.

    Considering how close you are to the delivery, I deem this to be the best course of action for you.

    I didn't write the above as a sneaky way to offer my services. I'm quite busy myself, and I wouldn't be able to take on this project.

  • @businessdad I like Vanilla and plugins for it but some of them are little buggy, as QnA. I see that this plugin, Karma bank have some deficiencies or whatever it is, but QnA and Karma Bank will be basic plugins for my forum so they need to work without any bugs or like this problem for karma.

    I don't have much time to find someone to customize Karma Bank plugin, and I decided to continue with CMS what i currently have istalled (cms have similar and little better than this plugins). I really like Vanilla but my forum can't work with this plugins.

    Thanks @businessdad, @x00 for writing.

  • bye...

    grep is your friend.

  • fr3em1ndfr3em1nd ✭✭
    edited February 2013

    @x00 said:

    bye from this thread only right ?

  • it isn't me that is leaving.

    grep is your friend.

Sign In or Register to comment.