Changeset 92
- Timestamp:
- 01/11/06 01:00:45 (3 years ago)
- Files:
-
- devel/_files/rss2.php (modified) (1 diff)
- devel/_weblog/rss091.php (modified) (4 diffs)
- devel/_weblog/rss2.php (modified) (1 diff)
- devel/profile/rss2.php (modified) (1 diff)
- devel/search/rss.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/_files/rss2.php
r88 r92 95 95 $if_none_match = preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']); 96 96 97 if (!$trackmaxtime) { 98 $trackmaxtime = time(); 99 } 100 97 101 $lm = gmdate("D, d M Y H:i:s", $trackmaxtime) . " GMT"; 98 102 $etag = md5($output); devel/_weblog/rss091.php
r45 r92 16 16 $individual = 1; 17 17 18 header("Content-type: text/xml"); 18 $output = ""; 19 $trackmaxtime = 0; 19 20 20 21 if (isset($page_owner)) { 21 22 22 echo<<< END23 $output .= <<< END 23 24 <?xml version="1.0"?><!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd"> 24 25 … … 32 33 $sitename = sitename; 33 34 $mainurl = htmlentities(url . $username . "/weblog/"); 34 echo<<< END35 $output .= <<< END 35 36 <channel> 36 37 <title>$name : Weblog</title> … … 43 44 foreach($entries as $entry) { 44 45 $title = htmlentities(stripslashes($entry->title)); 46 $trackmaxtime = max($trackmaxtime, $entry->posted); 45 47 $link = url . $username . "/weblog/" . $entry->ident . ".html"; 46 48 $body = (run("weblogs:text:process",stripslashes($entry->body))); 47 echo<<< END49 $output .= <<< END 48 50 <item> 49 51 <title>$title</title> … … 54 56 } 55 57 } 56 echo<<< END58 $output .= <<< END 57 59 </channel> 58 60 </rss> 59 61 END; 62 } 63 64 if ($output) { 65 header("Pragma: public"); 66 header("Cache-Control: public"); 67 header('Expires: ' . gmdate("D, d M Y H:i:s", (time()+3600)) . " GMT"); 68 69 $if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']); 70 $if_none_match = preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']); 71 72 if (!$trackmaxtime) { 73 $trackmaxtime = time(); 74 } 75 76 $lm = gmdate("D, d M Y H:i:s", $trackmaxtime) . " GMT"; 77 $etag = md5($output); 78 79 if ($if_modified_since == $lm) { 80 header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified"); 81 exit; 82 } 83 if ($if_none_match == $etag) { 84 header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified"); 85 exit; 86 } 87 88 // Send last-modified header to enable if-modified-since requests 89 if ($tstamp < time()) { 90 header("Last-Modified: " . $lm); 91 } 92 93 header("Content-Length: " . strlen($output)); 94 header('ETag: "' . $etag . '"'); 95 96 header("Content-type: text/xml"); 97 echo $output; 98 } 99 100 60 101 } 61 }devel/_weblog/rss2.php
r88 r92 89 89 $if_none_match = preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']); 90 90 91 if (!$trackmaxtime) { 92 $trackmaxtime = time(); 93 } 94 91 95 $lm = gmdate("D, d M Y H:i:s", $trackmaxtime) . " GMT"; 92 96 $etag = md5($output); devel/profile/rss2.php
r88 r92 129 129 $if_none_match = preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']); 130 130 131 if (!$trackmaxtime) { 132 $trackmaxtime = time(); 133 } 134 131 135 $lm = gmdate("D, d M Y H:i:s", $trackmaxtime) . " GMT"; 132 136 $etag = md5($output); devel/search/rss.php
r45 r92 9 9 run("search:all:tagtypes"); 10 10 11 header("Content-Type: text/xml"); 12 echo run("search:all:display:rss", $_REQUEST['tag']); 11 $output = run("search:all:display:rss", $_REQUEST['tag']); 13 12 13 if ($output) { 14 header("Pragma: public"); 15 header("Cache-Control: public"); 16 17 // no time data on this RSS, at least not without rewriting some function outputs 18 19 $if_none_match = preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']); 20 21 $etag = md5($output); 22 23 if ($if_none_match == $etag) { 24 header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified"); 25 exit; 26 } 27 28 header("Content-Length: " . strlen($output)); 29 header('ETag: "' . $etag . '"'); 30 31 header("Content-type: text/xml"); 32 echo $output; 33 } 14 34 ?>
