Created a new folder in _templates to house site icons. Put the new RSS standard...
[elgg.git] / _rss / static.php
blob391af30f669b332782a1800293a1909d2c410125
1 <?php
3 require_once(dirname(dirname(__FILE__)).'/includes.php');
5 $userref = optional_param('userref');
6 $username = optional_param('username');
7 $type = optional_param('type');
9 $file = $CFG->dataroot.'rss/'.$userref.'/'.$username.'/'.$type.'.xml';
11 if (!file_exists($file)) {
12 @header('HTTP/1.0 404 Not Found');
13 exit;
15 header("Pragma: public");
16 header("Cache-Control: public");
17 header('Expires: ' . gmdate("D, d M Y H:i:s", (time()+3600)) . " GMT");
20 $if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']);
22 $tstamp = filemtime($file);
23 $lm = gmdate("D, d M Y H:i:s", $tstamp) . " GMT";
25 if ($if_modified_since == $lm) {
26 header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified");
27 exit;
30 // Send last-modified header to enable if-modified-since requests
31 if ($tstamp < time()) {
32 header("Last-Modified: " . $lm);
35 header("Content-type: text/xml; charset=utf-8");
36 readfile($file);