2003-12-09 06:46:50 +00:00
|
|
|
<?php
|
|
|
|
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/forum.inc");
|
|
|
|
require_once("../inc/time.inc");
|
2003-12-09 06:46:50 +00:00
|
|
|
|
2004-12-27 03:42:11 +00:00
|
|
|
db_init();
|
|
|
|
|
2003-12-09 06:46:50 +00:00
|
|
|
$search_string = $_GET['search_string'];
|
|
|
|
$offset = $_GET['offset'];
|
|
|
|
if (!$offset) $offset=0;
|
|
|
|
$count = 10;
|
2004-11-10 21:09:54 +00:00
|
|
|
$what = '';
|
2003-12-09 06:46:50 +00:00
|
|
|
|
|
|
|
if ($_GET['titles']) {
|
2004-11-10 21:09:54 +00:00
|
|
|
$what = 'titles=1';
|
2004-05-14 22:57:59 +00:00
|
|
|
page_head("Titles containing '$search_string'");
|
2003-12-09 06:46:50 +00:00
|
|
|
$q = "select * from thread where match(title) against ('$search_string') limit $offset,$count";
|
|
|
|
$result = mysql_query($q);
|
|
|
|
echo "<table>";
|
|
|
|
$n = 0;
|
|
|
|
while ($thread = mysql_fetch_object($result)) {
|
|
|
|
show_thread($thread, $n+$offset+1);
|
|
|
|
$n += 1;
|
|
|
|
}
|
|
|
|
echo "</table>";
|
|
|
|
mysql_free_result($result);
|
|
|
|
|
|
|
|
if ($offset==0 && $n==0) {
|
|
|
|
echo "No titles found containing '$search_string'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($_GET['bodies']) {
|
2004-11-10 21:09:54 +00:00
|
|
|
if (! empty ($what)) {
|
|
|
|
$what .= '&';
|
|
|
|
}
|
|
|
|
$what .= 'bodies=1';
|
|
|
|
|
2004-05-14 22:57:59 +00:00
|
|
|
page_head("Messages containing '$search_string'");
|
2003-12-09 06:46:50 +00:00
|
|
|
$q = "select * from post where match(content) against ('$search_string') limit $offset,$count";
|
|
|
|
$result = mysql_query($q);
|
|
|
|
echo "<table>";
|
|
|
|
$n = 0;
|
|
|
|
while ($post = mysql_fetch_object($result)) {
|
|
|
|
show_post2($post, $n+$offset+1);
|
|
|
|
$n += 1;
|
|
|
|
}
|
|
|
|
echo "</table>";
|
|
|
|
mysql_free_result($result);
|
|
|
|
if ($offset==0 && $n==0) {
|
|
|
|
echo "No messages found containing '$search_string'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($n==$count) {
|
|
|
|
$s = urlencode($search_string);
|
|
|
|
$offset += $count;
|
|
|
|
echo "
|
2004-11-10 21:09:54 +00:00
|
|
|
<a href=forum_text_search_action.php?$what&search_string=$s&offset=$offset>Next $count</a>
|
2003-12-09 06:46:50 +00:00
|
|
|
";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
?>
|