aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
authorDaniel Sinn <daniel.p.sinn@gmail.com>2016-10-03 10:24:30 -0400
committerDaniel Sinn <daniel.p.sinn@gmail.com>2016-10-03 10:24:30 -0400
commit59b52d6312cd10631532f6d1dcdabef141081fdc (patch)
tree90e1a1a96aa94d7822e8bb501c3069453ece0f82 /phpBB/includes/mcp
parent32d569c59464a80eb8c78a98b1953de0aa1008d8 (diff)
parent85e4566223487899f3a2789983cb50e68296a982 (diff)
downloadforums-59b52d6312cd10631532f6d1dcdabef141081fdc.tar
forums-59b52d6312cd10631532f6d1dcdabef141081fdc.tar.gz
forums-59b52d6312cd10631532f6d1dcdabef141081fdc.tar.bz2
forums-59b52d6312cd10631532f6d1dcdabef141081fdc.tar.xz
forums-59b52d6312cd10631532f6d1dcdabef141081fdc.zip
[ticket/14804] Merge remote-tracking branch 'upstream/3.1.x' into ticket/14804
PHPBB3-14804
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_forum.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 87f2e558f5..0fb8bf1109 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -420,9 +420,11 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
}
$sync_forums = array();
+ $topic_views = 0;
foreach ($all_topic_data as $data)
{
$sync_forums[$data['forum_id']] = $data['forum_id'];
+ $topic_views += $data['topic_views'];
}
$to_topic_data = $all_topic_data[$to_topic_id];
@@ -478,6 +480,12 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
move_posts($post_id_list, $to_topic_id, false);
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $to_topic_data['topic_title']);
+ // Update topic views count
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_views = ' . $topic_views . '
+ WHERE topic_id = ' . $to_topic_id;
+ $db->sql_query($sql);
+
// Message and return links
$success_msg = 'POSTS_MERGED_SUCCESS';