Wordpress 2.5.1
[autoinstalls/wordpress.git] / wp-includes / feed-atom.php
1 <?php
2 /**
3  * Atom Feed Template for displaying Atom Posts feed.
4  *
5  * @package WordPress
6  */
7
8 header('Content-Type: application/atom+xml; charset=' . get_option('blog_charset'), true);
9 $more = 1;
10
11 ?>
12 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
13 <feed
14   xmlns="http://www.w3.org/2005/Atom"
15   xmlns:thr="http://purl.org/syndication/thread/1.0"
16   xml:lang="<?php echo get_option('rss_language'); ?>"
17   xml:base="<?php bloginfo_rss('home') ?>/wp-atom.php"
18   <?php do_action('atom_ns'); ?>
19  >
20         <title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
21         <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
22
23         <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></updated>
24         <?php the_generator( 'atom' ); ?>
25
26         <link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
27         <id><?php bloginfo('atom_url'); ?></id>
28         <link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
29
30         <?php do_action('atom_head'); ?>
31         <?php while (have_posts()) : the_post(); ?>
32         <entry>
33                 <author>
34                         <name><?php the_author() ?></name>
35                         <?php $author_url = get_the_author_url(); if ( !empty($author_url) ) : ?>
36                         <uri><?php the_author_url()?></uri>
37                         <?php endif; ?>
38                 </author>
39                 <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
40                 <link rel="alternate" type="text/html" href="<?php the_permalink_rss() ?>" />
41                 <id><?php the_guid(); ?></id>
42                 <updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
43                 <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
44                 <?php the_category_rss('atom') ?>
45                 <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
46 <?php if ( !get_option('rss_use_excerpt') ) : ?>
47                 <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
48 <?php endif; ?>
49 <?php atom_enclosure(); ?>
50 <?php do_action('atom_entry'); ?>
51                 <link rel="replies" type="text/html" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
52                 <link rel="replies" type="application/atom+xml" href="<?php echo get_post_comments_feed_link(0,'atom') ?>" thr:count="<?php echo get_comments_number()?>"/>
53                 <thr:total><?php echo get_comments_number()?></thr:total>
54         </entry>
55         <?php endwhile ; ?>
56 </feed>