diff includes/class.post.php @ 33:c6508503269a

Possibilité d'avoir les dates en ISO 8601, requis par Atom.
author Franck Deroche <webmaster@defr.org>
date Mon, 05 Nov 2007 09:23:40 +0100
parents 4cea8b128fdd
children ec0c926a78a6
line wrap: on
line diff
--- a/includes/class.post.php	Mon Nov 05 09:06:46 2007 +0100
+++ b/includes/class.post.php	Mon Nov 05 09:23:40 2007 +0100
@@ -3,7 +3,7 @@
   private $tpl;
   private $infos;
   private $mess;
-  private $dateFormatee;
+  private $dateFormatee = array();
   private $url;
   private $commentLabel;
   private $mood;
@@ -25,7 +25,8 @@
     
     // Formatage de la date
     $time = strtotime($infos['DatePost']);
-    $this->dateFormatee = strftime("%A %d %B %Y, %Hh%M", $time);
+    $this->dateFormatee['human'] = strftime("%A %d %B %Y, %Hh%M", $time);
+    $this->dateFormatee['iso']   = date("c", $time);
     
     // On détermine l'url de ce post
     $strippedTitle = TextUtils::StripTitle($infos['Titre']);
@@ -74,7 +75,8 @@
     $params = array(
         '#post@class' => 'PostContent ' . $this->infos->Emot,
         'postTitle' => $this->infos->Titre,
-        'postDate' => $this->dateFormatee,
+        'postDate' => $this->dateFormatee['human'],
+        'postDateISO' => $this->dateFormatee['iso'],
         'postContent' => $this->mess,
         'postNumber' => $this->infos->num_mess,
         'postComments' => $this->commentLabel,