Make WordPress Core

Ticket #1256: comments-rss-gmt.diff

File comments-rss-gmt.diff, 2.7 KB (added by nbachiyski, 20 years ago)
  • wp-includes/comment-functions.php

     
    288288        echo get_comment_date( $d );
    289289}
    290290
    291 function get_comment_time( $d = '' ) {
     291function get_comment_time( $d = '', $gmt = false ) {
    292292        global $comment;
     293        $comment_date = $gmt? $comment->comment_date_gmt : $comment->comment_date;
    293294        if ( '' == $d )
    294                 $date = mysql2date(get_settings('time_format'), $comment->comment_date);
     295                $date = mysql2date(get_settings('time_format'), $comment_date);
    295296        else
    296                 $date = mysql2date($d, $comment->comment_date);
     297                $date = mysql2date($d, $comment_date);
    297298        return apply_filters('get_comment_time', $date);
    298299}
    299300
     
    670671        return true;
    671672}
    672673
    673 ?>
    674  No newline at end of file
     674?>
  • wp-commentsrss2.php

     
    3030<?php
    3131                if (is_single() || is_page()) {
    3232                        $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,
    33                         comment_author_url, comment_date, comment_content, comment_post_ID,
     33                        comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,
    3434                        $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments
    3535                        LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '$id'
    3636                        AND $wpdb->comments.comment_approved = '1' AND ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'static')
     
    3838                        ORDER BY comment_date DESC LIMIT " . get_settings('posts_per_rss') );
    3939                } else { // if no post id passed in, we'll just ue the last 10 comments.
    4040                        $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,
    41                         comment_author_url, comment_date, comment_content, comment_post_ID,
     41                        comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,
    4242                        $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments
    4343                        LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'static')
    4444                        AND $wpdb->comments.comment_approved = '1' AND post_date < '".date("Y-m-d H:i:s")."' 
     
    5151        <item>
    5252                <title>by: <?php comment_author_rss() ?></title>
    5353                <link><?php comment_link() ?></link>
    54                 <pubDate><?php comment_time('r'); ?></pubDate>
     54                <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate>
    5555                <guid><?php comment_link() ?></guid>
    5656                        <?php
    5757                        if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) {