Use UTC in comments rss feed. http://mosquito.wordpress.org/view.php?id=1256 Props: nbachiyski

git-svn-id: http://svn.automattic.com/wordpress/trunk@2543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-04-19 00:23:55 +00:00
parent 527e544e2f
commit 4780b6f925
2 changed files with 8 additions and 7 deletions

View File

@ -30,7 +30,7 @@ if (have_posts()) :
<?php
if (is_single() || is_page()) {
$comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,
comment_author_url, comment_date, comment_content, comment_post_ID,
comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,
$wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments
LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '$id'
AND $wpdb->comments.comment_approved = '1' AND ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'static')
@ -38,7 +38,7 @@ if (have_posts()) :
ORDER BY comment_date DESC LIMIT " . get_settings('posts_per_rss') );
} else { // if no post id passed in, we'll just ue the last 10 comments.
$comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email,
comment_author_url, comment_date, comment_content, comment_post_ID,
comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,
$wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments
LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'static')
AND $wpdb->comments.comment_approved = '1' AND post_date < '".date("Y-m-d H:i:s")."'
@ -51,7 +51,7 @@ if (have_posts()) :
<item>
<title>by: <?php comment_author_rss() ?></title>
<link><?php comment_link() ?></link>
<pubDate><?php comment_time('r'); ?></pubDate>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate>
<guid><?php comment_link() ?></guid>
<?php
if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) {

View File

@ -288,12 +288,13 @@ function comment_date( $d = '' ) {
echo get_comment_date( $d );
}
function get_comment_time( $d = '' ) {
function get_comment_time( $d = '', $gmt = false ) {
global $comment;
$comment_date = $gmt? $comment->comment_date_gmt : $comment->comment_date;
if ( '' == $d )
$date = mysql2date(get_settings('time_format'), $comment->comment_date);
$date = mysql2date(get_settings('time_format'), $comment_date);
else
$date = mysql2date($d, $comment->comment_date);
$date = mysql2date($d, $comment_date);
return apply_filters('get_comment_time', $date);
}