else {
echo "<a href=\"$file_n\"><b>$nun</b> </a>| $orig ";
}
Código PHP:
function s_search($query) {
// Searches for query in the index file.
// Multiple word search originally contributed by Matthew Furister <[email protected]>
$query = trim(strtolower(c_strip_chars($query)));
$search_data = @file($GLOBALS[index_file]) or die("<h4 align=\"center\">$GLOBALS[err_no_search_db]</h4>");
$pages_found = " ";
foreach ($search_data as $search_page) {
$page_arr = explode("|", $search_page);
$found_count = 0;
$qry_array = split('[, ]+',trim(strtolower($query)));
foreach ($qry_array as $qry) {
if (in_array($qry, $page_arr)) {
++$found_count;
$pages_found .= $page_arr[0] . " ";
}
}
if ($found_count == count($qry_array)) $result_arr[] = $page_arr[0];
}
return $result_arr;
}
function s_print_title_desc($file_n) {
$file = @file($file_n);
$nun=1;
$num=++$nun;
if ($file) {
$line_complete = implode('', $file);
eregi("<title>(.*)</title>", $line_complete, $out);
$title = trim($out[1]);
if($title) $line_complete = str_replace($title, "", $line_complete);
$line_complete = strip_tags($line_complete);
$line_complete = trim($line_complete);
$line_complete = trim(substr($line_complete, 0, 400));
echo "<li><b><a href=\"$file_n\">
";
if (isset($title))
echo "$title</a></b> <font size=\"-1\">- <i>$file_n</i></font>";
else
echo "$file_n</a></b>";
echo "<br>$line_complete...\n<br> ";
}
else {
// ???????????????????????
echo "<a href=\"$file_n\"><b>???????????????????????</b> </a>| a ";
}
}