]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/feed-atom-comments.php
Wordpress 2.5.1
[autoinstalls/wordpress.git] / wp-includes / feed-atom-comments.php
index ee9a73b401fd6e6cfa9754fc1efa599803210195..e7c3c7cba6abb47242be0ee6cdbaea4be3c6230e 100644 (file)
@@ -1,4 +1,10 @@
 <?php
 <?php
+/**
+ * Atom Feed Template for displaying Atom Comments feed.
+ *
+ * @package WordPress
+ */
+
 header('Content-Type: application/atom+xml; charset=' . get_option('blog_charset'), true);
 echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>';
 ?>
 header('Content-Type: application/atom+xml; charset=' . get_option('blog_charset'), true);
 echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>';
 ?>
@@ -11,18 +17,28 @@ echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>'
                if ( is_singular() )
                        printf(__('Comments on: %s'), get_the_title_rss());
                elseif ( is_search() )
                if ( is_singular() )
                        printf(__('Comments on: %s'), get_the_title_rss());
                elseif ( is_search() )
-                       printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s']));
+                       printf(__('Comments for %1$s searching on %2$s'), get_bloginfo_rss( 'name' ), attribute_escape(get_search_query()));
                else
                        printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
        ?></title>
        <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle>
 
        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT')); ?></updated>
                else
                        printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
        ?></title>
        <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle>
 
        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT')); ?></updated>
-       <generator uri="http://wordpress.org/" version="<?php bloginfo('version'); ?>">WordPress</generator>
+       <?php the_generator( 'atom' ); ?>
 
 
+<?php if ( is_singular() ) { ?>
+       <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_comments_link(); ?>" />
+       <link rel="self" type="application/atom+xml" href="<?php echo get_post_comments_feed_link('', 'atom'); ?>" />
+       <id><?php echo get_post_comments_feed_link('', 'atom'); ?></id>
+<?php } elseif(is_search()) { ?>
+       <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_option('home') . '?s=' . attribute_escape(get_search_query()); ?>" />
+       <link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" />
+       <id><?php echo get_search_comments_feed_link('', 'atom'); ?></id>
+<?php } else { ?>
        <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('home'); ?>" />
        <link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
        <id><?php bloginfo_rss('comments_atom_url'); ?></id>
        <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('home'); ?>" />
        <link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
        <id><?php bloginfo_rss('comments_atom_url'); ?></id>
+<?php } ?>
 
 <?php
 if ( have_comments() ) : while ( have_comments() ) : the_comment();
 
 <?php
 if ( have_comments() ) : while ( have_comments() ) : the_comment();