Commit 19ff170f authored by Leigh Stoller's avatar Leigh Stoller

Now that the documentation links all point to the wiki, change the

search function to redirect over to the wiki. Note that all of the KB
entries are stored in the Wiki now.

There is a new defs variable called $REMOTEWIKIDOCS that currently
defaults to on. When on, documentation and search goto to emulab.net,
but when off, they go to local docs that will be unpacked in
/usr/testbed/www/wikidocs on the remote boss. Searches also stay
local, and the swish config has been updated to reflect that change.
parent 5f5e74bb
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
#
# Standard Testbed Header
#
PAGEHEADER("Search Emulab Documentation");
#
# Verify page arguments.
#
$optargs = OptionalPageArguments("submit", PAGEARG_STRING,
"query", PAGEARG_STRING);
#
# Utah now stores its documentation in a Trac wiki. The Utah web site
# and web sites that link to Utahs documentation will use the Trac
# search engine at Utah. Optionally, if you have the docs locally
# in html format, continue to use the swish search tools on it. Note that
# the knowledge base in the DB is also deprecated; all of that content
# was pushed into the wiki.
#
#
# We no longer support an advanced search option. We might bring it back
......@@ -23,7 +26,6 @@ $optargs = OptionalPageArguments("submit", PAGEARG_STRING,
#
function SPITSEARCHFORM($query)
{
echo "<table align=center border=1>
<form action=search.php3 method=get>\n";
......@@ -49,6 +51,17 @@ function SPITSEARCHFORM($query)
</table><br>\n";
}
if ($TBMAINSITE || $REMOTEWIKIDOCS) {
$query = htmlspecialchars($query);
header("Location: $WIKIDOCURL/search?q=$query&noquickjump=1&wiki=on");
return;
}
#
# Standard Testbed Header after possible redirect above.
#
PAGEHEADER("Search Emulab Documentation");
if (!isset($query) || $query == "") {
SPITSEARCHFORM("");
PAGEFOOTER();
......@@ -87,13 +100,6 @@ register_shutdown_function("CLEANUP");
SPITSEARCHFORM($query);
flush();
#
# First the Knowledge Base
#
$embedded = 1;
$query_type = "and";
$query_which = "both";
include("kb-search.php3");
$safe_query = escapeshellarg($query);
echo "<br>\n";
......
IndexFile @prefix@/www/site.index
IndexDir @prefix@/www
IndexDir @prefix@/www/wikidocs/wiki
ReplaceRules remove @prefix@/www/
DefaultContents TXT
IndexContents HTML .htm .html
IndexContents TXT .txt .text
# Don't index any directories of these directories
FileRules dirname contains /webglimpse
FileRules dirname contains /images
FileRules dirname contains /thumbs
FileRules dirname contains /dev/
FileRules dirname contains /downloads
FileRules dirname contains /distributions
FileRules dirname contains /bugtrack
FileRules dirname contains /netlab
# Sigh, special case. Sorry.
FileMatch filename contains xmlrpcapi.php3 client.php3 mobilewireless.php3 elabinelab.php3 software.php3
# But only index the .html files
IndexOnly .html
FileRules dirname contains /attachments
FileRules dirname contains /chrome
# Show basic info while indexing
IndexReport 1
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -139,16 +139,7 @@ if (@order) {
}
foreach my $hit (@order) {
my ($rank, $path, $size, $mod) = @{ $hits{$hit} };
$dir = dirname($path);
$file = basename($path);
my $url;
if ($file =~ /^.*(\.php\d{0,1})$/) {
$url = $path;
}
else {
$url = "$dir/docwrapper.php3?docname=$file";
}
my $url = $path;
print "<hr>\n";
print "<li> $rank - <b><a href=$url>$path</a></b>, $mod<br>\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment