aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_main.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-10-23 15:30:52 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-10-23 16:59:33 +0200
commit43e6b3a921d45150cd5c2a931e3e14758081f321 (patch)
treee4c18a4bcb71ad024e0b072b1dcc8ba0e0aa15ea /phpBB/includes/mcp/mcp_main.php
parentfec72c4b782cda044b9a05122530f3a32213b407 (diff)
downloadforums-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/mcp_main.php')
-rw-r--r--phpBB/includes/mcp/mcp_main.php22
1 files changed, 7 insertions, 15 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);