GetUser()) { $max = $user['changescount']; } else { $max = 50; } if ($comments = $this->LoadRecentComments($max)) { if (!($link = $this->GetParameter('link'))) $link = $this->GetConfigValue('root_page'); if (!($format = $this->GetParameter('format'))) $format = 'rss1.0'; // Création de la sortie pour le contenu xml $output = ''."\n"; // En-tête du contenu xml switch ($format) { case 'rss1.0' : $output .= ''."\n"; $output .= 'Href('', $link).'">'."\n"; $output .= 'Derniers commentaires sur '.$this->GetConfigValue('wakka_name').''."\n"; $output .= ''.$this->Href('', $link).''."\n"; $output .= 'Derniers commentaires sur '.$this->GetConfigValue('wakka_name').''."\n"; $output .= "\n\n"; break; case 'rss2.0' : $output .= ''."\n"; $output .= ''."\n"; $output .= ''."\n"; $output .= 'Derniers commentaires sur '.$this->GetConfigValue('wakka_name').''."\n"; $output .= ''.$this->Href('', $link).''."\n"; $output .= 'Derniers commentaires sur '.$this->GetConfigValue('wakka_name').''."\n"; break; } // Corps du contenu XML $items = ''; foreach ($comments as $i => $comment) { list($day, $time) = explode(' ', $comment['time']); $day = preg_replace('/-/', ' ', $day); list($hh,$mm,$ss) = explode(':', $time); $itemurl = $this->Href('', $comment['comment_on'], 'show_comments=1#'.$comment['tag']); switch ($format) { case 'rss1.0' : $output .= ''; $items .= ''."\n"; $items .= 'Commentaire '.$comment['tag'].' - page '.$comment['comment_on'].' --- par '.$comment['user'].' le '.$day.' - '.$hh.':'.$mm.''."\n"; $items .= ''.'Modification du commentaire '.$comment['tag'].' sur la page '.$comment['comment_on'].' --- par '.$comment['user'].' le '.$day.' - '.$hh.':'.$mm.''."\n"; $items .= ''.$itemurl.''."\n"; $items .= ''."\n"; break; case 'rss2.0' : $output .= ''."\n"; $output .= 'Commentaire '.$comment['tag'].' - page '.$comment['comment_on'].' --- par '.$comment['user'].' le '.$day.' - '.$hh.':'.$mm.''."\n"; $output .= ''.$itemurl.''."\n"; $output .= ''.$itemurl.''."\n"; $output .= ''.htmlentities($this->Format($comment['body'])).''."\n"; $output .= ''.htmlentities($this->Format($comment['body'])).''."\n"; $output .= ''."\n"; break; } } //Pied du contenu XML switch ($format) { case 'rss1.0' : $output .= "\n\n\n"; $output .= $items . "\n"; break; case 'rss2.0' : $output .= ''."\n"; $output .= ''."\n"; break; } echo $output; } ?>