# HG changeset patch # User Franck Deroche # Date 1194251020 -3600 # Node ID c6508503269aefec7cf055684960a296cde3014c # Parent 4cea8b128fdd5a96ba440ba9ceab4b1b74ca68a2 Possibilité d'avoir les dates en ISO 8601, requis par Atom. diff -r 4cea8b128fdd -r c6508503269a comment.php --- a/comment.php Mon Nov 05 09:06:46 2007 +0100 +++ b/comment.php Mon Nov 05 09:23:40 2007 +0100 @@ -49,6 +49,7 @@ while(0 !== ($row = $Data->GetRow())) { $commentTpl = new Template(Skeleton::getTemplateFile('comment')); $dateFormatee = strftime(" à %Hh%M le %A %d %B %Y", strtotime($row['DateComment'])); + $dateFormateeISO = date('c', strtotime($row['DateComment'])); $AdresseMail = $row['AdresseMail']; $grav_id = md5($AdresseMail); $grav_url = 'http://www.gravatar.com/avatar.php?gravatar_id=' . $grav_id . '&size=50&default=' . $defaultGravatar; @@ -62,6 +63,7 @@ '#auteur@name' => 'c' . $row['num_comm'], '#auteur' => $row['Auteur'], 'commentDate' => $dateFormatee, + 'commentDateISO' => $dateFormateeISO, 'commentNumber' => $row['num_comm'], 'comment' => $commentFrag, ); diff -r 4cea8b128fdd -r c6508503269a includes/class.post.php --- 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, diff -r 4cea8b128fdd -r c6508503269a templates/commentAtom.xml --- a/templates/commentAtom.xml Mon Nov 05 09:06:46 2007 +0100 +++ b/templates/commentAtom.xml Mon Nov 05 09:23:40 2007 +0100 @@ -10,7 +10,7 @@ - - + + diff -r 4cea8b128fdd -r c6508503269a templates/postAtom.xml --- a/templates/postAtom.xml Mon Nov 05 09:06:46 2007 +0100 +++ b/templates/postAtom.xml Mon Nov 05 09:23:40 2007 +0100 @@ -11,7 +11,7 @@ - - + +