mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00: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:
parent
abcc59fca6
commit
8dd2a151cc
1 changed files with 21 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue