mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Merge pull request #4466 from Senky/ticket/14795
[ticket/14795] Merge topic views when merging topics
This commit is contained in:
commit
5a6933fee7
1 changed files with 8 additions and 0 deletions
|
@ -420,9 +420,11 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
$sync_forums = array();
|
$sync_forums = array();
|
||||||
|
$topic_views = 0;
|
||||||
foreach ($topic_data as $data)
|
foreach ($topic_data as $data)
|
||||||
{
|
{
|
||||||
$sync_forums[$data['forum_id']] = $data['forum_id'];
|
$sync_forums[$data['forum_id']] = $data['forum_id'];
|
||||||
|
$topic_views += $data['topic_views'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic_data = $topic_data[$to_topic_id];
|
$topic_data = $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);
|
move_posts($post_id_list, $to_topic_id, false);
|
||||||
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $topic_data['topic_title']);
|
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $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
|
// Message and return links
|
||||||
$success_msg = 'POSTS_MERGED_SUCCESS';
|
$success_msg = 'POSTS_MERGED_SUCCESS';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue