summaryrefslogtreecommitdiff
path: root/modules/tag
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tag')
-rw-r--r--modules/tag/helpers/tag_rss.php35
1 files changed, 20 insertions, 15 deletions
diff --git a/modules/tag/helpers/tag_rss.php b/modules/tag/helpers/tag_rss.php
index dbef3914..f94508cf 100644
--- a/modules/tag/helpers/tag_rss.php
+++ b/modules/tag/helpers/tag_rss.php
@@ -19,23 +19,28 @@
*/
class tag_rss_Core {
- static function available_feeds($item) {
- return array(array("description" => t("Tag Album feed"),
- "uri" => "tags"));
- }
-
- static function tags($offset, $limit, $id) {
- $tag = ORM::factory("tag", $id);
- if (!$tag->loaded) {
- return Kohana::show_404();
+ static function available_feeds($item, $tag) {
+ if ($tag) {
+ $feeds["tag/tag/{$tag->id}"] =
+ t("Tag feed for %tag_name", array("tag_name" => p::clean($tag->name)));
+ return $feeds;
}
+ return array();
+ }
- $feed->children = $tag->items($limit, $offset, "photo");
- $feed->max_pages = ceil($tag->count / $limit);
- $feed->title = $tag->name;
- $feed->link = url::abs_site("tags/{$tag->id}");
- $feed->description = t("Photos related to %tag_name", array("tag_name" => $tag->name));
+ static function feed($feed_id, $offset, $limit, $id) {
+ if ($feed_id == "tag") {
+ $tag = ORM::factory("tag", $id);
+ if (!$tag->loaded) {
+ Kohana::show_404();
+ }
+ $feed->children = $tag->items($limit, $offset, "photo");
+ $feed->max_pages = ceil($tag->count / $limit);
+ $feed->title = $tag->name;
+ $feed->link = url::abs_site("tags/{$tag->id}");
+ $feed->description = t("Photos related to %tag_name", array("tag_name" => $tag->name));
- return $feed;
+ return $feed;
+ }
}
}