\n
\n| "; echo " | ";
echo "\n \n"; echo " | |
| "; $sl_q->query("SELECT tid FROM topics ORDER BY tid"); echo " | \n"; $sl_q->query("SELECT section FROM sections ORDER BY section"); echo " | \n"; $sl_q->query("SELECT aid FROM authors WHERE seclev>10 ORDER BY aid"); echo ""; echo " |
\n";
$prev=$min-30;
if ($prev>=0) {
echo " $min previous matches...
\n";
}
$q = "SELECT authors.aid,title,sid,date_format(time,\"%W, %M %d \@%h:%m\") AS df,";
$q .= "commentcount,url,section FROM stories,authors ";
$q .= "WHERE stories.aid=authors.aid ";
if (isset($query))
$q .= "AND (title LIKE \"%$query%\" OR introtext LIKE \"%$query%\") ";
if ($author != "")
$q .= "AND authors.aid=\"$author\" ";
if ($section != "")
$q .= "AND section=\"$section\" ";
if ($topic != "")
$q .= "AND tid=\"$topic\" ";
$q .= " ORDER BY time DESC LIMIT $min,30";
$sl_q->query($q);
$x=0;
while ($sl_q->next_record()) {
$tdf = $sl_q->Record["df"];
$tsid = $sl_q->Record["sid"];
$turl = $sl_q->Record["url"];
$taid = $sl_q->Record["aid"];
$ttitle = $sl_q->Record["title"];
$tcommentcount = $sl_q->Record["commentcount"];
$furl = "$rootdir/article.php3?sid=$tsid";
printf(" %s by %s ",$furl,$ttitle,$turl,$taid);
if($tcommentcount>1) printf("on %s. %s comments. remaining matches...
\n",$tdf,$tcommentcount);
else printf("on %s. %s comment.
\n",$tdf,$tcommentcount);
$x++;
}
if ($x<1) echo "No matches found to your query";
if ($x>=29) {
echo "
\n"; } include("slashfoot.inc"); ?>