summaryrefslogtreecommitdiff
path: root/modules/media_rss/views/feed.mrss.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-11-20 02:59:43 +0000
committerBharat Mediratta <bharat@menalto.com>2008-11-20 02:59:43 +0000
commit611627231b6a712053e05734d7509b1d3751151b (patch)
tree84ef749090c5d43582b9b93f02b50104176a6d17 /modules/media_rss/views/feed.mrss.php
parentc3fc1cb7ec91783a7953486c8a83aa8008dd5406 (diff)
Clean up the MediaRSS module a little bit:
* Media_RSS_Controller::$LIMIT is now self::$page_size * We use ORM_MPTT descendant_counts() * If the page is out of bounds, put it on a boundary * Move pub_date into the controller to simplify the mrss file * Put all the view assignment in one block for easier reading * Removed stray ; from the end of lines in the mrss file Clean up ORM_MPTT a bit: * fix spelling: decendent -> descendant * Remove unnecessary order_by() clauses * Set the default for $type to null (not "all").
Diffstat (limited to 'modules/media_rss/views/feed.mrss.php')
-rw-r--r--modules/media_rss/views/feed.mrss.php33
1 files changed, 16 insertions, 17 deletions
diff --git a/modules/media_rss/views/feed.mrss.php b/modules/media_rss/views/feed.mrss.php
index 8c88b8a2..b3f44a17 100644
--- a/modules/media_rss/views/feed.mrss.php
+++ b/modules/media_rss/views/feed.mrss.php
@@ -1,5 +1,5 @@
<? defined("SYSPATH") or die("No direct script access."); ?>
-<? echo "<?xml version=\"1.0\" ?>"; ?>
+<? echo "<?xml version=\"1.0\" ?>" ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
@@ -7,21 +7,20 @@
<link><?= url::abs_site("albums/{$item->id}") ?></link>
<description><?= $item->description ?></description>
<language>en-us</language>
- <atom:link rel="self" href="<?= url::abs_site("media_rss/feed/{$item->id}") ?>" type="application/rss+xml" />
- <? if (isset($prevOffset)): ?>
- <atom:link rel="previous" href="<?= url::abs_site("media_rss/feed/{$item->id}?offset={$prevOffset}") ?>"
- type="application/rss+xml" />
- <? endif; ?>
- <? if (isset($nextOffset)): ?>
- <atom:link rel="next" href="<?= url::abs_site("media_rss/feed/{$item->id}?offset={$nextOffset}") ?>"
- type="application/rss+xml" />
- <? endif; ?>
- <?
- // @todo do we want to add an upload date to the items table?
- $date = date("D, d M Y H:i:s T");
- ?>
- <pubDate><?= $date ?></pubDate>
- <lastBuildDate><?= $date ?></lastBuildDate>
+ <atom:link rel="self" href="<?= url::abs_site("media_rss/feed/{$item->id}") ?>"
+ type="application/rss+xml" />
+ <? if ($previous_page): ?>
+ <atom:link rel="previous"
+ href="<?= url::abs_site("media_rss/feed/{$item->id}?page=$previous_page") ?>"
+ type="application/rss+xml" />
+ <? endif ?>
+ <? if ($next_page): ?>
+ <atom:link rel="next"
+ href="<?= url::abs_site("media_rss/feed/{$item->id}?page=$next_page") ?>"
+ type="application/rss+xml" />
+ <? endif ?>
+ <pubDate><?= $pub_date ?></pubDate>
+ <lastBuildDate><?= $pub_date ?></lastBuildDate>
<? foreach ($children as $child): ?>
<item>
<title><?= $child->title ?></title>
@@ -46,6 +45,6 @@
/>
</media:group>
</item>
- <? endforeach; ?>
+ <? endforeach ?>
</channel>
</rss>