Changeset 559 for trunk/wp-rss.php
- Timestamp:
- 11/30/2003 12:55:19 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-rss.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-rss.php
r558 r559 2 2 In every template you do, you got to copy them before the CafeLog 'loop' */ 3 3 $blog = 1; // enter your blog's ID 4 $doing_rss =1;4 $doing_rss = 1; 5 5 header('Content-type: text/xml',true); 6 6 include('blog.header.php'); … … 9 9 10 10 // Get the time of the most recent article 11 $sql = "SELECT max(post_date) FROM $tableposts"; 12 13 $maxdate = $wpdb->get_var($sql); 11 $maxdate = $wpdb->get_var("SELECT max(post_date) FROM $tableposts"); 14 12 ++$querycount; 15 13 $unixtime = strtotime($maxdate); 16 14 17 15 // format timestamp for Last-Modified header 18 $clast = gmdate("D, d M Y H:i:s \G\M\T", $unixtime);19 $cetag = md5($last);16 $clast = gmdate("D, d M Y H:i:s \G\M\T", $unixtime); 17 $cetag = (isset($last)) ? md5($last) : ''; 20 18 21 $slast = $_SERVER['HTTP_IF_MODIFIED_SINCE'];22 $setag = $_SERVER['HTTP_IF_NONE_MATCH'];19 $slast = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : '' ; 20 $setag = (isset($_SERVER['HTTP_IF_NONE_MATCH'])) ? $_SERVER['HTTP_IF_NONE_MATCH'] : ''; 23 21 24 22 // send it in a Last-Modified header … … 33 31 // generated values. 34 32 //if (($slast?($slast == $clast):true) && ($setag?($setag == $cetag):true)){ 35 if (($slast && $setag)?(($slast == $clast) && ($setag == $cetag)):(($slast == $clast) || ($setag == $cetag))) { 36 header("HTTP/1.1 304 Not Modified"); 37 echo "\r\n\r\n"; 38 exit; 33 if (($slast != '') && ($setag != '')) { 34 if (($slast == $clast) && ($setag == $cetag)) { 35 header("HTTP/1.1 304 Not Modified"); 36 echo "\r\n\r\n"; 37 exit; 38 } else if (($slast == $clast) 39 || ($setag == $cetag)) { 40 header("HTTP/1.1 304 Not Modified"); 41 echo "\r\n\r\n"; 42 exit; 43 } 39 44 } 40 45
Note: See TracChangeset
for help on using the changeset viewer.