From c7a49513204dc2234690a4526a3892979dea429d Mon Sep 17 00:00:00 2001
From: rich
Date: Tue, 2 Nov 2004 19:21:17 +0000
Subject: [PATCH] Better searching from the 404 page. If no results, offer a
link to Google search.
---
scripts/search.ml | 4 +++-
templates/page_404.html | 5 ++---
templates/search.html | 1 +
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/scripts/search.ml b/scripts/search.ml
index 0ee9f2e..2b2e8b9 100644
--- a/scripts/search.ml
+++ b/scripts/search.ml
@@ -1,7 +1,7 @@
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones .
* Copyright (C) 2004 Merjis Ltd.
- * $Id: search.ml,v 1.6 2004/11/02 18:47:54 rich Exp $
+ * $Id: search.ml,v 1.7 2004/11/02 19:21:17 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,6 +35,8 @@ let split_words = Pcre.regexp "\\W+"
let run r (q : cgi) (dbh : Dbi.connection) hostid host user =
let template = get_template dbh hostid "search.html" in
+ template#set "canonical_hostname" host.canonical_hostname;
+
(* Get the query, if it exists. *)
let query = try q#param "q" with Not_found -> "" in
let have_query = not (string_is_whitespace query) in
diff --git a/templates/page_404.html b/templates/page_404.html
index 2d55a9e..8f3c0c0 100644
--- a/templates/page_404.html
+++ b/templates/page_404.html
@@ -15,10 +15,9 @@
Search our site for this page:
-
diff --git a/templates/search.html b/templates/search.html
index 1d1167c..7fae64b 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -74,6 +74,7 @@ Some tips for finding what you want:
::end::
--
1.8.3.1