website/search.php

60 lines
1.8 KiB
PHP
Raw Normal View History

2000-07-08 04:06:04 +00:00
<?
switch ($type_of_search) {
case "news":
$string = AddSlashes ($words);
include "old_news.php";
break;
2000-07-08 04:13:02 +00:00
case "-cvs":
$string = urlencode ($words);
header ("Location: http://www.geocrawler.com/search/?config=899&words=$string");
break;
case "-devel":
2000-07-08 04:06:04 +00:00
$string = urlencode ($words);
header ("Location: http://www.geocrawler.com/search/?config=856&words=$string");
break;
2000-07-08 04:13:02 +00:00
case "-user":
2000-07-08 04:06:04 +00:00
$string = urlencode ($words);
header ("Location: http://www.geocrawler.com/search/?config=898&words=$string");
break;
case "site":
$pageName = "Search Results";
$focused = "none"; // Dock icon name to get a border
include "parts/preamble.php"; // Load most of document
// Start actual search
$lib = dblist ();
$dbm = dbmopen ("siteindex.db","r");
if (dbmexists ($dbm, $string)) {
$parseMe = dbmfetch($dbm, $string);
}
dbmclose ($dbm);
if ($parseMe) {
echo $parseMe;
$filenames = preg_split("/&&/", $parseMe);
for ($i = 0;$i < sizeof($filenames);$i++) {
$temp = $filenames[$i];
if ($files[$temp]) {
$files[$temp]++;
2000-06-18 20:40:55 +00:00
} else {
2000-07-08 04:06:04 +00:00
$files[$temp] = 0;
}
2000-06-18 20:40:55 +00:00
}
2000-07-08 04:06:04 +00:00
while (list($key,$val) = each ($files)) {
echo "<P><A HREF=\"$key\">$key</A> - $val hits";
}
} else {
echo "<P>Sorry, no pages found containing '$words'";
2000-06-18 20:32:14 +00:00
}
2000-07-08 04:06:04 +00:00
include "parts/postamble.php"; // Finish this sucker up
break;
default:
$pageName = "Search Results";
$focused = "none"; // Dock icon name to gets a border
include "parts/preamble.php"; // Load most of document
?><P>That type of search isn't supported yet. Please check back later.<?
include "parts/postamble.php"; // Finish this sucker up
break;
}
2000-06-16 05:24:11 +00:00
?>