$sitename = "IARUWeb"; echo "
\n"; if ($words != ""); ?>
\n";
$cmd = "/usr/local/bin/swish -f $indexdir/$index.swish -m 200 -w $words ";
unset($ary);
exec(EscapeShellCmd($cmd), $ary, $rval);
reset($ary);
unset($report);
unset($errs);
$i = 0;
while ($i < count($ary)) {
$l = $ary[];
if (substr($l, 0, 4) == "err:") {
$errs[] = $l;
}
$c = substr($l, 0, 1);
if ($c >= "0" && $c <= "9") {
$l = ereg_replace(" +", " ", $l);
$rank = strtok($l, " ");
$file = strtok(" ");
reset($replace);
$j = 0;
while ($j < count($replace)) {
$r = key($replace);
$e = $replace[$r];
$url = ereg_replace($r, $e, $file)
;
next($replace);
$j++;
}
$ttl = strchr($l, '"');
if ($ttl != "") {
$ttl = substr($ttl, 1, strlen($ttl)-1);
$size = strchr($ttl, '"');
$ttl = substr($ttl, 0, strlen($ttl) - strlen($size));
}
$t = fileMtime($file);
$modt = date("l, M d Y H:i:s", $t);
$s = "$url ";
$s = $s + "Last changed ($modt)
$ttl
\n"; $report[] = $s; } $i++; } if (count($report) == 0) { if (count($errs) > 0) { $comerr[" no results"] = "Nothing matches"; $comerr[" a word is too common"] = "One of the words you searched for appears so many times in $section that it was removed from the index. (Try different words or a different area.)"; echo "Errors:
\n"; } } else { $i = count($report); echo "$i documents match the search:
\n"; } // } ?> include "/apache/webfiles/swishinfo.phtml"; include "/apache/webfiles/iaru-footer.html"; ?>