From: Meik S. <acy...@ph...> - 2009-09-07 12:40:26
|
Author: acydburn Date: Mon Sep 7 13:39:37 2009 New Revision: 10117 Log: since we now have several search_ids, all with different default results modes we now always add the sr variable to the URL - Bug #50775 Modified: branches/phpBB-3_0_0/phpBB/search.php Modified: branches/phpBB-3_0_0/phpBB/search.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/search.php (original) --- branches/phpBB-3_0_0/phpBB/search.php Mon Sep 7 13:39:37 2009 *************** *** 372,401 **** break; case 'unreadposts': ! $l_search_title = $user->lang['SEARCH_UNREAD']; ! // force sorting ! $show_results = 'topics'; ! $sort_key = 't'; ! $sort_by_sql['t'] = 't.topic_last_post_time'; ! $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); ! $sql_where = 'AND t.topic_moved_id = 0 ! ' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . ' ! ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : ''); ! gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); ! $s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = ''; ! ! $unread_list = array(); ! $unread_list = get_unread_topics_list($user->data['user_id'], $sql_where, $sql_sort); ! if (!empty($unread_list)) ! { ! $sql = 'SELECT t.topic_id ! FROM ' . TOPICS_TABLE . ' t ! WHERE ' . $db->sql_in_set('t.topic_id', array_keys($unread_list)) . " ! $sql_sort"; ! $field = 'topic_id'; ! } break; case 'newposts': --- 372,402 ---- break; case 'unreadposts': ! $l_search_title = $user->lang['SEARCH_UNREAD']; ! // force sorting ! $show_results = 'topics'; ! $sort_key = 't'; ! $sort_by_sql['t'] = 't.topic_last_post_time'; ! $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); ! $sql_where = 'AND t.topic_moved_id = 0 ! ' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . ' ! ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : ''); ! gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); ! $s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = ''; ! ! $unread_list = array(); ! $unread_list = get_unread_topics_list($user->data['user_id'], $sql_where, $sql_sort); ! ! if (!empty($unread_list)) ! { ! $sql = 'SELECT t.topic_id ! FROM ' . TOPICS_TABLE . ' t ! WHERE ' . $db->sql_in_set('t.topic_id', array_keys($unread_list)) . " ! $sql_sort"; ! $field = 'topic_id'; ! } break; case 'newposts': *************** *** 541,547 **** $hilit = (strspn($hilit, '*') === strlen($hilit)) ? '' : $hilit; $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); ! $u_show_results = ($show_results != 'posts') ? '&sr=' . $show_results : ''; $u_search_forum = implode('&fid%5B%5D=', $search_forum); $u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results); --- 542,548 ---- $hilit = (strspn($hilit, '*') === strlen($hilit)) ? '' : $hilit; $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); ! $u_show_results = '&sr=' . $show_results; $u_search_forum = implode('&fid%5B%5D=', $search_forum); $u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results); |