3
* Generates an RSS 2.0 feed for the requested blog's latest comments
5
* See {@link http://backend.userland.com/rss}
10
if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
13
{ // Comments for a specific Item:
14
$CommentList = new CommentList( $Blog, "'comment'", array('published'), $Item->ID, '', 'DESC', '', $Blog->get_setting('posts_per_feed') );
15
$selfurl = format_to_output( $Item->get_feedback_feed_url( '_rss2' ), 'xmlattr' );
18
{ // Comments for the blog:
19
$CommentList = new CommentList( $Blog, "'comment'", array('published'), '', '', 'DESC', '', $Blog->get_setting('posts_per_feed') );
20
$selfurl = format_to_output( $Blog->get_comment_feed_url( '_rss2' ), 'xmlattr' );
23
header_content_type( 'application/xml' ); // sets charset
25
echo '<?xml version="1.0" encoding="'.$io_charset.'"?'.'>';
27
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
30
$Blog->disp( 'name', 'xml' );
31
// title for the current request
33
'title_before' => ' - ',
36
<link><?php $Blog->disp( 'lastcommentsurl', 'xml' ) ?></link>
37
<atom:link rel="self" type="application/rss+xml" href="<?php echo $selfurl; ?>" />
38
<description></description>
39
<language><?php $Blog->disp( 'locale', 'xml' ) ?></language>
40
<docs>http://backend.userland.com/rss</docs>
41
<admin:generatorAgent rdf:resource="<?php echo $app_homepage ?>"/>
43
<?php while( $Comment = & $CommentList->get_next() )
44
{ // Loop through comments:
45
// Load comment's Item:
49
<title><?php echo format_to_output( $Template->T_('In response to').':', 'xml' ) ?> <?php $Comment->Item->title( array( 'format' => 'xml', 'link_type' => 'none' ) ); ?></title>
50
<pubDate><?php $Comment->time( array( 'format' => 'r', 'useGM' => true ) ); ?></pubDate>
51
<dc:creator><?php $Comment->author( array( 'format' => 'xml' ) ); ?></dc:creator>
52
<guid isPermaLink="false">c<?php $Comment->ID(); ?>@<?php echo $app_baseurl ?></guid>
53
<description><?php echo make_rel_links_abs( $Comment->get_content('entityencoded') ); ?></description>
54
<content:encoded><![CDATA[<?php echo make_rel_links_abs( $Comment->get_content() ); ?>]]></content:encoded>
55
<link><?php $Comment->permanent_url(); ?></link>
58
} /* End of comment loop. */
62
<?php $Hit->log(); // log the hit on this page ?>