root/devel-backup/search/rss.php

Revision 92, 0.8 kB (checked in by sven, 3 years ago)

more RSS HTTP

  • Property svn:eol-style set to native
Line 
1 <?php
2
3     //    ELGG search through everything page
4
5     // Run includes
6         require("../includes.php");
7         
8         run("search:init");
9         run("search:all:tagtypes");
10
11         $output = run("search:all:display:rss", $_REQUEST['tag']);
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         }
34 ?>
Note: See TracBrowser for help on using the browser.