Oops, forgot to commit search.php

git-svn-id: file:///svn/phpbb/trunk@1311 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
James Atkinson 2001-11-14 06:39:17 +00:00
parent f448cdf609
commit 6c5c2a0aba

View file

@ -247,7 +247,7 @@ if( $mode == "searchuser" )
else if( $query_keywords != "" || $query_author != "" || $search_id ) else if( $query_keywords != "" || $query_author != "" || $search_id )
{ {
if( $query_keywords != "" || $query_author != "" || $search_id == "newposts" ) if( $query_keywords != "" || $query_author != "" || $search_id == "newposts" || $search_id == "egosearch" || $search_id == "unanswered")
{ {
$synonym_array = @file($phpbb_root_path . "language/lang_" . $board_config['default_lang'] . "/search_synonyms.txt"); $synonym_array = @file($phpbb_root_path . "language/lang_" . $board_config['default_lang'] . "/search_synonyms.txt");
$stopword_array = @file($phpbb_root_path . "language/lang_" . $board_config['default_lang'] . "/search_stopwords.txt"); $stopword_array = @file($phpbb_root_path . "language/lang_" . $board_config['default_lang'] . "/search_stopwords.txt");
@ -260,6 +260,24 @@ else if( $query_keywords != "" || $query_author != "" || $search_id )
$sortby_dir = "DESC"; $sortby_dir = "DESC";
} }
if( $search_id == "egosearch" )
{
$query_author = $userdata['username'];
$show_results = "topics";
$search_time = 0;
$sortby = 0;
$sortby_dir = "DESC";
}
if( $search_id == "unanswered" )
{
$show_results = "topics";
$search_time = 0;
$sortby = 0;
$sortby_dir = "DESC";
}
$cleaned_search = clean_words_search($query_keywords); $cleaned_search = clean_words_search($query_keywords);
$cleaned_search = remove_stop_words($cleaned_search, $stopword_array); $cleaned_search = remove_stop_words($cleaned_search, $stopword_array);
$cleaned_search = replace_synonyms($cleaned_search, $synonym_array); $cleaned_search = replace_synonyms($cleaned_search, $synonym_array);
@ -440,6 +458,14 @@ else if( $query_keywords != "" || $query_author != "" || $search_id )
} }
} }
//
// Unanswered Posts
//
if( $search_id == "unanswered" )
{
$search_sql .= ( $search_sql == "" ) ? "t.topic_replies = 0 " : "AND t.topic_replies = 0 ";
}
// //
// If user is logged in then we'll // If user is logged in then we'll
// check to see which (if any) private // check to see which (if any) private
@ -449,7 +475,7 @@ else if( $query_keywords != "" || $query_author != "" || $search_id )
// If not logged in we explicitly prevent // If not logged in we explicitly prevent
// searching of private forums // searching of private forums
// //
if( $search_sql != "" || $search_id == "newposts" ) if( $search_sql != "" || $search_id == "newposts" || $search_id == "egosearch" || $search_id == "unanswered" )
{ {
$sql = "SELECT $sql_fields $sql = "SELECT $sql_fields
FROM $sql_from "; FROM $sql_from ";
@ -837,7 +863,6 @@ else if( $query_keywords != "" || $query_author != "" || $search_id )
$message = preg_replace($search_string, $replace_string, $message); $message = preg_replace($search_string, $replace_string, $message);
} }
} }
$template->assign_block_vars("searchresults", array( $template->assign_block_vars("searchresults", array(
"TOPIC_TITLE" => $topic_title, "TOPIC_TITLE" => $topic_title,
"FORUM_NAME" => $searchset[$i]['forum_name'], "FORUM_NAME" => $searchset[$i]['forum_name'],
@ -858,6 +883,7 @@ else if( $query_keywords != "" || $query_author != "" || $search_id )
{ {
$message = ""; $message = "";
if( count($orig_word) ) if( count($orig_word) )
{ {
$topic_title = preg_replace($orig_word, $replacement_word, $searchset[$i]['topic_title']); $topic_title = preg_replace($orig_word, $replacement_word, $searchset[$i]['topic_title']);