Changeset 4934 for trunk/wp-includes/feed-atom-comments.php
- Timestamp:
- 02/24/2007 07:33:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/feed-atom-comments.php
r4928 r4934 9 9 > 10 10 <title type="text"><?php 11 if ( is_single() || is_page()) {11 if ( is_singular() ) 12 12 printf(__('Comments on: %s'), get_the_title_rss()); 13 } else { 14 printf(__('Comments for %s'), get_bloginfo_rss('name')); 15 } 13 elseif ( is_search() ) 14 printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s'])); 15 else 16 printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); 16 17 ?></title> 17 18 <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle> … … 25 26 26 27 <?php 27 $i = 0; 28 if (have_posts()) : 29 while (have_posts()) : the_post(); 30 if ($i < 1) { 31 $i++; 32 } 33 34 if (is_single() || is_page()) { 35 $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email, 36 comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID, 37 $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments 38 LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '" . get_the_ID() . "' 39 AND $wpdb->comments.comment_approved = '1' AND $wpdb->posts.post_status = 'publish' 40 AND post_date_gmt < '" . gmdate("Y-m-d H:i:59") . "' 41 ORDER BY comment_date_gmt ASC" ); 42 } else { // if no post id passed in, we'll just use the last posts_per_rss comments. 43 $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email, 44 comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID, 45 $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments 46 LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE $wpdb->posts.post_status = 'publish' 47 AND $wpdb->comments.comment_approved = '1' AND post_date_gmt < '" . gmdate("Y-m-d H:i:s") . "' 48 ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss') ); 49 } 50 51 if ($comments) { 52 foreach ($comments as $comment) { 53 $GLOBALS['comment'] =& $comment; 54 get_post_custom($comment->comment_post_ID); 28 if ( have_comments() ) : while ( have_comments() ) : the_comment(); 29 $comment_post = get_post($comment->comment_post_ID); 30 get_post_custom($comment_post->ID); 55 31 ?> 56 32 <entry> 57 33 <title><?php 58 if ( !(is_single() || is_page())) {59 $title = get_the_title($comment ->comment_post_ID);34 if ( !is_singular() ) { 35 $title = get_the_title($comment_post->ID); 60 36 $title = apply_filters('the_title', $title); 61 37 $title = apply_filters('the_title_rss', $title); … … 70 46 <name><?php comment_author_rss(); ?></name> 71 47 <?php if (get_comment_author_url()) echo '<uri>' . get_comment_author_url() . '</uri>'; ?> 48 72 49 </author> 73 50 … … 75 52 <updated><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></updated> 76 53 <published><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></published> 77 78 <?php if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) { ?> 54 <?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> 79 55 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content> 80 <?php } else {?>56 <?php else : // post pass ?> 81 57 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content> 82 <?php } ?> 58 <?php endif; // post pass 59 do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID); 60 ?> 83 61 </entry> 84 <?php 85 } 86 } 87 88 endwhile; 89 endif; 90 ?> 62 <?php endwhile; endif; ?> 91 63 </feed>
Note: See TracChangeset
for help on using the changeset viewer.