diff options
author | Nils Adermann <naderman@naderman.de> | 2010-04-04 15:32:36 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-04-04 15:32:36 +0200 |
commit | 925a135613a80ba9bfc3b26a2524d3c2d3ba77b3 (patch) | |
tree | 36f31fc9a6c7d173e17566f9c2f584d56bc62102 | |
parent | 560a1b3ad44386dd6c285d0a5209390c2b9e2f1f (diff) | |
parent | 492063cec63fe3665406a74e74265c1a7dd5c295 (diff) | |
download | forums-925a135613a80ba9bfc3b26a2524d3c2d3ba77b3.tar forums-925a135613a80ba9bfc3b26a2524d3c2d3ba77b3.tar.gz forums-925a135613a80ba9bfc3b26a2524d3c2d3ba77b3.tar.bz2 forums-925a135613a80ba9bfc3b26a2524d3c2d3ba77b3.tar.xz forums-925a135613a80ba9bfc3b26a2524d3c2d3ba77b3.zip |
Merge branch 'bug/cs278/59465' into develop-olympus
* bug/cs278/59465:
[bug/59465] Remove start=0 from topic pagination links.
[bug/59465] Removes start=0 from URLs used by viewtopic and viewforum.
-rw-r--r-- | phpBB/includes/functions_display.php | 2 | ||||
-rw-r--r-- | phpBB/viewforum.php | 6 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 12 |
3 files changed, 10 insertions, 10 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f49aa42324..ea77551fc4 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -660,7 +660,7 @@ function topic_generate_pagination($replies, $url) $times = 1; for ($j = 0; $j < $replies + 1; $j += $per_page) { - $pagination .= '<a href="' . $url . '&start=' . $j . '">' . $times . '</a>'; + $pagination .= '<a href="' . $url . ($j == 0 ? '' : '&start=' . $j) . '">' . $times . '</a>'; if ($times == 1 && $total_pages > 5) { $pagination .= ' ... '; diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 5fb91c0292..d18508ccbc 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -151,7 +151,7 @@ $template->set_filenames(array( make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id); $template->assign_vars(array( - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"), + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&start=$start")), )); // Not postable forum or showing active topics? @@ -302,7 +302,7 @@ $template->assign_vars(array( 'S_WATCH_FORUM_LINK' => $s_watching_forum['link'], 'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'], 'S_WATCHING_FORUM' => $s_watching_forum['is_watching'], - 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"), + 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&start=$start")), 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false, 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'fid[]=' . $forum_id), 'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true, @@ -311,7 +311,7 @@ $template->assign_vars(array( 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id) : '', - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . "&start=$start"), + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($start == 0) ? '' : "&start=$start")), 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics") : '', )); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 29c4e5cdc1..8e0521522d 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -477,7 +477,7 @@ if ($start < 0 || $start >= $total_posts) } // General Viewtopic URL for return links -$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : '')); +$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : '')); // Are we watching this topic? $s_watching_topic = array( @@ -601,7 +601,7 @@ $template->assign_vars(array( 'PAGINATION' => $pagination, 'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start), 'TOTAL_POSTS' => ($total_posts == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total_posts), - 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&f=$forum_id&t=$topic_id&start=$start" . ((strlen($u_sort_param)) ? "&$u_sort_param" : ''), true, $user->session_id) : '', + 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . ((strlen($u_sort_param)) ? "&$u_sort_param" : ''), true, $user->session_id) : '', 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '', 'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'), @@ -630,9 +630,9 @@ $template->assign_vars(array( 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true, - 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"), + 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")), 'S_TOPIC_MOD' => ($topic_mod != '') ? '<select name="action" id="quick-mod-select">' . $topic_mod . '</select>' : '', - 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id&start=$start&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id), + 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . "&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id), 'S_VIEWTOPIC' => true, 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false, @@ -722,7 +722,7 @@ if (!empty($topic_data['poll_start'])) if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting')) { - $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"); + $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")); meta_refresh(5, $redirect_url); if (!sizeof($voted_id)) @@ -805,7 +805,7 @@ if (!empty($topic_data['poll_start'])) //, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now $db->sql_query($sql); - $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"); + $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")); meta_refresh(5, $redirect_url); trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>')); |