Some minor updates to the site and search API.

This commit is contained in:
Darren 'Tadgy' Austin 2024-08-03 17:42:04 +01:00
commit 1428652b84
5 changed files with 86 additions and 4 deletions

View file

@ -76,8 +76,15 @@
/* Read the results and turn into urls */
$count = 0;
while ($result_line = stream_get_line ($fh, 0, "\n")) {
print ("&bull; <a href=\"https://slackware.uk$result_line\" title=\"$result_line\">$result_line</a><br>");
$count++;
$type = strtok ($result_line, " ");
$entry = strtok ("\n");
if ($type == "f" || $type == "l" || $type == "o") {
print ("&bull; <a href=\"$entry\" title=\"View $entry\">$entry</a><br>");
$count++;
} elseif ($type == "d") {
print ("&bull; <a href=\"$entry\" title=\"Directory $entry\">$entry</a>&nbsp;(<a href=\"/search?l=$_GET[l]&p=$entry&q=" . str_replace (" ", "+", $_GET[q]) . "\" title=\"Repeat search in this directory\">Repeat search in this directory</a>)<br>");
$count++;
}
}
/* Output a total */
if ($count == 0) {