Reputation - Deleted Post/Thread

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arsenik
    Senior Member
    • Nov 2001
    • 283

    Reputation - Deleted Post/Thread

    Is it normal that after a post (that was given reputation) or a thread (that contains post that were given reputation) are deleted that the reputation count isnt automaticaly adjusted? Is the only way for the rep to be accurate to rebuild the reputation counter?
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    In my testing, rep clicks for a post are only deducted from a user's total when the post is physically deleted and the admin rebuilds the rep counters.

    Comment

    • Arsenik
      Senior Member
      • Nov 2001
      • 283

      #3
      Originally posted by Jake Bunce
      In my testing, rep clicks for a post are only deducted from a user's total when the post is physically deleted and the admin rebuilds the rep counters.
      Thank you for the reply.

      This is what i did in order to at least have the reputation counter rebuild be accurate. (So that it doesnt count reputations tied to soft deleted threads/posts)

      !!!I am not an expert!!! Query probably not optimal...

      !!!USE AT YOUR OWN RISK!!!

      Open admincp/misc.php

      Find this code (line 526)

      Code:
      // ################## Start rebuilding user reputation ######################
      if ($_POST['do'] == 'rebuildreputation')
      {
          $vbulletin->input->clean_array_gpc('p', array(
              'reputation_base' => TYPE_INT,
          ));
          
          $users = $db->query_read("
              SELECT reputation.userid, SUM(reputation.reputation) AS totalrep
              FROM " . TABLE_PREFIX . "reputation AS reputation
              GROUP BY reputation.userid
          ");
      Replace the query with this one

      Code:
          $users = $db->query_read("
              SELECT post.userid, SUM(reputation.reputation) AS totalrep
              FROM " . TABLE_PREFIX . "post AS post
              LEFT JOIN ". TABLE_PREFIX . "reputation AS reputation ON(post.postid = reputation.postid)
              LEFT JOIN ". TABLE_PREFIX . "deletionlog AS deletionlog1 ON(post.threadid = deletionlog1.primaryid AND deletionlog1.type = 'thread')
              LEFT JOIN ". TABLE_PREFIX . "deletionlog AS deletionlog2 ON(post.postid = deletionlog2.primaryid AND deletionlog2.type = 'post')
              WHERE deletionlog1.primaryid IS NULL
              AND deletionlog2.primaryid IS NULL
              GROUP BY reputation.userid
           ");

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...