pour inverser les archives des news | Titre du sujet : pour inverser les archives des news par babouille sur 22/11/2005 09:05:17
Si vous allez dans les archives de vos news et que vous cliquez sur un mois, il se passe que c'est les mois qui apparaissent avant le mois demandé en archive. Et quand votre site tourne depuis un bout de temps cela risque de faire long. Pour inverser j'ai juste réecrit le mtemplate new_archive.html:
<table width="100%" cellspacing="0" cellpadding="4" style="border: #cccccc 1px solid">
<tr>
<td>
<{if $show_articles == true}>
<table width="100%" cellspacing="0" cellpadding="4" style="border: #e0e0e0 1px solid;" align="center">
<tr class="info">
<td style="border-right: #e0e0e0 1px solid; border-bottom: #e0e0e0 1px solid;"><b><{$lang_articles}></b></td><td align="center" style="border-right: #e0e0e0 1px solid; border-bottom: #e0e0e0 1px solid;"><b><{$lang_actions}></b></td><td align="center" style="border-right: #e0e0e0 1px solid; border-bottom: #e0e0e0 1px solid;"><b><{$lang_views}></b></td><td align="center" style="border-bottom: #e0e0e0 1px solid;"><b><{$lang_date}></b></td>
</tr>
<{foreach item=story from=$stories}>
<tr>
<td align="left" style="border-right: #e0e0e0 1px dashed; border-bottom: #e0e0e0 1px dashed;"><{$story.title}></td><td align="center" style="border-right: #e0e0e0 1px dashed; border-bottom: #e0e0e0 1px dashed;"><a href="<{$story.print_link}>"><img src="images/print.gif" alt="<{$lang_printer}>" /></a> <a target="_top" href="<{$story.mail_link}>" /><img src="images/friend.gif" alt="<{$lang_sendstory}>" /></a></td><td align="center" style="border-right: #e0e0e0 1px dashed; border-bottom: #e0e0e0 1px dashed;"><{$story.counter}></td><td align="center" style="border-bottom: #e0e0e0 1px dashed;"><{$story.date}></td>
</tr>
<{/foreach}>
<tr>
<td colspan="4"><{$lang_storytotal}></td>
</tr>
</table>
<{/if}>
<table width="95%" cellspacing="0" cellpadding="0">
<tr>
<td style="border-bottom: #cccccc 1px dashed;"><b><span style="font-size: 17px;"><{$lang_newsarchives}></span></b></td>
</tr>
<tr>
<td> </td>
</tr>
<{foreach item=year from=$years}>
<{foreach item=month from=$year.months}>
<tr>
<td> <img src="images/size.gif" alt="" /> <a href="./archive.php?year=<{$year.number}>&month=<{$month.number}>"><{$month.string}> <{$year.number}></td>
</tr>
<{/foreach}>
<{/foreach}>
</table>
</td></tr></table>
en espérant que cela foncitonne pour tous
PS: Merci à Suede sur WRI pour ce conseil
|
|