Hi Jeff,

Some more mods to take care of monthly searching (which is currently
broken), and a couple of other suggested fixes.  I've attached patches for
the following (I've diff'd these with the latest source you sent me - let
me know if you want the full versions):

monthme:

I think it lost the ESCAPED_NAME variable somewhere when it was
externalised, which is why the searching wasn't working and it wasn't
incorporating your html for the results page.  I've also added all the
search options I can that htDig allows, so that complex searching can be
done.  Oh, and my "restrict" HTML code was broken, now fixed, so searching
by month should work.  It's still not very pretty, but it works, feel free
to make it look nicer.  Finally, I've added some rather inelegant code to
create links in the master directory to the "latest" indexes - I think
these will be necessary to give list managers a canonical URL which they
can reference which will go to the latest messages at any time - many users
will want to bookmark this I've found in the past.  I'm sure it can be done
in a neater way but I can't think how just now.

digger:

Very minor modification to cope with htDig indexing monthly lists.  I
didn't know htDig before I started this and I have to say I'm not impressed
with the configuration options: you can't include wildcards or "and"
clauses where you might want to ("limit_urls_to") as far as I can see, and
can't include string lists (only strings) where they would be really useful
("noindex_start") - the latter would mean you could use
automatically-generated MHonarc HTML tags to exclude parts of the generated
pages, but it won't let you.  To make sure htDig doesn't index irrelevant
information from index pages, I've also included a modified:

rcfile:

which extends your own use of the <!--htdig_noindex--> tag to the index
pages too - otherwise no other changes in there.

I've had to add the above to my own rcfiles, so again I'll send you them in
a separate mail.  Sorry about the changes, these are to reflect the above
in my own files, and also some other fixes.

Finally Michael said:

> Have you considered also allowing a way to change archives
> when an archive accumulates a certain number of messages?  

I'm sure Jeff's thought about this and I did too a little: the main problem
seemed to me that a simple decision based on something like this might not
actually be appropriate for lots of lists, e.g. imagine a list that's been
going for 5 years and crosses the threshold but actually only has a handful
of messages per month -> loads of nearly empty indexes and a list manager
asking "why??".  I suspect a human would choose to go to monthly indexes
when (say) more than half the months had more than 20 (or 30 or 50)
messages, which does increase the complexity (and therefore breakability)
of Jeff's rather neat and simple code.  So I left anything like that out
for now.

Paul
--- ../bin/monthme.jeff Sat Sep  4 17:44:09 1999
+++ monthme     Sat Sep  4 20:01:51 1999
@@ -41,9 +41,18 @@
 CTRAIL=$CONFDIR/trailer-monthly.html
 [ -f $CHEAD ] && cat $CHEAD >> $MONTHINDEX
 
+MAILLIST=$(echo $MAILLIST | awk '{ print tolower($1) }')
+ESCAPED_NAME=$(echo $MAILLIST | tr '@.' '__')
+
 # Start off the page
 cat >> $MONTHINDEX <<EOF
-Monthly index for <strong>$NICKNAME</strong> mailing list:
+<h2>Monthly index for the $NICKNAME mailing list</h2>
+<a name="months">
+<a href="latest-maillist.html">Latest Messages by Date</a>
+<br>
+<a href="latest-index.html">Latest Messages by Thread</a>
+<p>
+<strong>By month:</strong>
 <ul>
 EOF
 
@@ -59,13 +68,43 @@
 # End month list and start search section
 cat >> $MONTHINDEX <<EOF
 </ul>
+<h2>Search $NICKNAME</h2>
+<a name="search">
 <FORM ACTION="/cgi-bin/htsearch" METHOD=GET>
 <INPUT TYPE="text"     NAME="words"   VALUE="" size=35>
 <INPUT TYPE="submit"   VALUE="Search">
-<BR>
-<INPUT TYPE="checkbox" NAME="restricttofiles" VALUE="on">
-Restrict matched files
-<SELECT NAME="filelist" SIZE=3 MULTIPLE>
+<p>
+<strong>Search options:</strong>
+<p>
+<table><tr><td>
+Match: <select name=method>
+<option value=and selected>All
+<option value=or>Any
+<option value=boolean>Boolean
+</select>
+</td><td>
+Format: <select name=format>
+<option value="builtin-long">Long
+<option value="builtin-short">Short
+</select>
+</td><td>
+Sort by: <select name=sort>
+<option value="score">Score
+<option value="date">Date
+<option value="title">Name
+</select>
+</td></tr>
+<tr><td>
+Results per page: <select name=matchesperpage>
+<option value=10 selected>10
+<option value=20>20
+<option value=50>50
+<option value=100>100
+</select>
+</td><td>
+Restrict search to months:
+</td><td>
+<select name=restrict size=3 multiple>
 EOF
 
 # Optional button for searching within each month
