aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-09-26 22:35:08 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-09-26 22:35:08 +0000
commit275f67a5075df42530c1622733fe908a172e27dc (patch)
tree20ec1381e3c35e6973fb337bd47e582d01390343 /phpBB/search.php
parent53dd64926a73eab3d9d7bd1a0ccbddd16b9aaf83 (diff)
downloadforums-275f67a5075df42530c1622733fe908a172e27dc.tar
forums-275f67a5075df42530c1622733fe908a172e27dc.tar.gz
forums-275f67a5075df42530c1622733fe908a172e27dc.tar.bz2
forums-275f67a5075df42530c1622733fe908a172e27dc.tar.xz
forums-275f67a5075df42530c1622733fe908a172e27dc.zip
Added view newest output for topic search
git-svn-id: file:///svn/phpbb/trunk@1094 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/search.php')
-rw-r--r--phpBB/search.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index 4662c1f185..287b6e82d1 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -21,8 +21,7 @@
***************************************************************************/
//
-// Massive overhaul for phpBB2,
-// originally based on search code
+// Massive overhaul for phpBB2, originally based on search code
// I knocked together for my own website
//
// PSO : 2001
@@ -38,8 +37,8 @@ include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
function gensearch_sql($searchstring, $override_all = 0)
{
- $searchchars = array("'[\s]+'", "'\/'", "';'", "'@'", "'&'", "'#'", "'_'", "'|'", "'¬'", "'\*'");
- $replacechars = array(" ", "", "", "", " ", "", "", "", " ", "", "%");
+ $searchchars = array("'[\s]+'", "'\/'", "';'", "'@'", "'#'", "'_'", "'|'", "'¬'", "'\*'");
+ $replacechars = array(" ", "", "", "", " ", "", "", " ", "", "%");
$searchstring = trim(preg_replace($searchchars, $replacechars, strip_tags($searchstring)));
@@ -194,7 +193,7 @@ function gensearch_sql($searchstring, $override_all = 0)
}
$findword = $searchlistandtype["AND"][$j];
- $searchstring .= " ( pt.post_text LIKE '% $findword %')";
+ $searchstring .= " ( pt.post_text LIKE '$findword')";
}// OR pt.post_text LIKE '$findword %' OR pt.post_text LIKE '% $findword'
}
elseif($binsearchtype[$i] == "OR" && count($searchlistandtype["OR"]))
@@ -211,7 +210,7 @@ function gensearch_sql($searchstring, $override_all = 0)
}
$findword = $searchlistandtype["OR"][$j];
- $searchstring .= " ( pt.post_text LIKE '% $findword %' )";
+ $searchstring .= " ( pt.post_text LIKE '$findword' )";
}// OR pt.post_text LIKE '$findword %' OR pt.post_text LIKE '% $findword'
}
elseif($binsearchtype[$i] == "NOT" && count($searchlistandtype["NOT"]))
@@ -254,7 +253,7 @@ function gensearch_sql($searchstring, $override_all = 0)
}
}
- $searchstring = "($searchstring)";
+ $searchstring = "( $searchstring )";
$searchdata[0] = $searchstring;
for($i = 0; $i < count($searchforwords); $i++)
@@ -939,6 +938,15 @@ if( $query_keywords != "" || $query_author != "" || $search_id )
}
}
+ if($searchset[$i]['post_time'] >= $userdata['session_last_visit'])
+ {
+ $newest_post_img = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=newest\"><img src=\"" . $images['icon_newest_reply'] . "\" alt=\"" . $lang['View_newest_posts'] . "\" border=\"0\" /></a> ";
+ }
+ else
+ {
+ $newest_post_img = "";
+ }
+
$topic_poster = $searchset[$i]['username'];
$last_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);
@@ -963,6 +971,7 @@ if( $query_keywords != "" || $query_author != "" || $search_id )
"FORUM_ID" => $forum_id,
"TOPIC_ID" => $topic_id,
"FOLDER" => $folder_image,
+ "NEWEST_POST_IMG" => $newest_post_img,
"TOPIC_POSTER" => $topic_poster,
"GOTO_PAGE" => $goto_page,
"REPLIES" => $replies,