error()) { exit; } # Création de l'objet de type weblog avec uniquement les articles # publiés $blog = new xblog($con,DB_PREFIX,1,dc_encoding); $blog->rs_blogpost = 'xblogpost'; $blog->rs_blogcomment = 'xblogcomment'; $blog->setURL('post','http://'.$_SERVER['SERVER_NAME'].dc_blog_url.dc_format_post_url); # Si type = co on fait un fil des commentaires if ($type == 'co') { if (!empty($_GET['post'])) { $comments = $blog->getComments($_GET['post'],'DESC'); } else { $comments = $blog->getComments('','DESC',20); } $title = dc_blog_name.' - Commentaires'; $ts = time(); $items = $seq = ''; if (!$comments->isEmpty()) { $ts = $comments->getTS(); while(!$comments->EOF()) { $seq .= $comments->getRSSSeq(); $items .= $comments->getRSSItem(); $comments->moveNext(); } } } else { # Dernières nouvelles $news = $blog->getLastNews(10,$cat); $ts = strtotime($blog->getEarlierDate()); $title = dc_blog_name; $items = $seq = ''; while(!$news->EOF()) { $items .= $news->getRSSItem(); $seq .= $news->getRSSSeq(); $news->moveNext(); } } # Fermeture de connexion $con->close(); # Cache HTTP if (dc_http_cache && defined('DC_UPDATE_FILE_W') && DC_UPDATE_FILE_W) { $mod_files = get_included_files(); $mod_files[] = DC_UPDATE_FILE; $mod_files[] = dirname(__FILE__).'/conf/dotclear.ini'; cache::http($mod_files); } header('Content-Type: text/xml; charset='.dc_encoding); echo ''."\n"; ?> <? echo $blog->toXML($title); ?> ]]> daily 1