Ticket #1526: atom.diff
| File atom.diff, 6.4 KB (added by , 20 years ago) |
|---|
-
wp-includes/feed-functions.php
129 129 $category->cat_name = convert_chars($category->cat_name); 130 130 if ('rdf' == $type) { 131 131 $the_list .= "\n\t<dc:subject>$category->cat_name</dc:subject>"; 132 } elseif ('atom' == $type) { 133 $the_list .= "\n\t<category term=\"$category->cat_name\" />"; 132 134 } else { 133 135 $the_list .= "\n\t<category>$category->cat_name</category>"; 134 136 } … … 155 157 } 156 158 } 157 159 158 ?> 159 No newline at end of file 160 function atom_enclosure() { 161 global $id, $post; 162 if (!empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password)) return; 163 164 $custom_fields = get_post_custom(); 165 if( is_array( $custom_fields ) ) { 166 while( list( $key, $val ) = each( $custom_fields ) ) { 167 if( $key == 'enclosure' ) { 168 if (is_array($val)) { 169 foreach($val as $enc) { 170 $enclosure = split( "\n", $enc ); 171 print "<link rel=\"enclosure\" length=\"".trim( $enclosure[ 1 ] )."\" type=\"".trim( $enclosure[ 2 ] )."\" href=\"".trim( htmlspecialchars($enclosure[ 0 ]) )."\"/>\n"; 172 } 173 } 174 } 175 } 176 } 177 } 178 179 ?> -
wp-content/themes/classic/header.php
14 14 15 15 <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" /> 16 16 <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" /> 17 <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />17 <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="<?php bloginfo('atom_url'); ?>" /> 18 18 19 19 <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> 20 20 <?php wp_get_archives('type=monthly&format=link'); ?> -
wp-content/themes/default/header.php
10 10 11 11 <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> 12 12 <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> 13 <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" /> 13 14 <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> 14 15 15 16 <style type="text/css" media="screen"> -
wp-atom.php
10 10 11 11 ?> 12 12 <?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?> 13 <feed version="0.3" 14 xmlns="http://purl.org/atom/ns#" 13 <feed xmlns="http://www.w3.org/2005/Atom" 15 14 xmlns:dc="http://purl.org/dc/elements/1.1/" 16 15 xml:lang="<?php echo get_option('rss_language'); ?>" 17 16 <?php do_action('atom_ns'); ?> 18 17 > 18 <id><?php bloginfo_rss('atom_url') ?></id> 19 19 <title><?php bloginfo_rss('name') ?></title> 20 <link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" /> 21 <tagline><?php bloginfo_rss("description") ?></tagline> 22 <modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></modified> 23 <copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></copyright> 24 <generator url="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator> 20 <link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('atom_url') ?>" /> 21 <link rel="alternate" type="application/rss+xml" href="<?php bloginfo_rss('rss2_url') ?>" /> 22 <link rel="alternate" type="text/html"<?php if (defined('WPLANG') && strcmp(constant('WPLANG'), '')) echo ' hreflang="' . WPLANG . '"';?> href="<?php bloginfo_rss('home') ?>" /> 23 <subtitle><?php bloginfo_rss("description") ?></subtitle> 24 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated> 25 <rights>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></rights> 26 <generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress <?php bloginfo_rss('version'); ?></generator> 25 27 <?php do_action('atom_head'); ?> 26 28 <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?> 27 29 <entry> 28 30 <author> 29 31 <name><?php the_author() ?></name> 30 32 </author> 31 <title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title>33 <title type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><?php the_title_rss() ?></div></title> 32 34 <link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" /> 33 35 <id><?php the_guid(); ?></id> 34 <modified><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></modified> 35 <issued><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></issued> 36 <?php the_category_rss('rdf') ?> 37 <summary type="text/plain" mode="escaped"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary> 38 <?php if ( !get_settings('rss_use_excerpt') ) : ?> 39 <content type="<?php bloginfo('html_type'); ?>" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content> 36 <updated><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></updated> 37 <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published> 38 <?php the_category_rss('atom') ?> 39 <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><?php the_excerpt_rss(); ?></div></summary> 40 <?php if (!get_settings('rss_use_excerpt') || strstr($_SERVER['HTTP_USER_AGENT'], "Technoratibot") !== FALSE): ?> 41 <?php // FIXME: Ignore bloginfo('html_type') since it's deliberately set incorrectly; WordPress currently generates ONLY XHTML ?> 42 <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><?php the_content('', 0, '') ?></div></content> 40 43 <?php endif; ?> 41 <?php rss_enclosure(); ?>44 <?php atom_enclosure(); ?> 42 45 <?php do_action('atom_entry'); ?> 43 46 </entry> 44 47 <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>