mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/8610] Update Bookmarks and Subscriptions when splitting topics
Update bookmarks and subscriptions to add bookmarks/subscriptions to the new topic when using the split_topic function PHPBB3-8610
This commit is contained in:
committed by
Nathan Guse
parent
05d7decdd3
commit
5a88bd1bf1
@@ -98,6 +98,9 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||
$forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
|
||||
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
|
||||
|
||||
$base_url = $url . "&i=$id&action=$action&mode=$mode&sd=$sort_dir&sk=$sort_key&st=$sort_days" . (($merge_select) ? $selected_ids : '');
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $forum_topics, $topics_per_page, $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ACTION' => $action,
|
||||
'FORUM_NAME' => $forum_info['forum_name'],
|
||||
@@ -425,10 +428,15 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
|
||||
// If the topic no longer exist, we will update the bookmarks table.
|
||||
// To not let it error out on users who bookmarked both topics, we just return on an error...
|
||||
$db->sql_return_on_error(true);
|
||||
$db->sql_query('UPDATE ' . BOOKMARKS_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
|
||||
$sql = 'UPDATE ' . BOOKMARKS_TABLE . '
|
||||
SET topic_id = ' . (int) $to_topic_id . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
|
||||
$db->sql_query($sql);
|
||||
$db->sql_return_on_error(false);
|
||||
|
||||
$db->sql_query('DELETE FROM ' . BOOKMARKS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
|
||||
$sql = 'DELETE FROM ' . BOOKMARKS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Link to the new topic
|
||||
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>');
|
||||
|
Reference in New Issue
Block a user