Add author name in RSS stream
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 7 Nov 2006 13:45:08 +0000 (13:45 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 7 Nov 2006 13:45:08 +0000 (13:45 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1056 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
modules/platal.php
templates/rss.tpl

index 486523a..f4b7de1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@ New:
     * Carnet:
         - Add a vcard of all the contacts                                  -FRU
 
+    * Events:
+        - Add author in RSS                                                -FRU
+
     * Xnet:
         - Add a vcard of all the members of a group                        -FRU
 
index 7d72369..dff65ce 100644 (file)
@@ -401,10 +401,12 @@ Mail envoy
         $uid = init_rss('rss.tpl', $user, $hash);
 
         $rss = XDB::iterator(
-                'SELECT  e.id, e.titre, e.texte, e.creation_date
+                '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) )
+                                                 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 5fe92ba..91fb54b 100644 (file)
@@ -37,6 +37,7 @@
       <title>{$line.titre|strip_tags}</title>
       <link>{#globals.baseurl#}/events#newsid{$line.id}</link>
       <description><![CDATA[{$line.texte|nl2br}]]></description>
+      <author>{$line.prenom} {$line.nom} (X{$line.promo})</author>
       <pubDate>{$line.creation_date|rss_date}</pubDate>
     </item>
     {/iterate}