Changeset 1799

Show
Ignore:
Timestamp:
10/14/04 08:27:56 (4 years ago)
Author:
saxmatt
Message:

Fix for bug 137. Patch from kelson.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-blog-header.php

    r1759 r1799  
    115115} else { 
    116116    // We're showing a feed, so WP is indeed the only thing that last changed 
    117     $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; 
     117    if ( $withcomments ) 
     118        $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT'; 
     119    else  
     120        $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; 
    118121    $wp_etag = '"' . md5($wp_last_modified) . '"'; 
    119     @header('Last-Modified: '.$wp_last_modified); 
    120     @header('ETag: '.$wp_etag); 
     122    @header("Last-Modified: $wp_last_modified"); 
     123    @header("ETag: $wp_etag"); 
    121124    @header ('X-Pingback: ' . get_bloginfo('pingback_url')); 
    122125 
  • trunk/wp-commentsrss2.php

    r1770 r1799  
    11<?php  
    2 if (! $feed) { 
     2if ( !$feed ) { 
     3    $withcomments = 1; 
    34    require('wp-blog-header.php'); 
    45} 
  • trunk/wp-includes/functions.php

    r1794 r1799  
    140140    } 
    141141    return $lastpostmodified; 
     142} 
     143 
     144function get_lastcommentmodified($timezone = 'server') { 
     145    global $tablecomments, $cache_lastcommentmodified, $pagenow, $wpdb; 
     146    $add_seconds_blog = get_settings('gmt_offset') * 3600; 
     147    $add_seconds_server = date('Z'); 
     148    $now = current_time('mysql', 1); 
     149    if ( !isset($cache_lastcommentmodified[$timezone]) ) { 
     150        switch(strtolower($timezone)) { 
     151            case 'gmt': 
     152                $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); 
     153                break; 
     154            case 'blog': 
     155                $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); 
     156                break; 
     157            case 'server': 
     158                $lastcommentmodified = $wpdb->get_var("SELECT DATE_ADD(comment_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); 
     159                break; 
     160        } 
     161        $cache_lastcommentmodified[$timezone] = $lastcommentmodified; 
     162    } else { 
     163        $lastcommentmodified = $cache_lastcommentmodified[$timezone]; 
     164    } 
     165    return $lastcommentmodified; 
    142166} 
    143167