[m-dev.] for review: make w3 search pages consistent

Peter Ross petdr at cs.mu.OZ.AU
Mon Dec 6 18:23:12 AEDT 1999


Hi,

Tyson could you review this please.

===================================================================


Estimated hours taken: 3

Make the htdig search pages come out in the same format as the rest of
the web site.

w3/Makefile:
    Add the directory htdig to the list of processed directories.

w3/bin/divide:
    A new script which divides a file into seperate sections according
    to the first argument.

w3/htdig/Makefile:
    Generate all the pages.
    
w3/htdig/header_and_footer.php3:
w3/htdig/include/header_and_footer.inc:
    Generate the header and footer for returning the search results.

w3/htdig/nomatch.php3:
w3/htdig/include/nomatch.inc:
    No matching pages found.

w3/htdig/syntax.php3:
w3/htdig/include/syntax.inc:
    Syntax error.

w3/htdig/wrapper.php3:
w3/htdig/include/wrapper.inc:
    Not sure what this file does, just copied it from /etc/htdig
    directory on hydra.

w3/mailing-lists/Makefile:
w3/mailing-lists/include/message.inc:
w3/mailing-lists/include/message_list.inc:
    Use the new divide script.

Index: Makefile
===================================================================
RCS file: /home/staff/zs/imp/w3/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	1999/11/04 04:04:31	1.10
+++ Makefile	1999/12/06 07:00:00
@@ -14,7 +14,7 @@
 	contributions.html	\
 	search.html
 
-DIRS=contact download information mailing-lists tutorial
+DIRS=contact download htdig information mailing-lists tutorial
 ROOT=.
 
 #-----------------------------------------------------------------------------#
