Changeset 900 for trunk/wp-commentsrss2.php
- Timestamp:
- 02/20/2004 08:46:55 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-commentsrss2.php
r836 r900 1 1 <?php 2 3 // Contributed by Alex King4 // 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' */8 2 if (! $feed) { 9 $blog=1; // enter your blog's ID10 3 require('wp-blog-header.php'); 11 4 } … … 14 7 15 8 if (!isset($rss_language)) { $rss_language = 'en'; } 16 echo "<?xml version=\"1.0\"?".">";9 echo '<?xml version="1.0"?'.'>'; 17 10 ?> 18 11 <!-- generator="wordpress/<?php echo $wp_version ?>" --> 19 12 <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#"24 13 xmlns:content="http://purl.org/rss/1.0/modules/content/"> 25 14 <channel> … … 31 20 ?> 32 21 <title><?php if (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) { echo "Comments on: "; the_title_rss(); } else { bloginfo_rss("name"); echo " Comments"; } ?></title> 33 22 <link><?php (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) ? permalink_single_rss() : bloginfo_rss("url") ?></link> 34 23 <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> 44 27 45 28 <?php 46 29 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"); 82 44 } 83 45 // this line is WordPress' motor, do not delete it. … … 85 47 foreach ($comments as $comment) { 86 48 ?> 87 <item rdf:about="<?php permalink_comments_rss() ?>">49 <item> 88 50 <title>by: <?php comment_author_rss() ?></title> 89 51 <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> 91 53 <guid isPermaLink="false"><?php comment_ID(); echo ":".$comment->comment_post_ID; ?>@<?php bloginfo_rss("url") ?></guid> 92 54 <?php … … 96 58 <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded> 97 59 <?php 98 } 99 else { 60 } else { 100 61 ?> 101 62 <description><?php comment_text_rss() ?></description> 102 63 <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded> 103 <?php } // close check for password ?> 64 <?php 65 } // close check for password 66 ?> 104 67 </item> 105 68 <?php
Note: See TracChangeset
for help on using the changeset viewer.