* 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');
$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);
<DefineVar>
MY-LINK
-?liste={$$smarty.request.liste}&file=
+?liste={$$smarty.request.liste}&rep={$$smarty.request.rep}&file=
+</DefineVar>
+
+<DefineVar>
+TOP-ARCH
+<p>[<a href="?liste={$$smarty.request.liste}">toutes les archives</a>]</p>
</DefineVar>
<DefineVar>
<TopLinks>
<h1>Vue de message</h1>
+ $TOP-ARCH$
<table class='bicol' cellpadding="0" cellspacing="0">
<tr>
<th>fil précédent</th>
<THead>
<h1>Archives de la liste {$$smarty.request.liste} ($PAGENUM$/$NUMOFPAGES$)</h1>
+ $TOP-ARCH$
<table class='bicol' cellpadding="0" cellspacing="0">
<tr>
<th> </th>
<ListBegin>
<h1>Archives de la liste {$$smarty.request.liste} ($PAGENUM$/$NUMOFPAGES$)</h1>
+ $TOP-ARCH$
<table class='bicol' cellpadding="0" cellspacing="0">
<tr>
<th> </th>
* 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}
{include file="listes/header_listes.tpl" on=archives}
+
+{if $archs}
+<h1>Archives de la liste {$smarty.request.liste}</h1>
+<table class="tinybicol" cellspacing="0" cellpadding="0">
+ <tr>
+ <th>Année</th>
+ <th colspan="6">
+ Mois
+ </th>
+ </tr>
+ {foreach from=$archs item=m key=y}
+ <tr class="center">
+ <td class="titre" rowspan="2">{$y}</td>
+ {foreach from=$range item=i}
+ <td>
+ {if $m[$i]}
+ [<a href="?liste={$smarty.request.liste}&rep={$y}/{$i|string_format:"%02u"}&file=dates.html">{"0000-$i-01"|date_format:"%b"}</a>]
+ {else}
+ [ ]
+ {/if}
+ </td>
+ {if $i eq 6}</tr><tr class="center">{/if}
+ {/foreach}
+ </tr>
+ {/foreach}
+</table>
+{elseif $url}
{include file="$url"}
+{/if}
{/if}