Index: bin/divide
===================================================================
RCS file: divide
diff -N divide
--- /dev/null	Wed May 28 10:49:58 1997
+++ divide	Mon Dec  6 18:15:08 1999
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+#
+# divide <string> <filenames>
+#
+# Every time <string> is encountered on stdin, the next lines read in
+# will be output to the next file in <filenames>
+
+$divide_string = $ARGV[0];
+$i = 1;
+
+$switch = "no";
+
+open(OUTPUT, ">$ARGV[$i]") or die "Can't open file: $!";
+
+while (<STDIN>) {
+	if ($_ =~ /$divide_string/) {
+		$switch = "yes";
+	}
+
+	if ($switch eq "no") {
+		print OUTPUT $_
+	}
+    else {
+        $switch = "no";
+        $i = $i + 1;
+	open(OUTPUT, ">$ARGV[$i]") or die "Can't open file: $!";
+    }
+}
Index: htdig/Makefile
===================================================================
RCS file: Makefile
diff -N Makefile
--- /dev/null	Wed May 28 10:49:58 1997
+++ Makefile	Mon Dec  6 17:59:33 1999
@@ -0,0 +1,28 @@
+target: html
+
+HTML= 	header_and_footer.html		\
+	nomatch.html			\
+	syntax.html			\
+	wrapper.html
+
+DIRS=	
+ROOT=..
+
+include ../Makefile.common
+
+html: header.inc footer.inc
+
+install: local_install
+
+clean: local_clean
+
+header.inc footer.inc: header_and_footer.html
+	$(ROOT)/bin/divide "---- cut here ----" header.inc footer.inc < \
+		header_and_footer.html
+
+local_install:
+	cp -af header.inc footer.inc $(INSTALL_WEBDIR)/
+
+local_clean:
+	rm -f header.inc footer.inc
+
Index: htdig/header_and_footer.php3
===================================================================
RCS file: header_and_footer.php3
diff -N header_and_footer.php3
--- /dev/null	Wed May 28 10:49:58 1997
+++ header_and_footer.php3	Mon Dec  6 17:30:30 1999
@@ -0,0 +1,9 @@
+<HTML>
+<?
+    $title="Search results for '$(WORDS)'";
+    $dir="htdig";
+    $root="..";
+    $include="header_and_footer.inc";
+    include "$root/include/template.inc"
+?>
+</HTML>
Index: htdig/nomatch.php3
===================================================================
RCS file: nomatch.php3
diff -N nomatch.php3
--- /dev/null	Wed May 28 10:49:58 1997
+++ nomatch.php3	Mon Dec  6 16:55:47 1999
@@ -0,0 +1,9 @@
+<HTML>
+<?
+    $title="No match for '$(LOGICAL_WORDS)'";
+    $dir="htdig";
+    $root="..";
+    $include="nomatch.inc";
+    include "$root/include/template.inc"
+?>
+</HTML>
Index: htdig/syntax.php3
===================================================================
RCS file: syntax.php3
diff -N syntax.php3
--- /dev/null	Wed May 28 10:49:58 1997
+++ syntax.php3	Mon Dec  6 16:58:38 1999
@@ -0,0 +1,9 @@
+<HTML>
+<?
+    $title="Error in Boolean search for '$(WORDS)'";
+    $dir="htdig";
+    $root="..";
+    $include="syntax.inc";
+    include "$root/include/template.inc"
+?>
+</HTML>
Index: htdig/wrapper.php3
===================================================================
RCS file: wrapper.php3
diff -N wrapper.php3
--- /dev/null	Wed May 28 10:49:58 1997
+++ wrapper.php3	Mon Dec  6 17:04:01 1999
@@ -0,0 +1,9 @@
+<HTML>
+<?
+    $title="Search results for '$(WORDS)'";
+    $dir="htdig";
+    $root="..";
+    $include="wrapper.inc";
+    include "$root/include/template.inc"
+?>
+</HTML>
Index: htdig/include/header_and_footer.inc
===================================================================
RCS file: header_and_footer.inc
diff -N header_and_footer.inc
--- /dev/null	Wed May 28 10:49:58 1997
+++ header_and_footer.inc	Mon Dec  6 17:54:57 1999
@@ -0,0 +1,26 @@
+<b>Documents $(FIRSTDISPLAYED) - $(LASTDISPLAYED) of $(MATCHES) matches.
+More <img src="/doc/htdig/images/star.gif" alt="*">'s indicate a better match.
+</b>
+<hr noshade size=1>
+---- cut here ----
+$(PAGEHEADER)
+$(PREVPAGE) $(PAGELIST) $(NEXTPAGE)
+<hr noshade size=4>
+<form method="get" action="$(CGI)">
+<font size=-1>
+<input type=hidden name=config value=$(CONFIG)>
+<input type=hidden name=restrict value="$(RESTRICT)">
+<input type=hidden name=exclude value="$(EXCLUDE)">
+Match: $(METHOD)
+Format: $(FORMAT)
+Sort by: $(SORT)
+<br>
+Refine search:
+<input type="text" size="30" name="words" value="$(WORDS)">
+<input type="submit" value="Search">
+</select>
+</font>
+</form>
+<hr noshade size=4>
+<a href="http://www.htdig.org">
+<img src="/doc/htdig/images/htdig.gif" border=0>ht://Dig $(VERSION)</a>
Index: htdig/include/nomatch.inc
===================================================================
RCS file: nomatch.inc
diff -N nomatch.inc
--- /dev/null	Wed May 28 10:49:58 1997
+++ nomatch.inc	Mon Dec  6 17:55:02 1999
@@ -0,0 +1,31 @@
+<h2>No matches were found for '$(LOGICAL_WORDS)'</h2>
+<p>
+Check the spelling of the search word(s) you used.
+If the spelling is correct and you only used one word,
+try using one or more similar search words with "<b>Any</b>."
+</p><p>
+If the spelling is correct and you used more than one
+word with "<b>Any</b>," try using one or more similar search
+words with "<b>Any</b>."</p><p>
+If the spelling is correct and you used more than one
+word with "<b>All</b>," try using one or more of the same words
+with "<b>Any</b>."</p>
+<hr noshade size=4>
+<form method="get" action="$(CGI)">
+<font size=-1>
+<input type=hidden name=config value=$(CONFIG)>
+<input type=hidden name=restrict value="$(RESTRICT)">
+<input type=hidden name=exclude value="$(EXCLUDE)">
+Match: $(METHOD)
+Format: $(FORMAT)
+Sort by: $(SORT)
+<br>
+Refine search:
+<input type="text" size="30" name="words" value="$(WORDS)">
+<input type="submit" value="Search">
+</select>
+</font>
+</form>
+<hr noshade size=4>
+<a href="http://www.htdig.org/">
+<img src="/doc/htdig/images/htdig.gif" border=0>ht://Dig $(VERSION)</a>
Index: htdig/include/syntax.inc
===================================================================
RCS file: syntax.inc
diff -N syntax.inc
--- /dev/null	Wed May 28 10:49:58 1997
+++ syntax.inc	Mon Dec  6 17:55:05 1999
@@ -0,0 +1,28 @@
+Boolean expressions need to be 'correct' in order for the search
+system to use them.
+The expression you entered has errors in it.<p>
+Examples of correct expressions are: <b>cat and dog</b>, <b>cat
+not dog</b>, <b>cat or (dog not nose)</b>.<br>Note that
+the operator <b>not</b> has the meaning of 'without'.
+<blockquote><b>
+$(SYNTAXERROR)
+</b></blockquote>
+<hr noshade size=4>
+<form method="get" action="$(CGI)">
+<font size=-1>
+<input type=hidden name=config value=$(CONFIG)>
+<input type=hidden name=restrict value="$(RESTRICT)">
+<input type=hidden name=exclude value="$(EXCLUDE)">
+Match: $(METHOD)
+Format: $(FORMAT)
+Sort: $(SORT)
+<br>
+Refine search:
+<input type="text" size="30" name="words" value="$(WORDS)">
+<input type="submit" value="Search">
+</select>
+</font>
+</form>
+<hr noshade size=4>
+<a href="http://www.htdig.org/">
+<img src="/doc/htdig/images/htdig.gif" border=0>ht://Dig $(VERSION)</a>
Index: htdig/include/wrapper.inc
===================================================================
RCS file: wrapper.inc
diff -N wrapper.inc
--- /dev/null	Wed May 28 10:49:58 1997
+++ wrapper.inc	Mon Dec  6 17:54:52 1999
@@ -0,0 +1,26 @@
+<form method="get" action="$(CGI)">
+<font size=-1>
+<input type=hidden name=config value=$(CONFIG)>
+<input type=hidden name=restrict value="$(RESTRICT)">
+<input type=hidden name=exclude value="$(EXCLUDE)">
+Match: $(METHOD)
+Format: $(FORMAT)
+Sort by: $(SORT)
+<br>
+Refine search:
+<input type="text" size="30" name="words" value="$(WORDS)">
+<input type="submit" value="Search">
+</select>
+</font>
+</form>
+<hr noshade size=1>
+<b>Documents $(FIRSTDISPLAYED) - $(LASTDISPLAYED) of $(MATCHES) matches.
+More <img src="/doc/htdig/images/star.gif" alt="*">'s indicate a better match.
+</b>
+<hr noshade size=1>
+$(HTSEARCH_RESULTS)
+$(PAGEHEADER)
+$(PREVPAGE) $(PAGELIST) $(NEXTPAGE)
+<hr noshade size=4>
+<a href="http://www.htdig.org">
+<img src="/doc/htdig/images/htdig.gif" border=0>ht://Dig $(VERSION)</a>
Index: mailing-lists/Makefile
===================================================================
RCS file: /home/staff/zs/imp/w3/mailing-lists/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	1999/03/25 03:52:51	1.7
+++ Makefile	1999/12/06 07:05:26
@@ -8,26 +8,19 @@
 
 local_html: msglist_header.inc msg_header.inc msglist_footer.inc msg_footer.inc
 
