mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/8610] Update Bookmarks when forking topics
Update bookmarks to the new topic when forking topics using the mcp_fork_topic function. PHPBB3-8610
This commit is contained in:
committed by
Nathan Guse
parent
abcc59fca6
commit
8dd2a151cc
@@ -1251,6 +1251,26 @@ function mcp_fork_topic($topic_ids)
|
||||
{
|
||||
$db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary);
|
||||
}
|
||||
|
||||
$sql = 'SELECT user_id
|
||||
FROM ' . BOOKMARKS_TABLE . '
|
||||
WHERE topic_id = ' . $topic_id;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$sql_ary = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$sql_ary[] = array(
|
||||
'topic_id' => (int) $new_topic_id,
|
||||
'user_id' => (int) $row['user_id'],
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($sql_ary))
|
||||
{
|
||||
$db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary);
|
||||
}
|
||||
}
|
||||
|
||||
// Sync new topics, parent forums and board stats
|
||||
@@ -1314,4 +1334,4 @@ function mcp_fork_topic($topic_ids)
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user