diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-12-14 02:41:33 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-12-14 02:41:33 +0000 |
| commit | 880013144e2c80490f9b71457a3f0104c2b3a6d2 (patch) | |
| tree | f396e2bf37edb717ffb87de59f3df4c440bc94b6 /phpBB/search.php | |
| parent | bef3314e50e1f38fe53cbaaf47dd09fc46d42f49 (diff) | |
| download | forums-880013144e2c80490f9b71457a3f0104c2b3a6d2.tar forums-880013144e2c80490f9b71457a3f0104c2b3a6d2.tar.gz forums-880013144e2c80490f9b71457a3f0104c2b3a6d2.tar.bz2 forums-880013144e2c80490f9b71457a3f0104c2b3a6d2.tar.xz forums-880013144e2c80490f9b71457a3f0104c2b3a6d2.zip | |
Remove guest user topic tracking via cookies, update viewtopic to re-fix highlighting of search terms, add lang capability to images, various other issues, removed remote avatar size reduction
git-svn-id: file:///svn/phpbb/trunk@1566 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/search.php')
| -rw-r--r-- | phpBB/search.php | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/phpBB/search.php b/phpBB/search.php index 39125e3310..40f35834c1 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -265,10 +265,17 @@ else if( $query_keywords != "" || $query_author != "" || $search_id ) { if( $search_id == "newposts" ) { - $sql = "SELECT post_id - FROM " . POSTS_TABLE . " - WHERE post_time >= " . $userdata['session_last_visit'] . " - ORDER BY post_time DESC"; + if( $userdata['session_logged_in'] ) + { + $sql = "SELECT post_id + FROM " . POSTS_TABLE . " + WHERE post_time >= " . $userdata['user_lastvisit'] . " + ORDER BY post_time DESC"; + } + else + { + message_die(GENERAL_MESSAGE, $lang['No_search_match']); + } } else if( $search_id == "egosearch" ) { @@ -555,7 +562,7 @@ else if( $query_keywords != "" || $query_author != "" || $search_id ) // // Define common SQL // - $sql_fields = ( $show_results == "posts") ? "pt.post_text, pt.post_subject, p.post_id, p.post_time, p.post_username, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid" : "f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username" ; + $sql_fields = ( $show_results == "posts") ? "pt.post_text, pt.bbcode_uid, pt.post_subject, p.post_id, p.post_time, p.post_username, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid" : "f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username" ; $sql_from = ( $show_results == "posts") ? FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt" : FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2"; @@ -882,7 +889,7 @@ else if( $query_keywords != "" || $query_author != "" || $search_id ) if( $showresults == "posts" ) { - if($return_chars != 0 ) + if( $return_chars ) { $bbcode_uid = $searchset[$i]['bbcode_uid']; @@ -909,13 +916,6 @@ else if( $query_keywords != "" || $query_author != "" || $search_id ) $user_sig = $searchset[$i]['user_sig']; $user_sig_bbcode_uid = $searchset[$i]['user_sig_bbcode_uid']; - - - if( count($search_string) ) - { - $message = preg_replace($search_string, $replace_string, $message); - } - if( !$board_config['allow_html'] ) { if( $user_sig != "" && $searchset[$i]['enable_sig'] && $userdata['user_allowhtml'] ) @@ -945,6 +945,12 @@ else if( $query_keywords != "" || $query_author != "" || $search_id ) } $message = make_clickable($message); + + if( count($search_string) ) + { + $message = preg_replace($search_string, $replace_string, $message); + } + } if( count($orig_word) ) |