-msglist_header.inc: message_list.html
+msglist_header.inc msglist_footer.inc: message_list.html
 	echo "May need to rearchive the hypermail archive"
-	cat message_list.html | sed -e 's/\%\"/\%\%\"/g' | \
-		sed -e 's/\.\./\.\.\/\.\.\/\.\./g' |	\
-		tac | tail +7 | tac > msglist_header.inc
+	$(ROOT)/bin/divide "--- Cut here ---" msglist_header.inc \
+			msglist_footer.inc < message_list.html
 
-msglist_footer.inc: message_list.html
-	cat message_list.html | sed -e 's/\%\"/\%\%\"/g' | \
-		sed -e 's/\.\./\.\.\/\.\.\/\.\./g' | \
-		tail -6 > msglist_footer.inc
-
-msg_header.inc: message.html
+msg_header.inc msg_footer.inc: message.html
 	echo "May need to rearchive the hypermail archive"
-	cat message.html | sed -e 's/\%\"/\%\%\"/g' | \
-		sed -e 's/\.\./\.\.\/\.\.\/\.\./g' |	\
-		tac | tail +7 | tac > msg_header.inc
+	$(ROOT)/bin/divide "--- Cut here ---" msg_header.inc \
+			msg_footer.inc < message.html
+
+clean: local_clean
 
-msg_footer.inc: message.html
-	cat message.html | sed -e 's/\%\"/\%\%\"/g' | \
-		sed -e 's/\.\./\.\.\/\.\.\/\.\./g' | \
-		tail -6 > msg_footer.inc
+local_clean:
+	rm -f msglist_header.inc msglist_footer.inc msg_header.inc msg_footer.inc
 
 include ../Makefile.common
Index: mailing-lists/include/message.inc
===================================================================
RCS file: /home/staff/zs/imp/w3/mailing-lists/include/message.inc,v
retrieving revision 1.1
diff -u -r1.1 message.inc
--- message.inc	1999/03/25 03:53:01	1.1
+++ message.inc	1999/12/06 07:01:51
@@ -0,0 +1 @@
+--- Cut here ---
Index: mailing-lists/include/message_list.inc
===================================================================
RCS file: /home/staff/zs/imp/w3/mailing-lists/include/message_list.inc,v
retrieving revision 1.1
diff -u -r1.1 message_list.inc
--- message_list.inc	1999/03/25 03:53:02	1.1
+++ message_list.inc	1999/12/06 07:02:14
@@ -0,0 +1 @@
+--- Cut here ---

----
 +----------------------------------------------------------------------+
 | Peter Ross      M Sci/Eng Melbourne Uni                              |
 | petdr at cs.mu.oz.au  WWW: www.cs.mu.oz.au/~petdr/ ph: +61 3 9344 9158  |
 +----------------------------------------------------------------------+
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list