diff options
-rw-r--r-- | start.php | 4 | ||||
-rw-r--r-- | views/rss/extensions/tidypics/channel.php | 1 | ||||
-rw-r--r-- | views/rss/extensions/tidypics/xmlns.php | 1 | ||||
-rw-r--r-- | views/rss/object/album.php | 42 |
4 files changed, 30 insertions, 18 deletions
@@ -35,6 +35,10 @@ //group view ** psuedo widget view for group pages**
extend_view('groups/right_column','tidypics/groupprofile_albums');
+ // rss extensions
+ extend_view('extensions/xmlns', 'extensions/tidypics/xmlns');
+ extend_view('extensions/channel', 'extensions/tidypics/channel');
+
// Register a page handler, so we can have nice URLs
register_page_handler('photos','tidypics_page_handler');
diff --git a/views/rss/extensions/tidypics/channel.php b/views/rss/extensions/tidypics/channel.php new file mode 100644 index 000000000..8b620d15d --- /dev/null +++ b/views/rss/extensions/tidypics/channel.php @@ -0,0 +1 @@ +<description />
\ No newline at end of file diff --git a/views/rss/extensions/tidypics/xmlns.php b/views/rss/extensions/tidypics/xmlns.php new file mode 100644 index 000000000..cb9646dcb --- /dev/null +++ b/views/rss/extensions/tidypics/xmlns.php @@ -0,0 +1 @@ + xmlns:media="http://search.yahoo.com/mrss/"
\ No newline at end of file diff --git a/views/rss/object/album.php b/views/rss/object/album.php index 9f7b7b123..fbe1ab058 100644 --- a/views/rss/object/album.php +++ b/views/rss/object/album.php @@ -12,27 +12,33 @@ if (strlen($subtitle) > 32)
$title .= " ...";
}
+
+ $base_url = $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=';
+
$owner_guid = $album->getOwner();
- $images = get_entities("object", "image", 0, "", 10, 0, false, 0, $album->container_guid);
+ $images = get_entities("object", "image", 0, "", 10, 0, false, 0, $album->guid);
- //error_log(count($images));
+ echo "\n";
+
+ foreach ($images as $image) {
+ $caption = $image->description;
+ if (!$caption)
+ $caption = "No caption";
?>
-
<item>
- <guid isPermaLink='true'><?php echo htmlspecialchars($album->getURL()); ?></guid>
- <pubDate><?php echo date("r",$album->time_created) ?></pubDate>
- <link><?php echo htmlspecialchars($album->getURL()); ?></link>
- <title><![CDATA[<?php echo $title; ?>]]></title>
- <description><![CDATA[<?php echo (autop($album->description)); ?>]]></description> -<?php - $owner = $album->getOwnerEntity(); - if ($owner) - { -?> - <dc:creator><?php echo $owner->name; ?></dc:creator> -<?php - } -?> - <?php echo elgg_view('extensions/item'); ?>
+ <title><?php echo $image->title; ?></title>
+ <link><?php echo $image->getURL(); ?></link>
+ <description><?php echo $caption; ?></description>
+ <pubDate><?php echo date("r", $image->time_created); ?></pubDate>
+ <guid isPermaLink="true"><?php echo $image->getURL(); ?></guid>
+ <media:content url="<?php echo $base_url . $image->guid . '&size=large'; ?>">
+ <media:title><?php echo $image->title; ?></media:title>
+ <media:description><?php echo $caption; ?></media:description>
+ <media:thumbnail url="<?php echo $base_url . $image->guid . '&size=thumb'; ?>"></media:thumbnail>
+ </media:content>
</item>
+
+<?php
+ }
+?>
\ No newline at end of file |