From 1e64fee86b4f923e041310cfcef186de14e5af42 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Mon, 29 Nov 2004 21:42:07 +0000 Subject: [PATCH] more work on lists archives. see http://dev.m4x.org/~x2000habouzit/listes/archives.php?liste=foofoo --- htdocs/listes/archives.php | 18 +++++++++++++++--- install.d/lists/platal.mrc | 10 +++++++++- templates/listes/archives.tpl | 30 +++++++++++++++++++++++++++++- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/htdocs/listes/archives.php b/htdocs/listes/archives.php index 2f5116b..1ae5176 100644 --- a/htdocs/listes/archives.php +++ b/htdocs/listes/archives.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: archives.php,v 1.1 2004-11-28 22:51:28 x2000habouzit Exp $ + $Id: archives.php,v 1.2 2004-11-29 21:42:07 x2000habouzit Exp $ ***************************************************************************/ if(empty($_REQUEST['liste'])) header('Location: index.php'); @@ -31,8 +31,20 @@ require_once('xml-rpc-client.inc.php'); $client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org"); if (list($det) = $client->get_members($liste)) { - $file = isset($_GET['file']) ? $_GET['file'] : "dates.html"; - $page->assign('url', $globals->lists->spool."/polytechnique.org-$liste/$file"); + if (isset($_GET['file'])) { + $file = $_GET['file']; + $rep = $_GET['rep']; + $page->assign('url', $globals->lists->spool."/polytechnique.org-$liste/$rep/$file"); + } else { + $archs = Array(); + foreach (glob($globals->lists->spool."/polytechnique.org-$liste/*/*") as $rep) { + if (preg_match(",/(\d*)/(\d*)$,", $rep, $matches)) { + $archs[intval($matches[1])][intval($matches[2])] = true; + } + } + $page->assign('archs', $archs); + $page->assign('range', range(1,12)); + } } else $page->assign('no_list',true); diff --git a/install.d/lists/platal.mrc b/install.d/lists/platal.mrc index 6dc287c..8446a93 100644 --- a/install.d/lists/platal.mrc +++ b/install.d/lists/platal.mrc @@ -36,7 +36,12 @@ m2h_text_plain::filter; fancyquote maxwidth=80 quoteclass=quote MY-LINK -?liste={$$smarty.request.liste}&file= +?liste={$$smarty.request.liste}&rep={$$smarty.request.rep}&file= + + + +TOP-ARCH +

[toutes les archives]

@@ -163,6 +168,7 @@ MY-SUBJNA

Vue de message

+ $TOP-ARCH$ @@ -266,6 +272,7 @@ subject:strong

Archives de la liste {$$smarty.request.liste} ($PAGENUM$/$NUMOFPAGES$)

+ $TOP-ARCH$
fil précédent
@@ -442,6 +449,7 @@ date

Archives de la liste {$$smarty.request.liste} ($PAGENUM$/$NUMOFPAGES$)

+ $TOP-ARCH$
 
diff --git a/templates/listes/archives.tpl b/templates/listes/archives.tpl index e78faab..99f98de 100644 --- a/templates/listes/archives.tpl +++ b/templates/listes/archives.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: archives.tpl,v 1.1 2004-11-28 22:51:29 x2000habouzit Exp $ + $Id: archives.tpl,v 1.2 2004-11-29 21:42:08 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -30,7 +30,35 @@ {include file="listes/header_listes.tpl" on=archives} + +{if $archs} +

Archives de la liste {$smarty.request.liste}

+
 
+ + + + + {foreach from=$archs item=m key=y} + + + {foreach from=$range item=i} + + {if $i eq 6}{/if} + {/foreach} + + {/foreach} +
Année + Mois +
{$y} + {if $m[$i]} + [{"0000-$i-01"|date_format:"%b"}] + {else} + [   ] + {/if} +
+{elseif $url} {include file="$url"} +{/if} {/if} -- 2.1.4