From c9cef63cc62dda2f609cd6f12b8056ad26b38a6a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 17 Jun 2009 09:08:24 +0000 Subject: Fix bug #19135 - Exclude forum from active topics option is ignored Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9601 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index cf2e8615c2..5e2a7c2836 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -155,7 +155,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE ' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . " OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : ""; - $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id + $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, f.forum_flags, fa.user_id FROM ' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id AND fa.session_id = '" . $db->sql_escape($user->session_id) . "') @@ -173,6 +173,13 @@ if ($keywords || $author || $author_id || $search_id || $submit) continue; } + // Exclude forums from active topics + if (!($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) && ($search_id == 'active_topics')) + { + $ex_fid_ary[] = (int) $row['forum_id']; + continue; + } + if (sizeof($search_forum)) { if ($search_child) @@ -308,7 +315,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) $last_post_time = ''; } - if ($sort_key == 'a') { $sort_join = USERS_TABLE . ' u, '; @@ -945,7 +951,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) page_footer(); } - // Search forum $s_forums = ''; $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id, f.forum_password, f.enable_indexing, fa.user_id -- cgit v1.2.1 From bfcf6a1de5181a0b26b247f8cb9e181b8c83ff90 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Mon, 22 Jun 2009 14:36:04 +0000 Subject: Fix bug #46765 - View unread posts Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9653 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index 5e2a7c2836..e5fd852e0d 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -348,6 +348,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) break; case 'newposts': + case 'unreadposts': $l_search_title = $user->lang['SEARCH_NEW']; // force sorting $show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics'; @@ -803,6 +804,10 @@ if ($keywords || $author || $author_id || $search_id || $submit) topic_status($row, $replies, (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false, $folder_img, $folder_alt, $topic_type); $unread_topic = (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false; + if ($search_id == 'unreadposts' && !$unread_topic) + { + continue; + } $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; -- cgit v1.2.1 From 1c0df0dc91dcfb603cfb653e7daaf03257ac5495 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 25 Jun 2009 17:57:57 +0000 Subject: revert r9653 because it does not work as advertised (a load of bugs and not really what we wanted... back to the drawing board ;)) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9674 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 5 ----- 1 file changed, 5 deletions(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index e5fd852e0d..5e2a7c2836 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -348,7 +348,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) break; case 'newposts': - case 'unreadposts': $l_search_title = $user->lang['SEARCH_NEW']; // force sorting $show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics'; @@ -804,10 +803,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) topic_status($row, $replies, (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false, $folder_img, $folder_alt, $topic_type); $unread_topic = (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false; - if ($search_id == 'unreadposts' && !$unread_topic) - { - continue; - } $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; -- cgit v1.2.1 From 2854705096a5029295ab99fa9fcf063661fc2cbc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 2 Jul 2009 10:28:32 +0000 Subject: Fix bug #36565 - Search by authorname does not display posts of guests and deleted users Authorised by: naderman git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9713 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index 5e2a7c2836..c7c1d47257 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -97,6 +97,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) // If we are looking for authors get their ids $author_id_ary = array(); + $sql_author_match = ''; if ($author_id) { $author_id_ary[] = $author_id; @@ -122,6 +123,22 @@ if ($keywords || $author || $author_id || $search_id || $submit) } $db->sql_freeresult($result); + $sql_where = (strpos($author, '*') !== false) ? ' post_username ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " post_username = '" . $db->sql_escape(utf8_clean_string($author)) . "'"; + + $sql = 'SELECT 1 as guest_post + FROM ' . POSTS_TABLE . " + WHERE $sql_where + AND poster_id = " . ANONYMOUS; + $result = $db->sql_query_limit($sql, 1); + $found_guest_post = $db->sql_fetchfield('guest_post'); + $db->sql_freeresult($result); + + if ($found_guest_post) + { + $author_id_ary[] = ANONYMOUS; + $sql_author_match = (strpos($author, '*') !== false) ? ' ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " = '" . $db->sql_escape(utf8_clean_string($author)) . "'"; + } + if (!sizeof($author_id_ary)) { trigger_error('NO_SEARCH_RESULTS'); @@ -435,12 +452,12 @@ if ($keywords || $author || $author_id || $search_id || $submit) if (!empty($search->search_query)) { - $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page); + $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page); } else if (sizeof($author_id_ary)) { $firstpost_only = ($search_fields === 'firstpost' || $search_fields == 'titleonly') ? true : false; - $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page); + $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page); } // For some searches we need to print out the "no results" page directly to allow re-sorting/refining the search options. -- cgit v1.2.1 From acf0fad19ab1323e9df96b094a2d38f338ce6da0 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 8 Jul 2009 12:48:07 +0000 Subject: Fix bug #47765 - Search by authorname does not display posts of deactivated users Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9732 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index c7c1d47257..48c0290d87 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -114,7 +114,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sql = 'SELECT user_id FROM ' . USERS_TABLE . " WHERE $sql_where - AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + AND user_type <> " . USER_IGNORE; $result = $db->sql_query_limit($sql, 100); while ($row = $db->sql_fetchrow($result)) -- cgit v1.2.1 From 51748b00ed8e6b709f1a7df59570e8ecee6783d5 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Tue, 14 Jul 2009 14:46:38 +0000 Subject: Fix bug #46765 - View unread posts Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9755 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index 48c0290d87..61aa16a6fb 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -364,6 +364,39 @@ if ($keywords || $author || $author_id || $search_id || $submit) } break; + case 'unreadposts': + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $l_search_title = $user->lang['SEARCH_UNREAD']; + // force sorting + $show_results = 'topics'; + $sort_key = 't'; + $sort_dir = 'd'; + $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(); + + 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)) . ' + 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) : '') . " + $sql_sort"; + $field = 'topic_id'; + } + break; + } + // Do nothing if it's cookie based read tracking + // Just do not break and let user to see newposts + case 'newposts': $l_search_title = $user->lang['SEARCH_NEW']; // force sorting -- cgit v1.2.1 From 1dcd7d2da8175b2ec099f4b07168b1d6c0a055e3 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 25 Jul 2009 12:35:46 +0000 Subject: Correctly propagate umlauts over search result pages [Bug #33755] git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9850 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index 61aa16a6fb..65e56b5d31 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -545,7 +545,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results); $u_search .= ($search_id) ? '&search_id=' . $search_id : ''; - $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : ''; + $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; $u_search .= ($search_terms != 'all') ? '&terms=' . $search_terms : ''; $u_search .= ($topic_id) ? '&t=' . $topic_id : ''; $u_search .= ($author) ? '&author=' . urlencode(htmlspecialchars_decode($author)) : ''; -- cgit v1.2.1 From ba37fa4f49c17047da9aeeb8ada5efaf1030e795 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Sun, 26 Jul 2009 10:16:52 +0000 Subject: Fix r9755 for #46765 Authorised by: ToonArmy git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9855 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index 65e56b5d31..d913ca7ec9 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -381,7 +381,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $unread_list = array(); $unread_list = get_unread_topics_list(); - if(!empty($unread_list)) + if (!empty($unread_list)) { $sql = 'SELECT t.topic_id FROM ' . TOPICS_TABLE . ' t -- cgit v1.2.1 From b4297abf2a6aca7e6d3ffccbb61c096a5c590f86 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Mon, 17 Aug 2009 13:25:04 +0000 Subject: Fix bug #49525 - Search for unreads should require login Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10004 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index d913ca7ec9..3556c5b435 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -95,6 +95,13 @@ if ($keywords || $author || $author_id || $search_id || $submit) } } + // search for unread posts needs user to be logged in + // if topics tracking for guests is disabled + if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered']) + { + login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']); + } + // If we are looking for authors get their ids $author_id_ary = array(); $sql_author_match = ''; -- cgit v1.2.1 From 45f570038426f36d547dcdc23ef631bd48a7dc6e Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Mon, 17 Aug 2009 13:28:28 +0000 Subject: Add unread posts search support for cookie-based tracking Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10005 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index 3556c5b435..f991e8e023 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -372,8 +372,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) break; case 'unreadposts': - if ($config['load_db_lastread'] && $user->data['is_registered']) - { $l_search_title = $user->lang['SEARCH_UNREAD']; // force sorting $show_results = 'topics'; @@ -399,10 +397,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sql_sort"; $field = 'topic_id'; } - break; - } - // Do nothing if it's cookie based read tracking - // Just do not break and let user to see newposts + break; case 'newposts': $l_search_title = $user->lang['SEARCH_NEW']; -- cgit v1.2.1 From fa754d1576466f7ca8a483e72b5b1e1d47a4b1ad Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Tue, 25 Aug 2009 13:52:35 +0000 Subject: One more unread posts search adjustment. Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10057 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index f991e8e023..66323e5d1d 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -376,24 +376,23 @@ if ($keywords || $author || $author_id || $search_id || $submit) // force sorting $show_results = 'topics'; $sort_key = 't'; - $sort_dir = 'd'; $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(); + $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)) . ' - 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) : '') . " + WHERE ' . $db->sql_in_set('t.topic_id', array_keys($unread_list)) . " $sql_sort"; $field = 'topic_id'; } -- cgit v1.2.1 From fdf19b0d9590bb3de3078adb86ba080afe2acc34 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 7 Sep 2009 12:39:37 +0000 Subject: 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 --- phpBB/search.php | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'phpBB/search.php') 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') ? '&sr=' . $show_results : ''; + $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); -- cgit v1.2.1 From d85493ab16658387d603ca0d949e65bc3ea1533c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 8 Sep 2009 08:53:01 +0000 Subject: Rename get_unread_topics_list() to get_unread_topics(). Cleanup: Remove some stuff we no longer need. Related to report #46765 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10120 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/search.php') diff --git a/phpBB/search.php b/phpBB/search.php index efe5c247cb..258297d088 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -387,7 +387,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $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); + $unread_list = get_unread_topics($user->data['user_id'], $sql_where, $sql_sort); if (!empty($unread_list)) { -- cgit v1.2.1