aboutsummaryrefslogtreecommitdiff
path: root/views/rss/page
diff options
context:
space:
mode:
Diffstat (limited to 'views/rss/page')
-rw-r--r--views/rss/page/components/creator.php14
-rw-r--r--views/rss/page/components/georss.php15
-rw-r--r--views/rss/page/default.php17
-rw-r--r--views/rss/page/elements/comments.php13
4 files changed, 49 insertions, 10 deletions
diff --git a/views/rss/page/components/creator.php b/views/rss/page/components/creator.php
new file mode 100644
index 000000000..a14f1dbca
--- /dev/null
+++ b/views/rss/page/components/creator.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Creator view
+ *
+ * Implements Dublin Core creator
+ *
+ * @uses $vars['entity']
+ */
+
+$owner = $vars['entity']->getOwnerEntity();
+if ($owner) {
+ $owner_name = htmlspecialchars($owner->name, ENT_NOQUOTES, 'UTF-8');
+ echo "<dc:creator>$owner_name</dc:creator>";
+}
diff --git a/views/rss/page/components/georss.php b/views/rss/page/components/georss.php
new file mode 100644
index 000000000..d176b8cac
--- /dev/null
+++ b/views/rss/page/components/georss.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * GeoRSS view
+ *
+ * This implements GeoRSS-Simple
+ *
+ * @uses $vars['entity']
+ */
+
+$longitude = $vars['entity']->getLongitude();
+$latitude = $vars['entity']->getLatitude();
+
+if ($vars['entity'] instanceof Locatable && $longitude && $latitude) {
+ echo "<georss:point>$latitude $longitude</georss:point>";
+}
diff --git a/views/rss/page/default.php b/views/rss/page/default.php
index cd94b0242..246ec972e 100644
--- a/views/rss/page/default.php
+++ b/views/rss/page/default.php
@@ -4,7 +4,6 @@
*
* @package Elgg
* @subpackage Core
- *
*/
header("Content-Type: text/xml");
@@ -12,7 +11,7 @@ header("Content-Type: text/xml");
// allow caching as required by stupid MS products for https feeds.
header('Pragma: public', TRUE);
-echo "<?xml version='1.0'?>\n";
+echo "<?xml version='1.0'?>";
// Set title
if (empty($vars['title'])) {
@@ -22,8 +21,8 @@ if (empty($vars['title'])) {
}
// Remove RSS from URL
-$url = str_replace('?view=rss','', full_url());
-$url = str_replace('&view=rss','', $url);
+$url = str_replace('?view=rss', '', full_url());
+$url = str_replace('&view=rss', '', $url);
?>
@@ -32,11 +31,9 @@ $url = str_replace('&view=rss','', $url);
<title><![CDATA[<?php echo $title; ?>]]></title>
<link><?php echo htmlentities($url); ?></link>
<description></description>
- <?php echo elgg_view('extensions/channel'); ?>
- <?php
-
- echo $vars['body'];
-
- ?>
+<?php
+ echo elgg_view('extensions/channel');
+ echo $vars['body'];
+?>
</channel>
</rss>
diff --git a/views/rss/page/elements/comments.php b/views/rss/page/elements/comments.php
new file mode 100644
index 000000000..9c655ffef
--- /dev/null
+++ b/views/rss/page/elements/comments.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * RSS comments view
+ *
+ * @uses $vars['entity']
+ */
+
+$options = array(
+ 'guid' => $vars['entity']->getGUID(),
+ 'annotation_name' => 'generic_comment',
+ 'order_by' => 'n_table.time_created desc',
+);
+echo elgg_list_annotations($options);