Changeset 1799
- Timestamp:
- 10/14/04 08:27:56 (4 years ago)
- Files:
-
- trunk/wp-blog-header.php (modified) (1 diff)
- trunk/wp-commentsrss2.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-blog-header.php
r1759 r1799 115 115 } else { 116 116 // 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'; 118 121 $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"); 121 124 @header ('X-Pingback: ' . get_bloginfo('pingback_url')); 122 125 trunk/wp-commentsrss2.php
r1770 r1799 1 1 <?php 2 if (! $feed) { 2 if ( !$feed ) { 3 $withcomments = 1; 3 4 require('wp-blog-header.php'); 4 5 } trunk/wp-includes/functions.php
r1794 r1799 140 140 } 141 141 return $lastpostmodified; 142 } 143 144 function 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; 142 166 } 143 167
