\n\n$sitename\n"; require("slashhead.inc"); titlebar("100%","Searching $query"); if (!isset($min)) $min=0; if (!isset($max)) $max=$min+30; if ($topic!="") $t=$topic; else $t="slashdot"; $sl_q->query("SELECT width,height,alttext,image FROM topics WHERE tid='$t'"); $sl_q->next_record(); if ($tmp=$sl_q->Record["image"]) { printf("Record["image"]); printf("hspace=60 vspace=10 width=%s height=%s alt=%s>\n", $sl_q->Record["width"],$sl_q->Record["height"], $sl_q->Record["alttext"]); } echo "\n"; echo "
"; echo "
\n"; echo "\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.
\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 "

remaining matches...

\n"; } include("slashfoot.inc"); ?>