Changeset 4927

Show
Ignore:
Timestamp:
02/23/07 02:50:05 (1 year ago)
Author:
ryan
Message:

Relocate feed templates to wp-includes. fixes #3846

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-atom.php

    r4805 r4927  
    66} 
    77 
    8 header('Content-type: application/atom+xml; charset=' . get_option('blog_charset'), true); 
    9 $more = 1; 
     8require (ABSPATH . WPINC . '/feed-atom.php'); 
    109 
    1110?> 
    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') ?></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     <generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator> 
    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 bloginfo('atom_url'); ?>" /> 
    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             <uri><?php the_author_url()?></uri> 
    36         </author> 
    37         <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title> 
    38         <link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" /> 
    39         <id><?php the_guid(); ?></id> 
    40         <updated><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></updated> 
    41         <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published> 
    42         <?php the_category_rss('atom') ?> 
    43         <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary> 
    44 <?php if ( !get_option('rss_use_excerpt') ) : ?> 
    45         <content type="<?php html_type_rss(); ?>" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content> 
    46 <?php endif; ?> 
    47 <?php rss_enclosure(); ?> 
    48 <?php do_action('atom_entry'); ?> 
    49     </entry> 
    50     <?php endwhile ; ?> 
    51 </feed> 
  • trunk/wp-commentsrss2.php

    r4635 r4927  
    66} 
    77 
    8 header('Content-type: text/xml;charset=' . get_option('blog_charset'), true); 
     8require (ABSPATH . WPINC . '/feed-rss2-comments.php'); 
    99 
    10 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';  
    1110?> 
    12 <!-- generator="wordpress/<?php echo $wp_version ?>" --> 
    13 <rss version="2.0"  
    14     xmlns:content="http://purl.org/rss/1.0/modules/content/"> 
    15 <channel> 
    16 <?php 
    17 $i = 0; 
    18 if (have_posts()) : 
    19   while (have_posts()) : the_post(); 
    20     if ($i < 1) { 
    21         $i++; 
    22 ?> 
    23     <title><?php if (is_single() || is_page() ) { printf(__('Comments on: %s'), get_the_title_rss()); } else { printf(__('Comments for %s'), get_bloginfo_rss("name")); } ?></title> 
    24     <link><?php (is_single()) ? permalink_single_rss() : bloginfo_rss("url") ?></link> 
    25     <description><?php bloginfo_rss("description") ?></description> 
    26     <pubDate><?php echo gmdate('r'); ?></pubDate> 
    27     <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator> 
    28  
    29 <?php  
    30         if (is_single() || is_page()) { 
    31             $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,  
    32             comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,  
    33             $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments  
    34             LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '" . get_the_ID() . "'  
    35             AND $wpdb->comments.comment_approved = '1' AND $wpdb->posts.post_status = 'publish'  
    36             AND post_date_gmt < '" . gmdate("Y-m-d H:i:59") . "'  
    37             ORDER BY comment_date_gmt ASC" ); 
    38         } else { // if no post id passed in, we'll just ue the last 10 comments. 
    39             $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,  
    40             comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,  
    41             $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments  
    42             LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE $wpdb->posts.post_status = 'publish'  
    43             AND $wpdb->comments.comment_approved = '1' AND post_date_gmt < '" . gmdate("Y-m-d H:i:s") . "'   
    44             ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss') ); 
    45         } 
    46     // this line is WordPress' motor, do not delete it. 
    47         if ($comments) { 
    48             foreach ($comments as $comment) { 
    49                 $GLOBALS['comment'] =& $comment; 
    50                 // Some plugins may need to know the metadata 
    51                 // associated with this comment's post: 
    52                 get_post_custom($comment->comment_post_ID); 
    53 ?> 
    54     <item> 
    55         <title><?php if ( ! (is_single() || is_page()) ) { 
    56             $title = get_the_title($comment->comment_post_ID); 
    57             $title = apply_filters('the_title', $title); 
    58             $title = apply_filters('the_title_rss', $title); 
    59             printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); 
    60         } else { 
    61             printf(__('By: %s'), get_comment_author_rss()); 
    62         } ?></title> 
    63         <link><?php comment_link() ?></link> 
    64         <author><?php echo get_comment_author_rss() ?></author> 
    65         <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate> 
    66         <guid><?php comment_link() ?></guid> 
    67             <?php 
    68             if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) { 
    69             ?> 
    70         <description><?php _e('Protected Comments: Please enter your password to view comments.'); ?></description> 
    71         <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded> 
    72             <?php 
    73             } else { 
    74             ?> 
    75         <description><?php comment_text_rss() ?></description> 
    76         <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded> 
    77             <?php 
    78             } // close check for password 
    79             do_action('commentrss2_item', $comment->comment_ID, $comment->comment_post_ID); 
    80             ?> 
    81     </item> 
    82 <?php 
    83             } 
    84         } 
    85     } 
    86 endwhile; endif; 
    87 ?> 
    88 </channel> 
    89 </rss> 
  • trunk/wp-includes/functions.php

    r4920 r4927  
    959959 
    960960function do_feed_rdf() { 
    961     load_template(ABSPATH . 'wp-rdf.php'); 
     961    load_template(ABSPATH . WPINC . '/feed-rdf.php'); 
    962962} 
    963963 
    964964function do_feed_rss() { 
    965     load_template(ABSPATH . 'wp-rss.php'); 
     965    load_template(ABSPATH . WPINC . '/feed-rss.php'); 
    966966} 
    967967 
    968968function do_feed_rss2($for_comments) { 
    969969    if ( $for_comments ) { 
    970         load_template(ABSPATH . 'wp-commentsrss2.php'); 
    971     } else { 
    972         load_template(ABSPATH . 'wp-rss2.php'); 
     970        load_template(ABSPATH . WPINC . '/feed-rss2-comments.php'); 
     971    } else { 
     972        load_template(ABSPATH . WPINC . '/feed-rss2.php'); 
    973973    } 
    974974} 
    975975 
    976976function do_feed_atom() { 
    977     load_template(ABSPATH . 'wp-atom.php'); 
     977    load_template(ABSPATH . WPINC . '/feed-atom.php'); 
    978978} 
    979979 
  • trunk/wp-rdf.php

    r4144 r4927  
    66} 
    77 
    8 header('Content-type: application/rdf+xml; charset=' . get_option('blog_charset'), true); 
    9 $more = 1; 
     8require (ABSPATH . WPINC . '/feed-rdf.php'); 
    109 
    1110?> 
    12 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> 
    13 <!-- generator="wordpress/<?php echo $wp_version ?>" --> 
    14 <rdf:RDF 
    15     xmlns="http://purl.org/rss/1.0/" 
    16     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
    17     xmlns:dc="http://purl.org/dc/elements/1.1/" 
    18     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" 
    19     xmlns:admin="http://webns.net/mvcb/" 
    20     xmlns:content="http://purl.org/rss/1.0/modules/content/" 
    21     <?php do_action('rdf_ns'); ?> 
    22 > 
    23 <channel rdf:about="<?php bloginfo_rss("url") ?>"> 
    24     <title><?php bloginfo_rss('name') ?></title> 
    25     <link><?php bloginfo_rss('url') ?></link> 
    26     <description><?php bloginfo_rss('description') ?></description> 
    27     <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date> 
    28     <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/> 
    29     <sy:updatePeriod>hourly</sy:updatePeriod> 
    30     <sy:updateFrequency>1</sy:updateFrequency> 
    31     <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> 
    32     <?php do_action('rdf_header'); ?> 
    33     <items> 
    34         <rdf:Seq> 
    35         <?php while (have_posts()): the_post(); ?> 
    36             <rdf:li rdf:resource="<?php permalink_single_rss() ?>"/> 
    37         <?php endwhile; ?> 
    38         </rdf:Seq> 
    39     </items> 
    40 </channel> 
    41 <?php rewind_posts(); while (have_posts()): the_post(); ?> 
    42 <item rdf:about="<?php permalink_single_rss() ?>"> 
    43     <title><?php the_title_rss() ?></title> 
    44     <link><?php permalink_single_rss() ?></link> 
    45      <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date> 
    46     <dc:creator><?php the_author() ?></dc:creator> 
    47     <?php the_category_rss('rdf') ?> 
    48 <?php if (get_option('rss_use_excerpt')) : ?> 
    49     <description><?php the_excerpt_rss() ?></description> 
    50 <?php else : ?> 
    51     <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length'), 2) ?></description> 
    52     <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded> 
    53 <?php endif; ?> 
    54     <?php do_action('rdf_item'); ?> 
    55 </item> 
    56 <?php endwhile;  ?> 
    57 </rdf:RDF> 
  • trunk/wp-rss.php

    r4465 r4927  
    66} 
    77 
    8 header('Content-type: text/xml; charset=' . get_option('blog_charset'), true); 
    9 $more = 1; 
     8require (ABSPATH . WPINC . '/feed-rss.php'); 
    109 
    1110?> 
    12 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> 
    13 <!-- generator="wordpress/<?php echo $wp_version ?>" --> 
    14 <rss version="0.92"> 
    15 <channel> 
    16     <title><?php bloginfo_rss('name') ?></title> 
    17     <link><?php bloginfo_rss('url') ?></link> 
    18     <description><?php bloginfo_rss('description') ?></description> 
    19     <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate> 
    20     <docs>http://backend.userland.com/rss092</docs> 
    21     <language><?php echo get_option('rss_language'); ?></language> 
    22     <?php do_action('rss_head'); ?> 
    23  
    24 <?php while (have_posts()) : the_post(); ?> 
    25     <item> 
    26         <title><?php the_title_rss() ?></title> 
    27 <?php if (get_option('rss_use_excerpt')) { ?> 
    28         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description> 
    29 <?php } else { // use content ?> 
    30         <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length')) ?></description> 
    31 <?php } ?> 
    32         <link><?php permalink_single_rss() ?></link> 
    33         <?php do_action('rss_item'); ?> 
    34     </item> 
    35 <?php endwhile; ?> 
    36 </channel> 
    37 </rss> 
  • trunk/wp-rss2.php

    r4495 r4927  
    66} 
    77 
    8 header('Content-type: text/xml; charset=' . get_option('blog_charset'), true); 
    9 $more = 1; 
     8require (ABSPATH . WPINC . '/feed-rss2.php'); 
    109 
    1110?> 
    12 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> 
    13  
    14 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" --> 
    15 <rss version="2.0" 
    16     xmlns:content="http://purl.org/rss/1.0/modules/content/" 
    17     xmlns:wfw="http://wellformedweb.org/CommentAPI/" 
    18     xmlns:dc="http://purl.org/dc/elements/1.1/" 
    19     <?php do_action('rss2_ns'); ?> 
    20 > 
    21  
    22 <channel> 
    23     <title><?php bloginfo_rss('name'); ?></title> 
    24     <link><?php bloginfo_rss('url') ?></link> 
    25     <description><?php bloginfo_rss("description") ?></description> 
    26     <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate> 
    27     <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator> 
    28     <language><?php echo get_option('rss_language'); ?></language> 
    29     <?php do_action('rss2_head'); ?> 
    30     <?php while( have_posts()) : the_post(); ?> 
    31     <item> 
    32         <title><?php the_title_rss() ?></title> 
    33         <link><?php permalink_single_rss() ?></link> 
    34         <comments><?php comments_link(); ?></comments> 
    35         <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> 
    36         <dc:creator><?php the_author() ?></dc:creator> 
    37         <?php the_category_rss() ?> 
    38  
    39         <guid isPermaLink="false"><?php the_guid(); ?></guid> 
    40 <?php if (get_option('rss_use_excerpt')) : ?> 
    41         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description> 
    42 <?php else : ?> 
    43         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description> 
    44     <?php if ( strlen( $post->post_content ) > 0 ) : ?> 
    45         <content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded> 
    46     <?php else : ?> 
    47         <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded> 
    48     <?php endif; ?> 
    49 <?php endif; ?> 
    50         <wfw:commentRss><?php echo comments_rss(); ?></wfw:commentRss> 
    51 <?php rss_enclosure(); ?> 
    52     <?php do_action('rss2_item'); ?> 
    53     </item> 
    54     <?php endwhile; ?> 
    55 </channel> 
    56 </rss>