\n"; ?> ", ">", $str); */ $str = ereg_replace("&", "&", $str); return $str; ); $indexdir = "/apache/index-iaru"; if ($words == "") { echo "

$sitename Word Search

\n"; } else { echo "

$sitename Word Search Result

\n"; } ?>

\n"; if (count($dirs) > 0) { echo "Choose the area to search:

\n"; } ?>

Index last updated at $modt

\n"; if ($words != ""); ?>


$words$sec

\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 { echo "Nothing on $sitename matches the search.

\n"; } } else { $i = count($report); echo "$i documents match the search:

\n"; } // } ?>