Make WordPress Core


Ignore:
Timestamp:
02/20/2004 08:46:55 PM (21 years ago)
Author:
saxmatt
Message:

New unfunky RSS care of the grandmaster of funk himself, Phil Ringnalda.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-commentsrss2.php

    r836 r900  
    11<?php
    2 
    3 // Contributed by Alex King
    4 // http://www.alexking.org/software/b2/
    5 
    6 /* These first lines are the first part of a WordPress template.
    7            In every template you do, you got to copy them before the CafeLog 'loop' */
    82if (! $feed) {
    9     $blog=1; // enter your blog's ID
    103    require('wp-blog-header.php');
    114}
     
    147
    158if (!isset($rss_language)) { $rss_language = 'en'; }
    16 echo "<?xml version=\"1.0\"?".">";
     9echo '<?xml version="1.0"?'.'>';
    1710?>
    1811<!-- generator="wordpress/<?php echo $wp_version ?>" -->
    1912<rss version="2.0"
    20     xmlns:dc="http://purl.org/dc/elements/1.1/"
    21     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    22     xmlns:admin="http://webns.net/mvcb/"
    23     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    2413    xmlns:content="http://purl.org/rss/1.0/modules/content/">
    2514<channel>
     
    3120?>
    3221    <title><?php if (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) { echo "Comments on: "; the_title_rss(); } else { bloginfo_rss("name"); echo " Comments"; } ?></title>
    33     <link><?php (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) ? permalink_single_rss() : bloginfo_rss("url") ?></link>
     22    <link><?php (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) ? permalink_single_rss() : bloginfo_rss("url") ?></link>
    3423    <description><?php bloginfo_rss("description") ?></description>
    35     <dc:language><?php echo $rss_language ?></dc:language>
    36     <dc:creator><?php echo antispambot($admin_email) ?></dc:creator>
    37     <dc:rights>Copyright <?php echo mysql2date('Y', get_lastpostdate()); ?></dc:rights>
    38     <dc:date><?php echo gmdate('Y-m-d\TH:i:s'); ?></dc:date>
    39     <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
    40     <admin:errorReportsTo rdf:resource="mailto:<?php echo antispambot($admin_email) ?>"/>
    41     <sy:updatePeriod>hourly</sy:updatePeriod>
    42     <sy:updateFrequency>1</sy:updateFrequency>
    43     <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
     24    <language><?php echo $rss_language ?></language>
     25    <pubDate><?php echo gmdate('r'); ?></pubDate>
     26    <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator>
    4427
    4528<?php
    4629        if (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) {
    47             $comments = $wpdb->get_results("SELECT comment_ID,
    48                                                    comment_author,
    49                                                    comment_author_email,
    50                                                    comment_author_url,
    51                                                    comment_date,
    52                                                    comment_content,
    53                                                    comment_post_ID,
    54                                                    $tableposts.ID,
    55                                                    $tableposts.post_password
    56                                             FROM $tablecomments
    57                                             LEFT JOIN $tableposts ON comment_post_id = id
    58                                             WHERE comment_post_ID = '$id'
    59                                             AND $tablecomments.comment_approved = '1'
    60                                             AND $tableposts.post_status = 'publish'
    61                                             AND post_date < '".date("Y-m-d H:i:s")."'
    62                                             ORDER BY comment_date
    63                                             LIMIT $posts_per_rss");
    64         }
    65         else { // if no post id passed in, we'll just ue the last 10 comments.
    66             $comments = $wpdb->get_results("SELECT comment_ID,
    67                                                    comment_author,
    68                                                    comment_author_email,
    69                                                    comment_author_url,
    70                                                    comment_date,
    71                                                    comment_content,
    72                                                    comment_post_ID,
    73                                                    $tableposts.ID,
    74                                                    $tableposts.post_password
    75                                             FROM $tablecomments
    76                                             LEFT JOIN $tableposts ON comment_post_id = id
    77                                             WHERE $tableposts.post_status = 'publish'
    78                                             AND $tablecomments.comment_approved = '1'
    79                                             AND post_date < '".date("Y-m-d H:i:s")."'
    80                                             ORDER BY comment_date DESC
    81                                             LIMIT $posts_per_rss");
     30            $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,
     31            comment_author_url, comment_date, comment_content, comment_post_ID,
     32            $tableposts.ID, $tableposts.post_password FROM $tablecomments
     33            LEFT JOIN $tableposts ON comment_post_id = id WHERE comment_post_ID = '$id'
     34            AND $tablecomments.comment_approved = '1' AND $tableposts.post_status = 'publish'
     35            AND post_date < '".date("Y-m-d H:i:s")."'
     36            ORDER BY comment_date LIMIT $posts_per_rss");
     37        } else { // if no post id passed in, we'll just ue the last 10 comments.
     38            $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,
     39            comment_author_url, comment_date, comment_content, comment_post_ID,
     40            $tableposts.ID, $tableposts.post_password FROM $tablecomments
     41            LEFT JOIN $tableposts ON comment_post_id = id WHERE $tableposts.post_status = 'publish'
     42            AND $tablecomments.comment_approved = '1' AND post_date < '".date("Y-m-d H:i:s")."' 
     43            ORDER BY comment_date DESC LIMIT $posts_per_rss");
    8244        }
    8345    // this line is WordPress' motor, do not delete it.
     
    8547            foreach ($comments as $comment) {
    8648?>
    87     <item rdf:about="<?php permalink_comments_rss() ?>">
     49    <item>
    8850        <title>by: <?php comment_author_rss() ?></title>
    8951        <link><?php comment_link_rss() ?></link>
    90         <dc:date><?php comment_time('Y-m-d\TH:i:s'); ?></dc:date>
     52        <pubDate><?php comment_time('r'); ?></pubDate>
    9153        <guid isPermaLink="false"><?php comment_ID(); echo ":".$comment->comment_post_ID; ?>@<?php bloginfo_rss("url") ?></guid>
    9254            <?php
     
    9658        <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
    9759            <?php
    98             }
    99             else {
     60            } else {
    10061            ?>
    10162        <description><?php comment_text_rss() ?></description>
    10263        <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded>
    103             <?php } // close check for password ?>
     64            <?php
     65            } // close check for password
     66            ?>
    10467    </item>
    10568<?php
Note: See TracChangeset for help on using the changeset viewer.