if (search ~ /^@/) {
numfound++
}
if (numfound == 0) {
- print "Your search did not match any items in the Archive." >>output
- print "Try different keywords or a more general search." >>output
- print "" >>output
- printf "[1|PHAROS|%s|%s|%s]\n", cgipath, server, port >>output
- cache_end()
+ print "Your search did not match any items in the Archive."
+ print "Try different keywords or a more general search."
+ print ""
+ printf "[1|PHAROS|%s|%s|%s]\n", cgipath, server, port
unlink(jsout)
unlink(iaout)
return
} else {
pages = int(numfound / rows)
if (numfound % rows != 0) {
pages++
}
printf "# %s search results, page %d of %d\n", numfound,
- page, pages >>output
- print "" >>output
+ page, pages
+ print ""
}
# format search results as a gopher directory (menu)
FS = "\t"
creator = ""
@@ -146,11 +135,11 @@
type = ""
count = 0
if (search ~ /^@/) {
printf "[1|Account %s|%s/account/%s|%s|%s]\n", search, cgipath,
- search, server, port >>output
+ search, server, port
}
while ((getline <jsout) > 0) {
if ($1 == ".response.docs[].creator" && $2 == "s") {
creator = $3
@@ -171,54 +160,53 @@
label = sprintf("[%s] %s", mediatype[type],
gph_encode(shorten(title, 58)))
}
if (type == "collection") {
printf "[1|%s|%s/search/%%09collection:(%s)|%s|%s]\n",
- label, cgipath, id, server, port >>output
+ label, cgipath, id, server, port
} else {
printf "[1|%s|%s/details/%s|%s|%s]\n", label, cgipath,
- id, server, port >>output
+ id, server, port
}
creator = ""
descr = ""
id = ""
type = ""
}
}
close(jsout)
- print "" >>output
+ print ""
# only show "page back" if the user is past page 1
if (page > 1) {
printf "[1|[<<] Page %d|%s/search/page%d/rows%d/%s%%09%s|%s|%s]\n",
page - 1, cgipath, page - 1, rows, sort_param, search,
- server, port >>output
+ server, port
}
# only show "next page" if the current page is completely full
if (count == rows) {
printf "[1|[>>] Page %d|%s/search/page%d/rows%d/%s%%09%s|%s|%s]\n",
page + 1, cgipath, page + 1, rows, sort_param, search,
- server, port >>output
+ server, port
}
# only show "sort" if there's more than one item to sort
if (count > 1) {
printf "[1|[^v] Sort|%s/sort/%%09%s|%s|%s]\n", cgipath, search,
- server, port >>output
+ server, port
}
# only show "search within list" if there's multiple pages of results
if (numfound > rows) {
printf "[1|[\\/] Filter results|%s/wizard/step1/%s|%s|%s]\n",
- cgipath, search, server, port >>output
+ cgipath, search, server, port
}
- printf "[1|PHAROS|%s|%s|%s]\n", cgipath, server, port >>output
+ printf "[1|PHAROS|%s|%s|%s]\n", cgipath, server, port