Fix RSS encoding, add a disclaimer for xnet announces...
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 12 Dec 2006 21:41:43 +0000 (21:41 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 12 Dec 2006 21:41:43 +0000 (21:41 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1270 839d8a87-29fc-0310-9880-83ba4fa771e5

include/rss.inc.php
modules/events.php
modules/platal.php
modules/xnetgrp.php
plugins/modifier.date_format.php
templates/login.tpl
templates/xnet/groupe/asso.tpl

index 42ffb49..ba6c2f3 100644 (file)
@@ -31,7 +31,7 @@ function _rss_encode_date($d) {
 function to_rss ($s)
 {
     if(is_string($s)) {
-        return utf8_encode($s);
+        return iconv('ISO_8859-15', 'UTF8', $s);
     } else {
         return $s;
     }
index d1e55cc..d584060 100644 (file)
@@ -25,6 +25,7 @@ class EventsModule extends PLModule
     {
         return array(
             'events'         => $this->make_hook('ev',        AUTH_COOKIE),
+            'rss'            => $this->make_hook('rss', AUTH_PUBLIC),
             'send_bug'       => $this->make_hook('bug', AUTH_COOKIE),
             'events/submit'  => $this->make_hook('ev_submit', AUTH_MDP),
             'admin/events'   => $this->make_hook('admin_events',     AUTH_MDP, 'admin'),
@@ -178,6 +179,24 @@ class EventsModule extends PLModule
                      );
     }
 
+    function handler_rss(&$page, $user = null, $hash = null)
+    {       
+        require_once 'rss.inc.php';
+            
+        $uid = init_rss('rss.tpl', $user, $hash);
+            
+        $rss = XDB::iterator(
+                'SELECT  e.id, e.titre, e.texte, e.creation_date,
+                         IF(u2.nom_usage = "", u2.nom, u2.nom_usage) AS nom, u2.prenom, u2.promo
+                   FROM  auth_user_md5   AS u
+             INNER JOIN  evenements      AS e ON ( (e.promo_min = 0 || e.promo_min <= u.promo)
+                                                 AND (e.promo_max = 0 || e.promo_max >= u.promo) )
+             INNER JOIN  auth_user_md5   AS u2 ON (u2.user_id = e.user_id)
+                  WHERE  u.user_id = {?} AND FIND_IN_SET(e.flags, "valide")
+                                         AND peremption >= NOW()', $uid);
+        $page->assign('rss', $rss);
+    }   
+
     function handler_ev_submit(&$page)
     {
         $page->changeTpl('evenements.tpl');
@@ -190,7 +209,7 @@ class EventsModule extends PLModule
         $valid_mesg = Post::v('valid_mesg');
         $action     = Post::v('action');
 
-        if ($promo_min > $promo_max ||
+        if (($promo_min > $promo_max && $promo_max != 0)||
             ($promo_min != 0 && ($promo_min <= 1900 || $promo_min >= 2020)) ||
             ($promo_max != 0 && ($promo_max <= 1900 || $promo_max >= 2020)))
         {
index d6a7841..586b485 100644 (file)
@@ -56,9 +56,6 @@ class PlatalModule extends PLModule
             'recovery'      => $this->make_hook('recovery',  AUTH_PUBLIC),
             'exit'          => $this->make_hook('exit', AUTH_PUBLIC),
             'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC),
-
-            // happenings related thingies
-            'rss'         => $this->make_hook('rss',       AUTH_PUBLIC),
         );
     }
 
@@ -389,24 +386,6 @@ Mail envoy
             $page->changeTpl('exit.tpl');
         }
     }
-
-    function handler_rss(&$page, $user = null, $hash = null)
-    {
-        require_once 'rss.inc.php';
-
-        $uid = init_rss('rss.tpl', $user, $hash);
-
-        $rss = XDB::iterator(
-                'SELECT  e.id, e.titre, e.texte, e.creation_date,
-                         IF(u2.nom_usage = "", u2.nom, u2.nom_usage) AS nom, u2.prenom, u2.promo
-                   FROM  auth_user_md5   AS u
-             INNER JOIN  evenements      AS e ON ( (e.promo_min = 0 || e.promo_min <= u.promo)
-                                                 AND (e.promo_max = 0 || e.promo_max >= u.promo) )
-             INNER JOIN  auth_user_md5   AS u2 ON (u2.user_id = e.user_id)
-                  WHERE  u.user_id = {?} AND FIND_IN_SET(e.flags, "valide")
-                                         AND peremption >= NOW()', $uid);
-        $page->assign('rss', $rss);
-    }
 }
 
 ?>
index a629907..51662f1 100644 (file)
@@ -983,7 +983,7 @@ class XnetGrpModule extends PLModule
             }
 
             if (!$art['public'] &&
-                ($art['promo_min'] > $art['promo_max'] ||
+                (($art['promo_min'] > $art['promo_max'] && $art['promo_max'] != 0) ||
                  ($art['promo_min'] != 0 && ($art['promo_min'] <= 1900 || $art['promo_min'] >= 2020)) ||
                  ($art['promo_max'] != 0 && ($art['promo_max'] <= 1900 || $art['promo_max'] >= 2020))))
             {
index 78b6d24..a0b22b0 100644 (file)
@@ -27,6 +27,8 @@ function smarty_modifier_date_format($string, $format = '%x', $default_date=null
 
     if (preg_match('/^\d{14}$/', $d)) {
         $t = mktime(substr($d,8,2), substr($d,10,2), substr($d,12,2), substr($d,4,2), substr($d,6,2), substr($d,0,4));
+    } elseif (preg_match('/^\d{8}$/', $d)) {
+        $t = mktime(0, 0, 0, substr($d,4,2), substr($d,6,2), substr($d,0,4));
     } elseif (is_numeric($d)) {
         $t = intval($d);
     } else {
index 927d2c7..a4c67ca 100644 (file)
@@ -147,8 +147,8 @@ Bienvenue {$smarty.session.prenom}
   interprétée comme polémique par un membre de la communauté polytechnicienne.
   </p>
 
-  <p>
-  <a href="events/submit">Proposer une information événementielle</a>
+  <p class="center">
+  <a href="events/submit">{icon name=add}Proposer une information événementielle</a>
   </p>
 {/if}
 
index 5d60856..6e2767d 100644 (file)
     </td>
   </tr>
   {/iterate}
+  {if $is_admin}
+  <tr class="pair">
+    <td class="center">
+      <a href="{$platal->ns}announce/new">{icon name=add} Ajouter une annonce</a>
+    </td>
+  </tr>
+  {/if}
 </table>
-{/if}
 
 <br />
 
 <br />
 {/iterate}
 </div>
-{/if}
 
-{if $is_admin}
+<p style="text-align: justify;">
+<small>
+<em>Nota Bene :</em> les informations présentées ici n'engagent que leurs auteurs
+respectifs et sont publiées à leur initiative. L'association Polytechnique.org
+ne pourrait en aucun cas être tenue responsable de la nature des propos relatés
+sur cet espace d'expression et d'information. Elle se réserve le droit de
+refuser ou de retirer toute information de nature diffamante ou pouvant être
+interprétée comme polémique par un membre de la communauté polytechnicienne.
+</small>
+</p>
+{/if}
+{elseif $is_admin}
 <div class="center">
-  [<a href="{$platal->ns}announce/new">Ajouter une annonce</a>]
+  [<a href="{$platal->ns}announce/new">{icon name=add} Ajouter une annonce</a>]
 </div>
 {/if}