@@ -75,11 +114,9 @@
 
 # Finish off search section
 cat >> $MONTHINDEX <<EOF
-<BR>
 </SELECT>
-<INPUT TYPE="hidden"   NAME="restrict" VALUE="filelist">
-<INPUT TYPE="hidden"   NAME="method"  VALUE="and">
-<INPUT TYPE="hidden"   NAME="format"  VALUE="short">
+</td></tr>
+</table>
 <INPUT TYPE="hidden"   NAME="config"  VALUE="$ESCAPED_NAME">
 <INPUT TYPE="hidden"   NAME="exclude" VALUE="">
 </FORM>
@@ -90,4 +127,11 @@
 ln -s $HOME/archive/$MAILLIST/maillist.html \
 $HOME/archive/$MAILLIST/index.html
 
-
+# Create link to latest indexes
+# Note: not "this month" - might be no messages yet.
+LATESTM=`/bin/ls -d1p $HOME/archive/$MAILLIST/* | grep '\/$' \
+         | sort -nr | head -1`
+rm -f $HOME/archive/$MAILLIST/latest-maillist.html
+rm -f $HOME/archive/$MAILLIST/latest-index.html
+ln -s $LATESTM/maillist.html $HOME/archive/$MAILLIST/latest-maillist.html
+ln -s $LATESTM/index.html $HOME/archive/$MAILLIST/latest-index.html
--- ../bin/digger.jeff  Sun Aug 29 19:26:14 1999
+++ digger      Sat Sep  4 19:05:45 1999
@@ -87,7 +87,10 @@
     echo "nothing_found_file:     $CONF/nomatch.html"        >> $CFG
     echo "search_results_wrapper: $CONF/wrapper.html"        >> $CFG
 
-    echo "limit_urls_to:        $TARGET/$MAILLIST/msg"       >> $CFG
+#PSM start
+#    echo "limit_urls_to:        $TARGET/$MAILLIST/msg"       >> $CFG
+    echo "limit_urls_to:        $TARGET/$MAILLIST"           >> $CFG
+#PSM end
     echo "exclude_urls:         .dir"                        >> $CFG
     echo "max_head_length:      10000"                       >> $CFG
     echo "remove_bad_urls:      true"                        >> $CFG
--- ../conf/rcfile.jeff Sat Sep  4 20:16:06 1999
+++ rcfile      Sat Sep  4 19:08:22 1999
@@ -234,6 +234,7 @@
 <META NAME="robots" CONTENT="noindex">
 </HEAD>
 <BODY>
+<!--htdig_noindex-->
 <center>
 <a href="../index.html"><img border=0 src="../logo.gif" alt="Mail Archive"></a>
 </center>
@@ -250,6 +251,12 @@
 </center>
 </IdxPgBegin>
 
+<IdxPgEnd>
+<!--/htdig_noindex-->
+</BODY>
+</HTML>
+</IdxPgEnd>
+
 <!-- Describes what a message entry on the chronological -->
 <!-- index page will look like. Currently displays the   -->
 <!-- subect, and poster's name/date for each message.    -->
@@ -284,6 +291,7 @@
 <META NAME="robots" CONTENT="noindex">
 </HEAD>
 <BODY>
+<!--htdig_noindex-->
 <center>
 <a href="../index.html"><img border=0 src="../logo.gif" alt="Mail Archive"></a>
 </center>
@@ -300,6 +308,12 @@
 </center>
 </TIdxPgBegin>
 
+<TIdxPgEnd>
+<!--/htdig_noindex-->
+</BODY>
+</HTML>
+</TIdxPgEnd>
+
 <!-- Our little navigational tool that goes on top -->
 <!-- of thread index pages.                        -->
 
@@ -310,9 +324,15 @@
 <TD><ul><A HREF="$IDXFNAME$">Date Index</A> $TPREVPGLINK$$TNEXTPGLINK$
 <TD><strong>$IDXTITLE$</strong>
 </TABLE>
+<!--/htdig_noindex-->
 <HR><ul>
 </thead>
 
+<tfoot>
+</ul>
+<!--htdig_noindex-->
+</tfoot>
+
 <!-- This is a navigational tool that goes on the top -->
 <!-- of our chronological index pages. It seems to be -->
 <!-- the chronological equivalent of thead            -->
@@ -324,8 +344,15 @@
 <TD><ul><A HREF="$TIDXFNAME$">Thread Index</A> $PREVPGLINK$$NEXTPGLINK$
 <TD><strong>$IDXTITLE$</strong>
 </TABLE>
+<!--/htdig_noindex-->
 <HR><ul>
 </ListBegin>
+
+<ListEnd>
+</ul>
+<!--htdig_noindex-->
+</ListEnd>
+
 
 <!-- On index pages, we want to replace the default        -->
 <!-- [next page] [previous page] links with something      -->

Reply via email to