Changeset 568 for trunk/wp-rdf.php
- Timestamp:
- 12/05/2003 01:21:09 AM (23 years ago)
- File:
-
- 1 edited
-
trunk/wp-rdf.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-rdf.php
r558 r568 1 1 <?php /* RDF 1.0 generator, original version by garym@teledyn.com */ 2 2 $blog = 1; // enter your blog's ID 3 $doing_rss=1; 4 header('Content-type: text/xml'); 5 3 $doing_rss = 1; 4 header('Content-type: text/xml', true); 6 5 include('blog.header.php'); 7 6 8 // Handle Conditional GET9 10 7 // Get the time of the most recent article 11 $sql = "SELECT max(post_date) FROM $tableposts"; 12 13 $maxdate = $wpdb->get_var($sql); 14 ++$querycount; 8 $maxdate = $wpdb->get_var("SELECT max(post_date) FROM $tableposts"); 15 9 $unixtime = strtotime($maxdate); 16 10 17 11 // format timestamp for Last-Modified header 18 $clast = gmdate("D, d M Y H:i:s \G\M\T",$unixtime); 19 $cetag = md5($last); 20 21 $slast = $_SERVER['HTTP_IF_MODIFIED_SINCE']; 22 $setag = $_SERVER['HTTP_IF_NONE_MATCH']; 12 $clast = gmdate("D, d M Y H:i:s \G\M\T", $unixtime); 13 $cetag = (isset($clast)) ? md5($clast) : ''; 23 14 24 15 // send it in a Last-Modified header 25 16 header("Last-Modified: " . $clast, true); 26 17 header("Etag: " . $cetag, true); 27 28 // compare it to aggregator's If-Modified-Since and If-None-Match headers29 // if they match, send a 304 and die30 31 // This logic says that if only one header is provided, just use that one,32 // but if both headers exist, they *both* must match up with the locally33 // generated values.34 //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;39 }40 18 41 19 add_filter('the_content', 'trim');
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)