From fcc45ed78b2de0e3a519c4313a173eed21414883 Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Mon, 17 Jan 2005 09:28:40 +0000 Subject: [PATCH] add pubDates, that rocks git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-371 --- include/rss.inc.php | 9 +++++++-- templates/carnet/rss.tpl | 17 ++++++++++++----- templates/rss.tpl | 1 + 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/include/rss.inc.php b/include/rss.inc.php index 96ad35b..bda7c26 100644 --- a/include/rss.inc.php +++ b/include/rss.inc.php @@ -19,8 +19,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -function _rss_encode_date($s) { - return date('r', strtotime($s)); +function _rss_encode_date($d) { + 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)); + } else { + $t = strtotime($d); + } + return date('r', $t); } function to_rss ($s) diff --git a/templates/carnet/rss.tpl b/templates/carnet/rss.tpl index 81d3230..3ba28d0 100644 --- a/templates/carnet/rss.tpl +++ b/templates/carnet/rss.tpl @@ -31,15 +31,22 @@ {foreach from=$notifs->_data item=c key=cid} {foreach from=$c item=promo} - {section name=row loop=$promo} + {foreach from=$promo item=x} - [{$notifs->_cats[$cid].short}] {$promo[row].prenom} {$promo[row].nom} (le {$promo[row].date|date_format}) + [{$notifs->_cats[$cid].short}] {$x.prenom} {$x.nom} ({$x.promo}) - le {$x.date|date_format} - {#globals.baseurl#}/fiche.php?user={$promo[row].bestalias} - {$promo[row]->known|rss_date} + {#globals.baseurl#}/fiche.php?user={$x.bestalias} + + ajouter à mes contacts + + {/if} + ]]> + {$x->known|rss_date} - {/section} + {/foreach} {/foreach} {/foreach} diff --git a/templates/rss.tpl b/templates/rss.tpl index 6604455..a36161e 100644 --- a/templates/rss.tpl +++ b/templates/rss.tpl @@ -34,6 +34,7 @@ {$line.titre|strip_tags} {#globals.baseurl#}/login.php#newsid{$line.id} + {$line.creation_date|rss_date} {/iterate} -- 2.1.4