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

Move related code from functions_posting into remove_post_from_statistic()

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.0-RC3
    • 3.1.0-b4
    • Posting
    • None

      if ($data['post_visibility'] == ITEM_APPROVED)
      {
      	$phpbb_content_visibility->remove_post_from_statistic($data, $sql_data);
      }
      else if ($data['post_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE)
      {
      	$sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_unapproved = forum_posts_unapproved - 1';
      	$sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_unapproved = topic_posts_unapproved - 1';
      }
      else if ($data['post_visibility'] == ITEM_DELETED)
      {
      	$sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_softdeleted = forum_posts_softdeleted - 1';
      	$sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_softdeleted = topic_posts_softdeleted - 1';
      }
      

      The extra logic should be moved into remove_post_from_statistic( ) too as it just removing post from forum and topic table stats.

            dhruv.goel92 Dhruv Goel [X] (Inactive)
            dhruv.goel92 Dhruv Goel [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: