root/releases/elgg0.8rc2/profile/rss2.php

Revision 1030, 2.1 kB (checked in by ben, 2 years ago)

Profiles now have columns, widgets, and assorted joy. This commit doesn't include the Yahoo User Interface library, which has been chosen to handle back-end AJAX.

  • Property svn:eol-style set to native
Line 
1 <?php
2 global $CFG;
3 //    ELGG aggregated RSS 2.0 page
4 // this is now only used for tag-search feeds
5
6 // Run includes
7 require_once(dirname(dirname(__FILE__))."/includes.php");
8
9 run("weblogs:init");
10 run("profile:init");
11
12 global $individual;
13 global $page_owner;
14
15 $individual = 1;
16
17 $sitename = (sitename);
18
19 $tag = trim(optional_param('tag'));
20
21 $output = "";
22
23 if (isset($page_owner)) {
24     
25     $rssactivity = sprintf(__gettext("Activity tagged with %s"),$tag);
26     
27     if ($info = get_record('users','ident',$page_owner)) {
28         $name = stripslashes($info->name);
29         $username = $info->username;
30         $mainurl = url . $username . "/";
31         $rssurl = $mainurl . "rss/" . urlencode(trim($tag));
32         $rssdescription = sprintf(__gettext("Activity for %s, hosted on %s."),$name,$sitename);
33         $output .= <<< END
34 <?xml-stylesheet type="text/xsl" href="{$rssurl}/rssstyles.xsl"?>
35 <rss version='2.0'   xmlns:dc='http://purl.org/dc/elements/1.1/'>
36     <channel xml:base='$mainurl'>
37         <title><![CDATA[$name : $rssactivity]]></title>
38         <description><![CDATA[$rssdescription]]></description>
39         <link>$mainurl</link>
40 END;
41         // WEBLOGS
42         $output .= run("weblogs:rss:getitems", array($page_owner, 10, $tag));
43         
44         // FILES
45         $output .= run("files:rss:getitems", array($page_owner, 10, $tag));
46         
47         $output .= <<< END
48
49     </channel>
50 </rss>
51 END;
52     }
53     
54     if ($output) {
55         header("Pragma: public");
56         header("Cache-Control: public");
57         header('Expires: ' . gmdate("D, d M Y H:i:s", (time()+3600)) . " GMT");
58         
59         $if_none_match = (isset($_SERVER['HTTP_IF_NONE_MATCH'])) ? preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']) : false;
60         
61         $etag = md5($output);
62         header('ETag: "' . $etag . '"');
63         
64         if ($if_none_match && $if_none_match == $etag) {
65             header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified");
66             exit;
67         }
68         
69         header("Content-Length: " . strlen($output));
70         
71         header("Content-type: text/xml; charset=utf-8");
72         echo $output;
73     }
74 }
75 ?>
Note: See TracBrowser for help on using the browser.