mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-27 22:42:57 +00:00
trying out some search stuff...
This commit is contained in:
parent
67272c30a1
commit
6f7442a010
2 changed files with 25 additions and 1 deletions
|
@ -73,6 +73,7 @@
|
|||
'<FORM action="search.php" method="POST">' .
|
||||
' <SELECT name="type_of_search">' .
|
||||
' <OPTION value="news">News</OPTION>' .
|
||||
' <OPTION value="site">Site</OPTION>' .
|
||||
' <OPTION value="bugs">Bug Tracking</OPTION>' .
|
||||
' <OPTION value="lists">Mailing Lists</OPTION>' .
|
||||
' <OPTION value="patches">Patches</OPTION>' .
|
||||
|
|
25
search.php
25
search.php
|
@ -1,8 +1,31 @@
|
|||
<?php
|
||||
if ($type_of_search == "news") {
|
||||
$string = $words;
|
||||
$string = AddSlashes($words);
|
||||
include("old_news.php");
|
||||
}
|
||||
elseif ($type_of_search == "site") {
|
||||
$pageName = "Search Results";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
// Start actual search
|
||||
$dbm = dbmopen("siteindex.db","r");
|
||||
if (dbmexists($dbm, $string)) {
|
||||
$parseMe = dbmfetch($dbm, $string);
|
||||
}
|
||||
dbmclose($dbm);
|
||||
$filenames = preg_split("/&&/", $parseMe);
|
||||
for ($i = 0;$i < sizeof($filenames);$i++) {
|
||||
$temp = $filenames[$i];
|
||||
if ($files[$temp]) {
|
||||
$files[$temp]++;
|
||||
} else {
|
||||
$files[$temp] = 0;
|
||||
}
|
||||
}
|
||||
while (list($key,$val) = each ($files)) {
|
||||
echo "<P><A HREF=\"$key\">$key</A> - $val hits";
|
||||
}
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
else {
|
||||
// Preamble
|
||||
$pageName = "Search Results";
|
||||
|
|
Loading…
Reference in a new issue