Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.96.2.5 diff -u -p -r1.96.2.5 bootstrap.inc --- includes/bootstrap.inc 3 Aug 2006 13:53:15 -0000 1.96.2.5 +++ includes/bootstrap.inc 4 Aug 2006 21:21:12 -0000 @@ -323,7 +323,7 @@ function cache_get($key) { variable_set('cache_flush', 0); } - $cache = db_fetch_object(db_query("SELECT data, created, headers, expire FROM {cache} WHERE cid = '%s'", $key)); + $cache = db_fetch_object(db_query("SELECT data, created, timestamp, headers, expire FROM {cache} WHERE cid = '%s'", $key)); if (isset($cache->data)) { // If the data is permanent or we're not enforcing a minimum cache lifetime // always return the cached data. @@ -369,9 +369,9 @@ function cache_get($key) { */ function cache_set($cid, $data, $expire = CACHE_PERMANENT, $headers = NULL) { db_lock_table('cache'); - db_query("UPDATE {cache} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), $expire, $headers, $cid); + db_query("UPDATE {cache} SET data = %b, created = %d, timestamp = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), drupal_get_cache_date(), $expire, $headers, $cid); if (!db_affected_rows()) { - @db_query("INSERT INTO {cache} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $cid, $data, time(), $expire, $headers); + @db_query("INSERT INTO {cache} (cid, data, created, timestamp, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $cid, $data, time(), drupal_get_cache_date(), $expire, $headers); } db_unlock_tables(); } @@ -511,13 +511,13 @@ function drupal_page_header() { if (variable_get('cache', 0) && $cache = page_get_cache()) { bootstrap_invoke_all('init'); // Set default values: - $date = gmdate('D, d M Y H:i:s', $cache->created) .' GMT'; + $date = gmdate('D, d M Y H:i:s', $cache->timestamp) .' GMT'; $etag = '"'. md5($date) .'"'; // Check http headers: $modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $date : NULL; if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) && ($timestamp = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) > 0) { - $modified_since = $cache->created <= $timestamp; + $modified_since = $cache->timestamp <= $timestamp; } else { $modified_since = NULL; @@ -560,7 +560,7 @@ function drupal_page_header() { } else { header("Expires: Sun, 19 Nov 1978 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s", drupal_get_cache_date()) . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); @@ -568,6 +568,34 @@ function drupal_page_header() { } /** + * Set cache date + */ +function drupal_set_cache_date($date = 0) { + static $cache_date = 0; + + if ($date > $cache_date) { + $cache_date = $date; + } + + return $cache_date; +} + +/** + * Get cache date + */ +function drupal_get_cache_date() { + $date = drupal_set_cache_date(); + $time = time(); + + if ($date < $time && $date > 0) { + return $date; + } + else { + return $time; + } +} + +/** * Define the critical hooks that force modules to always be loaded. */ function bootstrap_hooks() { Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/Attic/comment.module,v retrieving revision 1.455.2.7 diff -u -p -r1.455.2.7 comment.module --- modules/comment.module 18 Jul 2006 10:46:24 -0000 1.455.2.7 +++ modules/comment.module 4 Aug 2006 21:21:13 -0000 @@ -275,6 +275,9 @@ function comment_form_alter($form_id, &$ */ function comment_nodeapi(&$node, $op, $arg = 0) { switch ($op) { + case 'view': + drupal_set_cache_date($node->last_comment_timestamp); + break; case 'load': return db_fetch_array(db_query("SELECT last_comment_timestamp, last_comment_name, comment_count FROM {node_comment_statistics} WHERE nid = %d", $node->nid)); break; Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/Attic/node.module,v retrieving revision 1.641.2.12 diff -u -p -r1.641.2.12 node.module --- modules/node.module 26 Jul 2006 12:12:27 -0000 1.641.2.12 +++ modules/node.module 4 Aug 2006 21:21:14 -0000 @@ -517,6 +517,8 @@ function node_save(&$node) { function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) { $node = (object)$node; + drupal_set_cache_date($node->changed); + // Remove the delimiter (if any) that separates the teaser from the body. // TODO: this strips legitimate uses of '' also. $node->body = str_replace('', '', $node->body); Index: modules/tracker.module =================================================================== RCS file: /cvs/drupal/drupal/modules/Attic/tracker.module,v retrieving revision 1.129 diff -u -p -r1.129 tracker.module --- modules/tracker.module 17 Apr 2006 20:48:26 -0000 1.129 +++ modules/tracker.module 4 Aug 2006 21:21:14 -0000 @@ -97,6 +97,7 @@ function tracker_page($uid = 0) { $result = pager_query($sql, 25, 0, $sql_count); } + $latest = 0; while ($node = db_fetch_object($result)) { // Determine the number of comments: $comments = 0; @@ -116,8 +117,12 @@ function tracker_page($uid = 0) { array('class' => 'replies', 'data' => $comments), t('%time ago', array('%time' => format_interval(time() - $node->last_post))) ); + + $latest = ($node->last_post > $latest) ? $node->last_post : $latest; } + drupal_set_cache_date($latest); + $header = array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last post')); $output = '
';