raw
mp-wp_genesis           1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * Atom Feed Template for displaying Atom Comments feed.
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 */
mp-wp_genesis 7
mp-wp_genesis 8 header('Content-Type: application/atom+xml; charset=' . get_option('blog_charset'), true);
mp-wp_genesis 9 echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>';
mp-wp_genesis 10 ?>
mp-wp_genesis 11 <feed
mp-wp_genesis 12 xmlns="http://www.w3.org/2005/Atom"
mp-wp_genesis 13 xml:lang="<?php echo get_option('rss_language'); ?>"
mp-wp_genesis 14 <?php do_action('atom_ns'); ?>
mp-wp_genesis 15 >
mp-wp_genesis 16 <title type="text"><?php
mp-wp_genesis 17 if ( is_singular() )
mp-wp_genesis 18 printf(ent2ncr(__('Comments on: %s')), get_the_title_rss());
mp-wp_genesis 19 elseif ( is_search() )
mp-wp_genesis 20 printf(ent2ncr(__('Comments for %1$s searching on %2$s')), get_bloginfo_rss( 'name' ), attribute_escape(get_search_query()));
mp-wp_genesis 21 else
mp-wp_genesis 22 printf(ent2ncr(__('Comments for %s')), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
mp-wp_genesis 23 ?></title>
mp-wp_genesis 24 <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle>
mp-wp_genesis 25
mp-wp_genesis 26 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT')); ?></updated>
mp-wp_genesis 27 <?php the_generator( 'atom' ); ?>
mp-wp_genesis 28
mp-wp_genesis 29 <?php if ( is_singular() ) { ?>
mp-wp_genesis 30 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_comments_link(); ?>" />
mp-wp_genesis 31 <link rel="self" type="application/atom+xml" href="<?php echo get_post_comments_feed_link('', 'atom'); ?>" />
mp-wp_genesis 32 <id><?php echo get_post_comments_feed_link('', 'atom'); ?></id>
mp-wp_genesis 33 <?php } elseif(is_search()) { ?>
mp-wp_genesis 34 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_option('home') . '?s=' . attribute_escape(get_search_query()); ?>" />
mp-wp_genesis 35 <link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" />
mp-wp_genesis 36 <id><?php echo get_search_comments_feed_link('', 'atom'); ?></id>
mp-wp_genesis 37 <?php } else { ?>
mp-wp_genesis 38 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('home'); ?>" />
mp-wp_genesis 39 <link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
mp-wp_genesis 40 <id><?php bloginfo_rss('comments_atom_url'); ?></id>
mp-wp_genesis 41 <?php } ?>
mp-wp_genesis 42
mp-wp_genesis 43 <?php
mp-wp_genesis 44 if ( have_comments() ) : while ( have_comments() ) : the_comment();
mp-wp_genesis 45 $comment_post = get_post($comment->comment_post_ID);
mp-wp_genesis 46 get_post_custom($comment_post->ID);
mp-wp_genesis 47 ?>
mp-wp_genesis 48 <entry>
mp-wp_genesis 49 <title><?php
mp-wp_genesis 50 if ( !is_singular() ) {
mp-wp_genesis 51 $title = get_the_title($comment_post->ID);
mp-wp_genesis 52 $title = apply_filters('the_title_rss', $title);
mp-wp_genesis 53 printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
mp-wp_genesis 54 } else {
mp-wp_genesis 55 printf(ent2ncr(__('By: %s')), get_comment_author_rss());
mp-wp_genesis 56 }
mp-wp_genesis 57 ?></title>
mp-wp_genesis 58 <link rel="alternate" href="<?php comment_link(); ?>" type="<?php bloginfo_rss('html_type'); ?>" />
mp-wp_genesis 59
mp-wp_genesis 60 <author>
mp-wp_genesis 61 <name><?php comment_author_rss(); ?></name>
mp-wp_genesis 62 <?php if (get_comment_author_url()) echo '<uri>' . get_comment_author_url() . '</uri>'; ?>
mp-wp_genesis 63
mp-wp_genesis 64 </author>
mp-wp_genesis 65
mp-wp_genesis 66 <id><?php comment_link(); ?></id>
mp-wp_genesis 67 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated>
mp-wp_genesis 68 <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published>
mp-wp_genesis 69 <?php if ( post_password_required($comment_post) ) : ?>
mp-wp_genesis 70 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content>
mp-wp_genesis 71 <?php else : // post pass ?>
mp-wp_genesis 72 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content>
mp-wp_genesis 73 <?php endif; // post pass
mp-wp_genesis 74 // Return comment threading information (http://www.ietf.org/rfc/rfc4685.txt)
mp-wp_genesis 75 if ( $comment->comment_parent == 0 ) : // This comment is top level ?>
mp-wp_genesis 76 <thr:in-reply-to ref="<?php the_guid() ?>" href="<?php the_permalink_rss() ?>" type="<?php bloginfo_rss('html_type'); ?>" />
mp-wp_genesis 77 <?php else : // This comment is in reply to another comment
mp-wp_genesis 78 $parent_comment = get_comment($comment->comment_parent);
mp-wp_genesis 79 // The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, its more important that they both use the same system
mp-wp_genesis 80 ?>
mp-wp_genesis 81 <thr:in-reply-to ref="<?php echo get_comment_link($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" />
mp-wp_genesis 82 <?php endif;
mp-wp_genesis 83 do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID);
mp-wp_genesis 84 ?>
mp-wp_genesis 85 </entry>
mp-wp_genesis 86 <?php endwhile; endif; ?>
mp-wp_genesis 87 </feed>