root/releases/0.673/search/rss.php

Revision 526, 0.9 kB (checked in by ben, 2 years ago)

Context is defined for all search pages.

  • Property svn:eol-style set to native
Line 
1 <?php
2
3 //    ELGG search through everything page
4
5 // Run includes
6 require_once(dirname(dirname(__FILE__))."/includes.php");
7
8 run("search:init");
9 run("search:all:tagtypes");
10
11 define("context","rss");
12
13 $tag = optional_param('tag');
14 $output = run("search:all:display:rss", $tag);
15
16 if ($output) {
17     header("Pragma: public");
18     header("Cache-Control: public");
19     
20     // no time data on this RSS, at least not without rewriting some function outputs
21     
22     $if_none_match = (isset($_SERVER['HTTP_IF_NONE_MATCH'])) ? preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']) : false;
23     
24     $etag = md5($output);
25     
26     if ($if_none_match && $if_none_match == $etag) {
27         header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified");
28         exit;
29     }
30     
31     header("Content-Length: " . strlen($output));
32     header('ETag: "' . $etag . '"');
33     
34     header("Content-Type: text/xml; charset=utf-8");
35     echo $output;
36 }
37 ?>
Note: See TracBrowser for help on using the browser.