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.

How can I reset Karma?

I uninstalled and deleted cache but it still shows. I need it to be =zero for everyone.

Vanilla: 2.0.18.8
Theme: Dark Mist

Best Answer

«1

Answers

  • @x00 thanks for your answer. I deleted all GDN_Karma (including Rules) and it all resets to zero until users log in. After that it shows up random karma for each one. Can it have something to do with the "Consolidate" plugin?

  • Something is not right, you are definitely deleting all the karma tables?

    Are you saying it changes when people login, and if you log out it reverts or it persists? Consolidate won't have any impact, you can easily isolate by disabling it.

    I mean meta QnACountAccept and QnACountAcceptance are recorded, so naturally it is going to reward based on rules based on those columns in the user table. Are you setting up the rules before they are loggin in? it may be workign to the expected behaviour. If you have CommentCount, etc user are goign be rewarded when the rule is met.

    What does it say in the karma balance? In each user profile it records transactions.

    grep is your friend.

  • xValxVal New
    edited December 2013

    @x00 this is what I get:

    #1090 - You can't delete all columns with ALTER TABLE; use DROP TABLE instead

    So I go to Operations > Delete the table (DROP) and it lets me delete all tables. But still no results. Karma is being added whenever members log-in, like this for instance:

    If I set 3 rules: Every 1 comment 1 karma, every 1 discussion 1 karma, every 1 view 1 karma, most members get 3 karma automatically (1c+1v+1d), but some members get more or less (or even zero) when they first log-in.

    I have no idea what I'm doing wrong here.

  • xValxVal New
    edited December 2013

    @x00 said:
    Are you setting up the rules before they are loggin in? it may be workign to the expected behaviour. If you have CommentCount, etc user are goign be rewarded when the rule is met.

    I have to set at least 1 rule to enable the plugin, so lets say I do every 1 discussion 1 karma.. what happens is when a member logs in (without posting anything) he still gets something like 1 karma, or 3, or 5 etc

  • xValxVal New
    edited December 2013

    Darn, I think I f*cked up. This is what I get when I enable the Karma plugin now:

    Fatal Error in Gdn_Autoloader.RegisterMap();
    Only variables should be passed by reference
    The error occurred on or near: 
    
    /home/thecashg/public_html/library/core/class.au
    
    toloader.php
    382:       $Options['MapIdentifier'] = 
    
    $MapIdentifier;
    383:       $MapHash = md5($MapIdentifier);
    384:       
    385:       // Allow intrinsic ordering / 
    
    layering of contexts by prefixing them with a 
    
    context number
    386:       $MapHash = 'context:'.GetValue
    
    ($ContextType, array_flip(self::
    
    $ContextOrder)).'_'.$Extension.'_'.$MapHash;
    387:       
    388:       if (!is_array(self::$Maps))
    389:          self::$Maps = array();
    390:          
    Backtrace:
    [/home/thecashg/public_html/library/core/class.a
    
    utoloader.php:386] PHP::Gdn_ErrorHandler();
    [/home/thecashg/public_html/library/core/class.a
    
    utoloader.php:142] Gdn_Autoloader::RegisterMap
    
    ();
    [/home/thecashg/public_html/library/core/class.a
    
    utoloader.php:95] 
    
    Gdn_Autoloader::AttachApplication();
    [/home/thecashg/public_html/bootstrap.php:73] 
    
    Gdn_Autoloader::Attach();
    [/home/thecashg/public_html/index.php:41] 
    
    PHP::require_once();
    Variables in local scope:
    [MapType] 'controller'
    [ContextType] 'application'
    [SearchPath] 
    
    '/home/thecashg/public_html/applications/dashboa
    
    rd/controllers'
    [Options] array (
      'SearchSubfolders' => false,
      'Extension' => 'dashboard',
      'ContextPrefix' => 'a',
      'ClassFilter' => '*',
      'SaveToDisk' => true,
      'MapIdentifier' => 'controller|application|
    
    dashboard|/home/thecashg/public_html/cache',
    )
    [DefaultOptions] array (
      'SearchSubfolders' => true,
      'Extension' => NULL,
      'ContextPrefix' => 'a',
      'ClassFilter' => '*',
      'SaveToDisk' => true,
    )
    [Extension] 'dashboard'
    [Hits] 1
    [MapRootLocation] 
    
    '/home/thecashg/public_html/cache'
    [MapIdentifier] 'controller|application|
    
    dashboard|/home/thecashg/public_html/cache'
    [MapHash] '8db93ead97707358124d560a56c94e1c'
    
  • This is the highlighted line:

    386: $MapHash = 'context:'.GetValue($ContextType, array_flip(self::$ContextOrder)).''.$Extension.''.$MapHash;

  • I would delete cache/*.ini and see if it solves something

    There was an error rendering this rich post.

  • xValxVal New
    edited December 2013

    @UnderDog said:
    I would delete cache/*.ini and see if it solves something

    Already tried that with no result.

  • peregrineperegrine MVP
    edited December 2013

    a guess.... (in this exact order)

    1. back up your database
    2. disable karma plugin
    3. disable consolidate plugin
    4. then delete the karmacache folder.
    5. then delete the .ini files in cache.
    6. then drop these tables
    7. drop 'KarmaBankBalance'
    8. drop 'KarmaBankTrans'
    9. drop 'KarmaBankTransTally'
    10. drop 'KarmaRules')
    11. drop 'KarmaRulesTally'

    12. remove these two columns from user table
      QnACountAccept
      QnACountAcceptance

    13. goto you config.php

    14. delete every reference to

    $Configuration['Plugins']['KarmaBank']


    then enable karma plugin.

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

  • xValxVal New
    edited December 2013

    @peregrine thanks, it worked in the sense it doesn't bonk when I enable the karma plugin, but we're back to square 1..

    I added 3 rules as follows: every 1 comment, view & discussion award 1.50, 0.50 & 3.00 respectively. Now, when I refresh my profile I have 5.00 karma (it awarded me 1.5+0.5+3.0=5.00) although I didn't do any activity.

    CountDiscussions Every 1.00 December 7, 2013 2:00AM 3.00
    CountComments Every 1.00 December 7, 2013 2:00AM 1.50
    CountVisits Every 1.00 December 7, 2013 2:00AM 0.50
    Starting Balance December 7, 2013 2:00AM 0.00

    Balance5.00

  • xValxVal New
    edited December 2013

    Update: I asked a moderator to log-in and he was awarded 2.00 (1 comment & 1 visit) - no idea why it's behaving like this... Note that consolidate is still disabled.

    All other members that are currently offline (not logged in since I re-enabled the plugin) have 0 balance (surely until they login once).

    An interesting observation is the mod has never opened a discussion (only commented) - maybe that's why he wasn't awarded 3.00 (for 1 discussion) while I was (since I have opened a lot of threads)... dunno what to make of this though.

  • The autoloader error is a deprecation error.

    Nothing to worry about in my opinion. Just disable debug mode. :)

    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.

  • peregrineperegrine MVP
    edited December 2013

    Blank everything out again. just add 1 rule to make life simpler. and see if you can debug from there. if the rule works then remove it blank out database - try another rule,etc .

    try 1 for every discussion - seems like the easiest to debug.

    And I wouldn't choose views (to make life easier).

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

  • Alright, I'm on it!

  • peregrineperegrine MVP
    edited December 2013

    should be all right enabling consolidate - probably had no impact either way.

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

  • xValxVal New
    edited December 2013

    Update: I've gone through all the steps again, added 1 simple rule: for every 1 discussion award 1 karma, and now when I go to my profile it shows a grand total of 1.

    Note that starting balance was preset to 0.

    My mod logged in and his balance is 0.

  • peregrineperegrine MVP
    edited December 2013

    create a new user. don't make a discussion with that user. see what they get.

    I'd suggest you start a new discussion under the karma plugin. with your issues.

    now that you know how to reset (purge tables and entries as if there was no karma plugin).

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

  • xValxVal New
    edited December 2013

    @peregrine said:
    create a new user. don't make a discussion with that user. see what they get.

    Done, it shows 0 for new user with no discussions.

    I asked another member to log-in and it shows 1 in his balance.

    I've enabled consolidate now and karmabank is gone altogether. Deleted cache and noticed all rules are gone, plugin is disabled as a result.

  • I'd suggest you start a new discussion under the karma plugin. with your issues.

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

Sign In or Register to comment.