aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-09-07 12:39:37 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-09-07 12:39:37 +0000
commitfdf19b0d9590bb3de3078adb86ba080afe2acc34 (patch)
tree31d2123f565ee8c7ccfd9cad7462a5facd69f2b1 /phpBB/search.php
parent02b2cced5ae562145288a0dbe2bd534bf4f41b7f (diff)
downloadforums-fdf19b0d9590bb3de3078adb86ba080afe2acc34.tar
forums-fdf19b0d9590bb3de3078adb86ba080afe2acc34.tar.gz
forums-fdf19b0d9590bb3de3078adb86ba080afe2acc34.tar.bz2
forums-fdf19b0d9590bb3de3078adb86ba080afe2acc34.tar.xz
forums-fdf19b0d9590bb3de3078adb86ba080afe2acc34.zip
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
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10117 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/search.php')
-rw-r--r--phpBB/search.php47
1 files changed, 24 insertions, 23 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index 66323e5d1d..efe5c247cb 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -372,30 +372,31 @@ if ($keywords || $author || $author_id || $search_id || $submit)
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) : '');
+ $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');
- 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);
+ $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) : '');
- 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';
- }
+ 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,7 +542,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$hilit = (strspn($hilit, '*') === strlen($hilit)) ? '' : $hilit;
$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
- $u_show_results = ($show_results != 'posts') ? '&amp;sr=' . $show_results : '';
+ $u_show_results = '&amp;sr=' . $show_results;
$u_search_forum = implode('&amp;fid%5B%5D=', $search_forum);
$u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);