diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-19 20:18:40 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-19 20:18:40 +0000 |
commit | c25dcd4533ec98c7e58c647e4b2c08169c6b7dc4 (patch) | |
tree | a8569b30b979a78f0fa052023a2d1dffe03daadf /views/rss/pageshells | |
parent | 5681f47424f7c4b17acb56656135efff420fa09a (diff) | |
download | elgg-c25dcd4533ec98c7e58c647e4b2c08169c6b7dc4.tar.gz elgg-c25dcd4533ec98c7e58c647e4b2c08169c6b7dc4.tar.bz2 |
Automatic RSS feeds!
git-svn-id: https://code.elgg.org/elgg/trunk@1011 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/rss/pageshells')
-rw-r--r-- | views/rss/pageshells/pageshell.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/views/rss/pageshells/pageshell.php b/views/rss/pageshells/pageshell.php new file mode 100644 index 000000000..8a34752bc --- /dev/null +++ b/views/rss/pageshells/pageshell.php @@ -0,0 +1,51 @@ +<?php
+
+ /**
+ * Elgg RSS output pageshell
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ */
+
+ header("Content-Type: text/xml");
+
+ echo "<?xml version='1.0'?>\n";
+
+ if (!$owner = page_owner_entity()) {
+ if (!isloggedin()) {
+ exit;
+ } else {
+ $owner = $vars['user'];
+ }
+ }
+
+ // Set title
+ if (empty($vars['title'])) {
+ $title = $vars['config']->sitename;
+ } else if (empty($vars['config']->sitename)) {
+ $title = $vars['title'];
+ } else {
+ $title = $vars['config']->sitename . ": " . $vars['title'];
+ }
+
+ // Remove RSS from URL
+ $url = str_replace('?view=rss','',full_url());
+ $url = str_replace('&view=rss','',full_url());
+
+?>
+
+<rss version='2.0' xmlns:dc='http://purl.org/dc/elements/1.1/'>
+ <channel xml:base=''>
+ <title><![CDATA[<?php echo $title; ?>]]></title>
+ <link><?php echo $url; ?></link>
+ <?php
+
+ echo $vars['body'];
+
+ ?>
+ </channel>
+</rss>
\ No newline at end of file |