diff -Nru comback-1.4/ChangeLog comback-new/ChangeLog --- comback-1.4/ChangeLog 2007-08-14 22:51:23.000000000 +0200 +++ comback-new/ChangeLog 2007-08-18 10:46:40.000000000 +0200 @@ -1,3 +1,6 @@ +2007-08-18 : Version 1.4.1 +* Fil Atom chronologique, global ou pour un post + 2007-08-14 : Version 1.4 * Fil RSS chronologique, global ou pour un post diff -Nru comback-1.4/feed.php comback-new/feed.php --- comback-1.4/feed.php 1970-01-01 01:00:00.000000000 +0100 +++ comback-new/feed.php 2007-08-18 10:40:38.000000000 +0200 @@ -0,0 +1,199 @@ +error()) { exit; } + +# Création de l'objet de type weblog avec uniquement les billets +# publiés +$blog = new xblog($con,DB_PREFIX,1,dc_encoding); +$blog->rs_blogpost = 'xblogpost'; +$blog->rs_blogcomment = 'xblogcomment'; + +$blog->setURL('post',util::getHost().dc_blog_url.dc_format_post_url); + +# Si 'post' est vide on fait le fil des comms et combacks de tout le blog +$reqPlus = empty($post) ? '' : "AND p.post_id=$post"; + +# Récupération des combacks et des commentaires +#--- +# On renomme les champs de dc_comback avec le nom de ceux de dc_comments afin +# de pouvoir utiliser les méthodes de la classe xblogcomment +$t_comback = DB_PREFIX.'comback'; +$t_comment = $blog->t_comment; +$t_post = $blog->t_post; +$t_user = $blog->t_user; + +$strReq = << 1 +AND comment_pub <> 0 +AND p.post_id = C.post_id +$reqPlus +ORDER BY comment_dt DESC LIMIT $limit +EOT; + +$comments = $blog->con->select($strReq,$blog->rs_blogcomment); +if ($comments) { + $comments->setBlog($blog); + } +#--- + +$title = dc_blog_name.' - Commentaires & réponses'; +$ts = time(); +$items = $seq = ''; + +if ($type == 'atom') { + + header('Content-Type: application/atom+xml; charset='.dc_encoding); + echo ''."\n"; + /* + echo ''."\n"; + //*/ + ?> + + <?php echo $blog->toXML($title); ?> + + + + + + getAtomID(dc_blog_url); ?> + + + DotClear + + daily + 1 + + + EOF()) { + echo $comments->getAtomEntry(dc_short_feeds); + $comments->moveNext(); + } + # Fermeture de connexion + $con->close(); + ?> + + +isEmpty()) { + $ts = $comments->getTS(); + # On parcourt les commentaires + while(!$comments->EOF()) { + # On met le comm dans le fil + $seq .= $comments->getRSSSeq(); + $items .= $comments->getRSSItem(dc_short_feeds); + $comments->moveNext(); + } + } + + # Fermeture de connexion + $con->close(); + + header('Content-Type: application/rss+xml; charset='.dc_encoding); + echo ''."\n"; + ?> + + + + <?php echo $blog->toXML($title); ?> + ]]> + + + + + + + + daily + 1 + + + + + + + + + + + + + + diff -Nru comback-1.4/functions.php comback-new/functions.php --- comback-1.4/functions.php 2007-08-14 23:08:09.000000000 +0200 +++ comback-new/functions.php 2007-08-18 10:54:07.000000000 +0200 @@ -94,7 +94,14 @@ # Lien vers le fil RSS des réponses + combacks function rss($post_id = '') { - echo dc_app_url.'/'.DC_ECRIRE.'/tools/comback/rss.php?type=cb'.(empty($post_id)?'':"&post=$post_id"); + echo dc_app_url.'/share/comback/feed.php?type=rss'.(empty($post_id)?'':"&post=$post_id"); + return true; + } + + # Lien vers le fil Atom des réponses + combacks + function atom($post_id = '') + { + echo dc_app_url.'/share/comback/feed.php?type=atom'.(empty($post_id)?'':"&post=$post_id"); return true; } } diff -Nru comback-1.4/rss.php comback-new/rss.php --- comback-1.4/rss.php 2007-08-14 22:44:50.000000000 +0200 +++ comback-new/rss.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,159 +0,0 @@ -error()) { exit; } - -# Création de l'objet de type weblog avec uniquement les billets -# publiés -$blog = new xblog($con,DB_PREFIX,1,dc_encoding); -$blog->rs_blogpost = 'xblogpost'; -$blog->rs_blogcomment = 'xblogcomment'; - -$blog->setURL('post',util::getHost().dc_blog_url.dc_format_post_url); - -# Si type = cb on fait un fil des commentaires & combacks -if ($type == 'cb') { - # Si 'post' est vide on fait le fil des comms et combacks de tout le blog - $reqPlus = empty($post) ? '' : "AND p.post_id=$post"; - - # Récupération des combacks et des commentaires - #--- - # On renomme les champs de dc_comback avec le nom de ceux de dc_comments afin - # de pouvoir utiliser les méthodes de la classe xblogcomment - $t_comback = DB_PREFIX.'comback'; - $t_comment = $blog->t_comment; - $t_post = $blog->t_post; - $t_user = $blog->t_user; - - $strReq = << 1 - AND p.post_id = C.post_id - $reqPlus -ORDER BY comment_dt DESC LIMIT $limit -EOT; - $comments = $blog->con->select($strReq,$blog->rs_blogcomment); - if ($comments) - $comments->setBlog($blog); - #--- - - $title = dc_blog_name.' - Commentaires & réponses'; - $ts = time(); - $items = $seq = ''; - - if (!$comments->isEmpty()) - { - $ts = $comments->getTS(); - - while(!$comments->EOF()) { - # On parcourt les commentaires - # On met le comm dans le fil - $seq .= $comments->getRSSSeq(); - $items .= $comments->getRSSItem(dc_short_feeds); - $comments->moveNext(); - } - } -} - -# Fermeture de connexion -$con->close(); - -header('Content-Type: application/rss+xml; charset='.dc_encoding); -echo ''."\n"; -?> - - - - <?php echo $blog->toXML($title); ?> - ]]> - - - - - - - - daily - 1 - - - - - - - - - - - -