# HG changeset patch # User Franck Deroche # Date 1194248809 -3600 # Node ID fa43c43763a2310abba1df1f609dcb0b7d8230a1 # Parent 750613da68ec7c947036ba0cb3e214dc6814f9f9 Attribution correcte des urls des commentaires, petit refactoring des posts On a maintenant une fonction séparée sur les posts permettant d'obtenir les différentes informations sur les posts, ce qui peut s'avérer utile si on veut les ré-utiliser par exemple sur les différents commentaires. diff -r 750613da68ec -r fa43c43763a2 comment.php --- a/comment.php Thu Nov 01 17:44:43 2007 +0100 +++ b/comment.php Mon Nov 05 08:46:49 2007 +0100 @@ -58,7 +58,7 @@ $commentFrag->appendXML($Comment); $params = array( '#gravatar@src' => $grav_url, - '#auteur@href' => 'TODO', + '#auteur@href' => $post->getURL() . '#c' . $row['num_comm'], '#auteur@name' => 'c' . $row['num_comm'], '#auteur' => $row['Auteur'], 'commentDate' => $dateFormatee, diff -r 750613da68ec -r fa43c43763a2 includes/class.post.php --- a/includes/class.post.php Thu Nov 01 17:44:43 2007 +0100 +++ b/includes/class.post.php Mon Nov 05 08:46:49 2007 +0100 @@ -67,6 +67,11 @@ } public function format() { + $this->tpl->setParams($this->getTplParams()); + return $this->tpl; + } + + public function getTplParams() { $params = array( '#post@class' => 'PostContent ' . $this->infos->Emot, 'postTitle' => $this->infos->Titre, @@ -83,8 +88,11 @@ $params['#mood@alt'] = $this->mood->alt; $params['#mood@class'] = 'mood'; } - $this->tpl->setParams($params); - return $this->tpl; + return $params; + } + + public function getURL() { + return $this->url; } } ?>