Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-11520

Post count not incremented when you fork a topic

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.0-RC3
    • 3.0.11
    • Posting
    • None
    • PHP 5.4.3, MySQL 5.1.3, Firefox 20

      When you fork a topic, the post's count of each users is not incremented depending number of post of each users.

      User user01
      -Create a new topic with user01. (user01 got +1 post on his counter)
      -Fork this topic using moderation tool (user01 will not got +1 post on his counter)
      -Delete the copied topic (user01 got -1 post on his counter)

      User has now 0 post on his counter even with the first topic manually writed.

      Solution:
      Open includes/mcp/mcp_main.php
      Search(line 1181):
      'post_postcount' => 0,

      Replace with:
      'post_postcount' => (int) $row['post_postcount'],

      Search(line 1184):
      $db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));

      Add After:
      $sql = 'UPDATE ' . USERS_TABLE . '
      SET user_posts = user_posts + 1
      WHERE user_id = ' . (int) $row['poster_id'];
      $db->sql_query($sql);

            Marc Marc
            Geolim4 Geolim4 [X] (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: