httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject svn commit: r325924 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c
Date Mon, 17 Oct 2005 16:47:09 GMT
Author: jerenkrantz
Date: Mon Oct 17 09:47:06 2005
New Revision: 325924

URL: http://svn.apache.org/viewcvs?rev=325924&view=rev
Log:
* module-2.0/mod_mbox_out.c: Output a better title for monthly pages; wish we
  could add the list name here too, but don't see how to do so easily.

Modified:
    httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c

Modified: httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c?rev=325924&r1=325923&r2=325924&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c Mon Oct 17 09:47:06 2005
@@ -678,11 +678,14 @@
     Container *threads = NULL, *c;
 
     int current_page = 0;  /* Current page number, starting at 0 */
-    int pages;             /* Ttotal number of pages */
+    int pages;             /* Total number of pages */
     int count = 0;         /* Message count */
     int i = 0;
 
     char *baseURI;
+    char *filename;
+    char *month;
+    char *year;
 
     conf = ap_get_module_config(r->per_dir_config, &mbox_module);
     baseURI = get_base_uri(r);
@@ -722,6 +725,20 @@
     r->mtime = fi.mtime;
     ap_set_last_modified(r);
 
+    /* Determine the month and year of the list, if we can. */
+    filename = strrchr(r->filename, '/');
+    if (filename &&
+        apr_fnmatch("[0-9][0-9][0-9][0-9][0-9][0-9].mbox", filename + 1, 0)
+            == APR_SUCCESS) {
+        month = mbox_months[atoi(apr_pstrndup(r->pool, baseURI +
+            (strlen(baseURI) - strlen(".mbox") - 2), 2)) - 1][1];
+        year = baseURI + (strlen(baseURI) - strlen(".mbox") - 6);
+    }
+    else {
+        month = "";
+        year = "";
+    }
+
     /* Send page header */
     ap_rputs("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", r);
     ap_rputs("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n", r);
@@ -731,10 +748,11 @@
     ap_rputs(" <head>\n", r);
     ap_rputs("  <meta http-equiv=\"Content-Type\" "
 	     "content=\"text/html; charset=utf-8\" />\n", r);
-    ap_rputs("  <title>Mailing list archives</title>\n", r);
+    ap_rprintf(r, "  <title>Mailing list archives: %s %.4s</title>\n",
+               month, year);
 
     if (conf->style_path) {
-        ap_rprintf(r, "   <link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n",
+        ap_rprintf(r, "  <link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n",
 		   conf->style_path);
     }
 
@@ -742,10 +760,7 @@
     ap_rputs(" <body id=\"archives\">\n", r);
 
     ap_rprintf(r, "  <h1>Mailing list archives: %s %.4s</h1>\n\n",
-	       mbox_months[atoi(apr_pstrndup(r->pool, baseURI +
-					     (strlen(baseURI) -
-					      strlen(".mbox") - 2), 2)) - 1][1],
-	       baseURI + (strlen(baseURI) - strlen(".mbox") - 6));
+               month, year);
 
     ap_rputs("  <h5>\n", r);
 



Mime
View raw message