Ticket #1526: wp-atom_0.3-1.0.2.diff

File wp-atom_0.3-1.0.2.diff, 3.7 kB (added by enricopulatzo, 2 years ago)

Changed feed <id> element to use bloginfo('atom_url')

  • wp-atom.php

    old new  
    22 
    33if (empty($wp)) { 
    44        require_once('wp-config.php'); 
    5         wp('feed=atom'); 
     5        wp('feed=atom1'); 
    66} 
    77 
    88header('Content-type: application/atom+xml; charset=' . get_settings('blog_charset'), true); 
    99$more = 1; 
    1010 
    1111?> 
    12 <?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?> 
    13 <feed version="0.3" 
    14   xmlns="http://purl.org/atom/ns#" 
     12<?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.">\n"; ?> 
     13<feed xmlns="http://www.w3.org/2005/Atom" 
    1514  xmlns:dc="http://purl.org/dc/elements/1.1/" 
    1615  xml:lang="<?php echo get_option('rss_language'); ?>" 
    1716  <?php do_action('atom_ns'); ?> 
    1817  > 
    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> 
     18        <id><?php echo get_settings('home') . '/#Atom'; ?></id> 
     19        <link rel="self" href="<?php bloginfo('atom_url'); ?>" /> 
     20        <title type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><?php bloginfo_rss('name') ?></div></title> 
     21        <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><?php bloginfo_rss("description") ?></div></subtitle> 
     22        <updated><?php echo mysql2date('Y-m-d', get_lastpostmodified('GMT'), false) . 'T' .  mysql2date('H:i:s', get_lastpostmodified('GMT'), false) . 'Z'; ?></updated> 
    2523        <?php do_action('atom_head'); ?> 
    2624        <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?> 
    27         <entry> 
    28                 <author> 
    29                         <name><?php the_author() ?></name> 
    30                 </author> 
    31                 <title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title> 
    32                 <link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" /> 
    33                 <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> 
    40 <?php endif; ?> 
    41 <?php rss_enclosure(); ?> 
    42 <?php do_action('atom_entry'); ?> 
    43         </entry> 
     25                <entry> 
     26                        <author> 
     27                                <name><?php the_author() ?></name> 
     28                                <uri><?php echo get_settings('home'); ?></uri> 
     29                        </author> 
     30                        <title type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><?php the_title_rss() ?></div></title> 
     31                        <link rel="alternate" href="<?php permalink_single_rss() ?>" /> 
     32                        <id><?php the_guid(); ?></id> 
     33                        <updated><?php echo get_post_time('Y-m-d', true) . 'T' . get_post_time('H:i:s', true) . 'Z'; ?></updated> 
     34                        <?php the_category_rss('rdf'); ?> 
     35                        <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><?php the_excerpt_rss(); ?></div></summary> 
     36                        <?php if ( !get_settings('rss_use_excerpt') ) : ?> 
     37                                <content type="xhtml" xml:base="<?php permalink_single_rss() ?>"> 
     38                                        <div xmlns="http://www.w3.org/1999/xhtml"> 
     39                                                <?php the_content('', 0, '') ?> 
     40                                        </div> 
     41                                </content> 
     42                        <?php endif; ?> 
     43                        <?php do_action('atom_entry'); ?> 
     44                </entry> 
    4445        <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?> 
    4546</feed>