make use of tidy everywhere, BEWARE OF THE FACT THAT YOU HAVE TO DO :
authorx2000habouzit <x2000habouzit>
Tue, 30 Nov 2004 09:34:51 +0000 (09:34 +0000)
committerx2000habouzit <x2000habouzit>
Tue, 30 Nov 2004 09:34:51 +0000 (09:34 +0000)
apt-get install libtidy-dev php4-dev
pear install tidy

as root to make it work (done on jam.)

beware2 : with that, you will have a tidy.so in the /usr/lib/php/modules (or sth like that) that is not packaged ...
If I have some time, I'll do some local pacakge for that.

include/conf.d/lists.globals.inc.php
include/xorg/smarty.plugins.inc.php
install.d/lists/platal.mrc
plugins/block.tidy.php [new file with mode: 0644]
templates/listes/archives.tpl
templates/login.tpl

index d796709..54b4156 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-    $Id: lists.globals.inc.php,v 1.1 2004-11-28 22:51:28 x2000habouzit Exp $
+    $Id: lists.globals.inc.php,v 1.2 2004-11-30 09:34:51 x2000habouzit Exp $
  ***************************************************************************/
 
 // {{{ class ListsConfig
@@ -28,7 +28,7 @@ class ListsConfig
     var $rpchost  = 'localhost';
     var $rpcport  = 119;
     
-    var $spool    = '***';
+    var $spool    = '/var/spool/platal/archives/';
 }
 
 // }}}
index 0053dce..fb7d096 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-    $Id: smarty.plugins.inc.php,v 1.3 2004-11-24 10:12:47 x2000habouzit Exp $
+    $Id: smarty.plugins.inc.php,v 1.4 2004-11-30 09:34:52 x2000habouzit Exp $
  ***************************************************************************/
 
 // {{{ function block_dynamic()
@@ -129,6 +129,5 @@ function at_to_globals($tpl_source, &$smarty)
 }
 
 // }}}
-
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 ?>
index 85d1373..dfadc57 100644 (file)
@@ -5,7 +5,7 @@
 %d-%m-%y
 </MsgLocalDateFmt>
 <IdxSize>
-25
+50
 </IdxSize>
 <NoFolRefs>
 
@@ -121,7 +121,7 @@ MY-SUBJNA
 </TPrevInButton>
 
 <TPrevInButtonIA>
-<img src="/images/lists_previa.png" />
+<img src="/images/lists_previa.png" alt="précedent" />
 </TPrevInButtonIA>
 
 <TNextInButton>
@@ -350,6 +350,7 @@ subject:strong
 <!-- ------------------------------------------------------------------------ -->
 
 <TSingleTxt>
+<tr class="pair"><td colspan="3" class="center"> - - - </td></tr>
 <tr>
   <td>$MSGLOCALDATE$</td>
   <td class='subj' style="padding-left: $TLEVEL$em">$MY-SUBJ$</td>
diff --git a/plugins/block.tidy.php b/plugins/block.tidy.php
new file mode 100644 (file)
index 0000000..655485e
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************
+        $Id: block.tidy.php,v 1.1 2004-11-30 09:34:54 x2000habouzit Exp $
+ ***************************************************************************/
+
+$tidy_on = Array(
+    'drop-empty-paras',
+    'drop-font-tags',
+    'drop-proprietary-attributes',
+    'hide-comments',
+    'logical-emphasis',
+    'output-xhtml',
+    'replace-color',
+    'show-body-only'
+);
+$tidy_off = Array(
+    'clean',
+    'join-styles',
+    'join-classes'
+);
+
+foreach($tidy_on as $opt) { tidy_setopt($opt, true); }
+foreach($tidy_off as $opt) { tidy_setopt($opt, false); }
+tidy_setopt('alt-text', '[ inserted by TIDY ]');
+tidy_setopt('wrap', '120');
+unset($tidy_o, $tydy_off);
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * File:     block.min_perms.php
+ * Type:     block
+ * Name:     min_perms
+ * Purpose:  
+ * -------------------------------------------------------------
+ */
+function smarty_block_tidy($params, $content, &$smarty)
+{
+    return tidy_repair_string($content);
+}
+
+?>
index 99f98de..7ebe61c 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: archives.tpl,v 1.2 2004-11-29 21:42:08 x2000habouzit Exp $
+        $Id: archives.tpl,v 1.3 2004-11-30 09:34:55 x2000habouzit Exp $
  ***************************************************************************}
 
 {dynamic}
 
 {if $archs}
 <h1>Archives de la liste {$smarty.request.liste}</h1>
+
+<h2>Triés par fils de discussion</h2>
+
+<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}&amp;rep={$y}/{$i|string_format:"%02u"}&amp;file=threads.html">{"0000-$i-01"|date_format:"%b"}</a>]
+      {else}
+      [&nbsp;&nbsp;&nbsp;]
+      {/if}
+    </td>
+    {if $i eq 6}</tr><tr class="center">{/if}
+    {/foreach}
+  </tr>
+  {/foreach}
+</table>
+
+<h2>Triés par date</h2>
+
 <table class="tinybicol" cellspacing="0" cellpadding="0">
   <tr>
     <th>Année</th>
@@ -57,7 +86,9 @@
   {/foreach}
 </table>
 {elseif $url}
+{tidy}
 {include file="$url"}
+{/tidy}
 {/if}
 
 {/if}
index c9fcfd5..845bcf1 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: login.tpl,v 1.14 2004-11-13 15:56:35 x2000habouzit Exp $
+        $Id: login.tpl,v 1.15 2004-11-30 09:34:54 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -89,7 +89,9 @@
     </tr>
     <tr class="{cycle values="impair,pair"}">
       <td class="half">
+        {tidy}
         {$ev.texte|smarty:nodefaults|nl2br}
+        {/tidy}
         <br />
         <p class="smaller">Annonce proposée par
         <a href="{"fiche.php"|url}?user={$ev.forlife}" class="popup2">