diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2012-10-23 15:30:52 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2012-10-23 16:59:33 +0200 |
| commit | 43e6b3a921d45150cd5c2a931e3e14758081f321 (patch) | |
| tree | e4c18a4bcb71ad024e0b072b1dcc8ba0e0aa15ea /phpBB/includes/mcp | |
| parent | fec72c4b782cda044b9a05122530f3a32213b407 (diff) | |
| download | forums-43e6b3a921d45150cd5c2a931e3e14758081f321.tar forums-43e6b3a921d45150cd5c2a931e3e14758081f321.tar.gz forums-43e6b3a921d45150cd5c2a931e3e14758081f321.tar.bz2 forums-43e6b3a921d45150cd5c2a931e3e14758081f321.tar.xz forums-43e6b3a921d45150cd5c2a931e3e14758081f321.zip | |
[feature/soft-delete] Fix some more topic/post count handling
Only disapproving in queue is missing.
PHPBB3-9567
Diffstat (limited to 'phpBB/includes/mcp')
| -rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 22 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 2 |
2 files changed, 8 insertions, 16 deletions
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 6245a1b32b..99b23e9db1 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -1097,23 +1097,15 @@ function mcp_fork_topic($topic_ids) } // Sync new topics, parent forums and board stats - sync('topic', 'topic_id', $new_topic_id_list); - - $sync_sql = array(); - - $sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . $total_posts; - $sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . sizeof($new_topic_id_list); - $sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . sizeof($new_topic_id_list); - - foreach ($sync_sql as $forum_id_key => $array) - { - $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET ' . implode(', ', $array) . ' - WHERE forum_id = ' . $forum_id_key; - $db->sql_query($sql); - } + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_posts = forum_posts + ' . $total_posts . ', + forum_topics = forum_topics + ' . sizeof($new_topic_id_list) . ' + WHERE forum_id = ' . $to_forum_id; + $db->sql_query($sql); + sync('topic', 'topic_id', $new_topic_id_list); sync('forum', 'forum_id', $to_forum_id); + set_config_count('num_topics', sizeof($new_topic_id_list), true); set_config_count('num_posts', $total_posts, true); diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 3d36229ee7..c954edacb2 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -895,7 +895,7 @@ class mcp_queue $disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array(); $topic_replies_real = $post_disapprove_list = array(); - // Build a list of posts to be unapproved and get the related topics real replies count + // Build a list of posts to be disapproved and get the related topics real replies count foreach ($post_info as $post_id => $post_data) { $post_disapprove_list[$post_id] = $post_data['topic_id']; |
