diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2012-09-03 15:35:06 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-13 20:23:03 -0600 |
commit | 5a88bd1bf103537aece6713145fd13288cf3c329 (patch) | |
tree | b211f7e94ad19dbdaf6b7a1828fff423902859b5 /phpBB/includes/mcp/mcp_forum.php | |
parent | 05d7decdd35eac3b58807b9ced318421a6ce15da (diff) | |
download | forums-5a88bd1bf103537aece6713145fd13288cf3c329.tar forums-5a88bd1bf103537aece6713145fd13288cf3c329.tar.gz forums-5a88bd1bf103537aece6713145fd13288cf3c329.tar.bz2 forums-5a88bd1bf103537aece6713145fd13288cf3c329.tar.xz forums-5a88bd1bf103537aece6713145fd13288cf3c329.zip |
[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
Diffstat (limited to 'phpBB/includes/mcp/mcp_forum.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 865e464e81..ce709e7f71 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -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>'); |