root/tags/1.3/wp-includes/feed-rss2-comments.php

Revision 1139, 2.3 kB (checked in by donncha, 1 year ago)

Merge with WordPress? 2.3.1

  • Property svn:eol-style set to native
Line 
1 <?php
2 header('Content-Type: text/xml;charset=' . get_option('blog_charset'), true);
3
4 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
5 ?>
6 <!-- generator="wordpress/<?php echo $wp_version ?>" -->
7 <rss version="2.0"
8     xmlns:content="http://purl.org/rss/1.0/modules/content/"
9     xmlns:dc="http://purl.org/dc/elements/1.1/"
10     >
11 <channel>
12     <title><?php
13         if ( is_singular() )
14             printf(__('Comments on: %s'), get_the_title_rss());
15         elseif ( is_search() )
16             printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s']));
17         else
18             printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
19     ?></title>
20     <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
21     <description><?php bloginfo_rss("description") ?></description>
22     <pubDate><?php echo gmdate('r'); ?></pubDate>
23     <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator>
24     <?php do_action('commentsrss2_head'); ?>
25 <?php
26 if ( have_comments() ) : while ( have_comments() ) : the_comment();
27     $comment_post = get_post($comment->comment_post_ID);
28     get_post_custom($comment_post->ID);
29 ?>
30     <item>
31         <title><?php
32             if ( !is_singular() ) {
33                 $title = get_the_title($comment_post->ID);
34                 $title = apply_filters('the_title_rss', $title);
35                 printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss());
36             } else {
37                 printf(__('By: %s'), get_comment_author_rss());
38             }
39         ?></title>
40         <link><?php comment_link() ?></link>
41         <dc:creator><?php echo get_comment_author_rss() ?></dc:creator>
42         <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate>
43         <guid><?php comment_link() ?></guid>
44 <?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?>
45         <description><?php _e('Protected Comments: Please enter your password to view comments.'); ?></description>
46         <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
47 <?php else : // post pass ?>
48         <description><?php comment_text_rss() ?></description>
49         <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded>
50 <?php endif; // post pass
51     do_action('commentrss2_item', $comment->comment_ID, $comment_post->ID);
52 ?>
53     </item>
54 <?php endwhile; endif; ?>
55 </channel>
56 </rss>
57
Note: See TracBrowser for help on using the browser.