" . $desc . "
"; } $retVal .= "
" . $url . "
"; } } $retVal .= "
"; if ($page > 1) { $navButtons .= "
<< Prev"; } else { $navButtons .= "<< Prev"; } $navButtons .= "|"; if ($count > $numPerPage * $page) { $navButtons .= "
Next >>"; } else { $navButtons .= "Next >>"; } $navButtons .= "
"; $retVal = str_replace("#TOP_OF_RESULTS#", $navButtons, $retVal); $retVal .= $navButtons; } else { $retVal = str_replace("#TOP_OF_RESULTS#", "", $retVal); } } if (!$matchFound) { return "
No matches for '" . $term . "'
"; } return $retVal; } function listallfiles($searchpath) { $allfiles=array(); $root = @opendir($searchpath); while($file = readdir($root)) { if($file != "." && $file != "..") { if (!is_dir($file)) { $ext = getfileextention($file); if ($ext == "idx") { $allfiles[] = $searchpath . $file; } } } } closedir($root); return $allfiles; } function getfileextention($filename) { $path_info = pathinfo($filename); return $path_info['extension']; } ?>