From b0e7dded2362de6cc7b2bfad47286de322d79064 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 14 Jun 2009 08:15:32 +0800 Subject: Add a warning about eAccelerator interfering with g2_import. Signed-off-by: --- modules/g2_import/views/admin_g2_import.html.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index c0ee2b17..d5e29e12 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -3,7 +3,10 @@

- Note: The importer is a work in progress and does not currently support permissions, and movie formats other than Flash video and MP4") ?> +
+ Note: The importer is a work in progress and does not currently support permissions, and movie formats other than Flash video and MP4") ?> +
+ Note: The importer has known issues with the eAccelerator PHP accelerator. If you're using eAccelerator, please disable it. One way to do that is to put php_value eaccelerator.enable 0 in gallery3/.htaccess") ?>

-- cgit v1.2.3 From fda706f55cab4bd65b90e25a82b59a83e40443ed Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 15 Jun 2009 01:41:34 +0800 Subject: Get rid of the word "items" in the delete confirmation dialog. Signed-off-by: --- modules/gallery/controllers/quick.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 30383307..cff6686b 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -101,7 +101,9 @@ class Quick_Controller extends Controller { access::required("edit", $item); if ($item->is_album()) { - print t("Delete the album %title? All items within the album will also be deleted.", array("title" => $item->title)); + print t( + "Delete the album %title? All photos and movies in the album will also be deleted.", + array("title" => $item->title)); } else { print t("Are you sure you want to delete %title?", array("title" => $item->title)); } -- cgit v1.2.3 From 10d9c6a92ac0002b4838d6a4056fe9cce5b934ba Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 15 Jun 2009 01:13:12 +0800 Subject: Rename Rss_Controller::__call to Rss_Controller::feed, which changes the feed url to rss/feed//[] Where feed name is the name of the feed (i.e. albums, updates, comments, tags etc.) and id is the optional element id that the feed applies to. Signed-off-by: --- modules/rss/controllers/rss.php | 5 ++--- modules/rss/helpers/rss.php | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php index 164803cb..8cf083db 100644 --- a/modules/rss/controllers/rss.php +++ b/modules/rss/controllers/rss.php @@ -20,10 +20,9 @@ class Rss_Controller extends Controller { public static $page_size = 30; - public function __call($method, $arguments) { - $id = empty($arguments) ? null : $arguments[0]; + public function feed($method, $id=null) { $page = $this->input->get("page", 1); - $feed_uri = "rss/$method" . (empty($id) ? "" : "/$id"); + $feed_uri = "rss/feed/$method" . (empty($id) ? "" : "/$id"); if ($page < 1) { url::redirect($feed_uri); } diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index 1d30425f..3c278b49 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -21,11 +21,11 @@ class rss_Core { static function item_feed($item) { $id = $item->is_album() ? $item->id : $item->parent_id; - return url::site("rss/albums/$id"); + return url::site("rss/feed/albums/$id"); } static function tag_feed($tag) { - return url::site("rss/tags/$tag->id}"); + return url::site("rss/feed/tags/$tag->id}"); } /** @@ -40,7 +40,7 @@ class rss_Core { if ($sidebar_only && !$feed["sidebar"]) { continue; } - $feeds[$feed["description"]] = url::site("rss/{$feed['uri']}"); + $feeds[$feed["description"]] = url::site("rss/feed/{$feed['uri']}"); } } } -- cgit v1.2.3 From 879e81f0a1fc4477a8e563d45348330706b6da8a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 15 Jun 2009 02:20:08 +0800 Subject: Rename: rss::get_feeds() -> rss::available_feeds() rss::process_feed() -> rss::feed_data() Signed-off-by: --- modules/rss/controllers/rss.php | 2 +- modules/rss/helpers/rss.php | 4 ++-- modules/rss/helpers/rss_theme.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php index 8cf083db..8c3544e4 100644 --- a/modules/rss/controllers/rss.php +++ b/modules/rss/controllers/rss.php @@ -27,7 +27,7 @@ class Rss_Controller extends Controller { url::redirect($feed_uri); } - $feed = rss::process_feed($method, ($page - 1) * self::$page_size, self::$page_size, $id); + $feed = rss::feed_data($method, ($page - 1) * self::$page_size, self::$page_size, $id); if ($feed->max_pages && $page > $feed->max_pages) { url::redirect("$feed_uri?page={$feed->max_pages}"); } diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index 3c278b49..cf42ec28 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -31,7 +31,7 @@ class rss_Core { /** * Get all available rss feeds */ - static function get_feeds($item, $sidebar_only=true) { + static function available_feeds($item, $sidebar_only=true) { $feeds = array(); foreach (module::active() as $module) { $class_name = "{$module->name}_rss"; @@ -48,7 +48,7 @@ class rss_Core { return $feeds; } - static function process_feed($feed, $offset, $limit, $id) { + static function feed_data($feed, $offset, $limit, $id) { foreach (module::active() as $module) { $class_name = "{$module->name}_rss"; if (method_exists($class_name, $feed)) { diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index b82133bd..0f12b475 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -40,7 +40,7 @@ class rss_theme_Core { $block->css_id = "gRss"; $block->title = t("Available RSS Feeds"); $block->content = new View("rss_block.html"); - $block->content->feeds = rss::get_feeds($theme->item()); + $block->content->feeds = rss::available_feeds($theme->item()); return $block; } -- cgit v1.2.3 From fdbffc870d84ec035068420f5a8b4292d7aade13 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 15 Jun 2009 02:39:53 +0800 Subject: Remove rss:item_feed, rss::tag_fead and rss_theme::head and move that functionality in the _theme::head function. Created rss::feed_link to wrap the module supplied uri in the html link element. Signed-off-by: --- modules/gallery/helpers/gallery_theme.php | 4 ++++ modules/rss/helpers/rss.php | 10 +++------- modules/rss/helpers/rss_theme.php | 12 ------------ modules/tag/helpers/tag_theme.php | 6 +++++- 4 files changed, 12 insertions(+), 20 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index f955e8f7..290434ed 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -42,6 +42,10 @@ class gallery_theme_Core { $buf .= html::script("modules/gallery/js/fullsize.js"); } + if ($theme->item()) { + $buf .= rss::feed_link("albums/{$theme->item()->id}"); + } + if ($session->get("l10n_mode", false)) { $buf .= ""; diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index cf42ec28..e4d6f5e9 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -19,13 +19,9 @@ */ class rss_Core { - static function item_feed($item) { - $id = $item->is_album() ? $item->id : $item->parent_id; - return url::site("rss/feed/albums/$id"); - } - - static function tag_feed($tag) { - return url::site("rss/feed/tags/$tag->id}"); + static function feed_link($uri) { + $url = url::site("rss/feed/$uri"); + return ""; } /** diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index 0f12b475..52d988bf 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -18,18 +18,6 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class rss_theme_Core { - static function head($theme) { - if ($theme->item()) { - $url = rss::item_feed($theme->item()); - } else if ($theme->tag()) { - $url = rss::tag_feed($theme->tag()); - } - - if (!empty($url)) { - return ""; - } - } - static function sidebar_blocks($theme) { // @todo this needs to be data driven if (!$theme->item()) { diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index a32d71b6..45f55986 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -20,7 +20,11 @@ class tag_theme_Core { static function head($theme) { $url = url::file("modules/tag/js/tag.js"); - return ""; + $head[] = ""; + if ($theme->tag() && module::is_active("rss")) { + $head[] = rss::feed_link("tags/{$theme->tag()->id}"); + } + return implode("\n", $head); } static function sidebar_blocks($theme) { -- cgit v1.2.3 From 6007843c4acf3a83580989351de73ae64a2e61ed Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 15 Jun 2009 03:09:47 +0800 Subject: Remove the sidebar flag from the feed definition returned by available_feeds and replace with a type field with one of two values (head and block). We need to do this to determine what fields go in the rss block so we can ignore the definitions that are related to the page head when creating the rss block that goes into the sidebar. Signed-off-by: --- modules/comment/helpers/comment_rss.php | 4 ++-- modules/gallery/helpers/gallery_rss.php | 4 ++-- modules/rss/helpers/rss.php | 7 +++---- modules/tag/helpers/tag_rss.php | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) (limited to 'modules') diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index b191c326..2e958eef 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -21,10 +21,10 @@ class comment_rss_Core { static function available_feeds($item) { return array(array("description" => t("All new comments"), - "sidebar" => true, + "type" => "block", "uri" => "comments"), array("description" => sprintf(t("Comments on %s"), $item->title), - "sidebar" => true, + "type" => "block", "uri" => "comments/{$item->id}")); } diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index 6e722ff6..455e210f 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -21,10 +21,10 @@ class gallery_rss_Core { static function available_feeds($item) { return array(array("description" => t("New photos or movies"), - "sidebar" => true, + "type" => "block", "uri" => "updates"), array("description" => t("Album feed"), - "sidebar" => false, + "type" => "head", "uri" => "albums")); } diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index e4d6f5e9..403ee225 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -27,16 +27,15 @@ class rss_Core { /** * Get all available rss feeds */ - static function available_feeds($item, $sidebar_only=true) { + static function available_feeds($item) { $feeds = array(); foreach (module::active() as $module) { $class_name = "{$module->name}_rss"; if (method_exists($class_name, "available_feeds")) { foreach (call_user_func(array($class_name, "available_feeds"), $item) as $feed) { - if ($sidebar_only && !$feed["sidebar"]) { - continue; + if ($feed["type"] == "block") { + $feeds[$feed["description"]] = url::site("rss/feed/{$feed['uri']}"); } - $feeds[$feed["description"]] = url::site("rss/feed/{$feed['uri']}"); } } } diff --git a/modules/tag/helpers/tag_rss.php b/modules/tag/helpers/tag_rss.php index ace7fd6a..7846edf6 100644 --- a/modules/tag/helpers/tag_rss.php +++ b/modules/tag/helpers/tag_rss.php @@ -21,7 +21,7 @@ class tag_rss_Core { static function available_feeds($item) { return array(array("description" => t("Tag Album feed"), - "sidebar" => false, + "type" => "head", "uri" => "tags")); } -- cgit v1.2.3 From 83d1b15c1e9ca89cc55879a5582cd9abafc5a792 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 15 Jun 2009 03:38:57 +0800 Subject: Don't use stdClass to return the feed data. Just use an array. Signed-off-by: --- modules/comment/helpers/comment_rss.php | 15 +++++++-------- modules/gallery/helpers/gallery_rss.php | 22 ++++++++++------------ modules/rss/controllers/rss.php | 14 +++++++++----- modules/tag/helpers/tag_rss.php | 11 +++++------ 4 files changed, 31 insertions(+), 31 deletions(-) (limited to 'modules') diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index 2e958eef..56de4284 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -29,7 +29,6 @@ class comment_rss_Core { } static function comments($offset, $limit, $id) { - $feed = new stdClass(); $orm = ORM::factory("comment") ->where("state", "published") ->orderby("created", "DESC"); @@ -37,12 +36,12 @@ class comment_rss_Core { $orm->where("item_id", $id); } - $feed->view = "comment.mrss"; + $feed["view"] = "comment.mrss"; $comments = $orm->find_all($limit, $offset); - $feed->data["children"] = array(); + $feed["children"] = array(); foreach ($comments as $comment) { $item = $comment->item(); - $feed->data["children"][] = array( + $feed["children"][] = array( "pub_date" => date("D, d M Y H:i:s T", $comment->created), "text" => htmlspecialchars($comment->text), "thumb_url" => $item->thumb_url(), @@ -55,10 +54,10 @@ class comment_rss_Core { ); } - $feed->max_pages = ceil($comments->count() / $limit); - $feed->data["title"] = htmlspecialchars(t("Recent Comments")); - $feed->data["link"] = url::abs_site("albums/" . (empty($id) ? "1" : $id)); - $feed->data["description"] = t("Recent Comments"); + $feed["max_pages"] = ceil($comments->count() / $limit); + $feed["title"] = htmlspecialchars(t("Recent Comments")); + $feed["link"] = url::abs_site("albums/" . (empty($id) ? "1" : $id)); + $feed["description"] = t("Recent Comments"); return $feed; } diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index 455e210f..6535d29d 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -29,16 +29,15 @@ class gallery_rss_Core { } static function updates($offset, $limit) { - $feed = new stdClass(); - $feed->data["children"] = ORM::factory("item") + $feed["children"] = ORM::factory("item") ->viewable() ->where("type !=", "album") ->orderby("created", "DESC") ->find_all($limit, $offset); - $feed->max_pages = ceil($feed->data["children"]->count() / $limit); - $feed->data["title"] = t("Recent Updates"); - $feed->data["link"] = url::abs_site("albums/1"); - $feed->data["description"] = t("Recent Updates"); + $feed["max_pages"] = ceil($feed["children"]->count() / $limit); + $feed["title"] = t("Recent Updates"); + $feed["link"] = url::abs_site("albums/1"); + $feed["description"] = t("Recent Updates"); return $feed; } @@ -47,14 +46,13 @@ class gallery_rss_Core { $item = ORM::factory("item", $id); access::required("view", $item); - $feed = new stdClass(); - $feed->data["children"] = $item + $feed["children"] = $item ->viewable() ->descendants($limit, $offset, "photo"); - $feed->max_pages = ceil($item->viewable()->descendants_count("photo") / $limit); - $feed->data["title"] = $item->title; - $feed->data["link"] = url::abs_site("albums/{$item->id}"); - $feed->data["description"] = $item->description; + $feed["max_pages"] = ceil($item->viewable()->descendants_count("photo") / $limit); + $feed["title"] = $item->title; + $feed["link"] = url::abs_site("albums/{$item->id}"); + $feed["description"] = $item->description; return $feed; } diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php index 8c3544e4..80803dfd 100644 --- a/modules/rss/controllers/rss.php +++ b/modules/rss/controllers/rss.php @@ -28,12 +28,16 @@ class Rss_Controller extends Controller { } $feed = rss::feed_data($method, ($page - 1) * self::$page_size, self::$page_size, $id); - if ($feed->max_pages && $page > $feed->max_pages) { - url::redirect("$feed_uri?page={$feed->max_pages}"); + $max_pages = $feed["max_pages"]; + if ($max_pages && $page > $max_pages) { + url::redirect("$feed_uri?page={$max_pages}"); } + unset($feed["max_pages"]); - $view = new View(empty($feed->view) ? "feed.mrss" : $feed->view); - foreach ($feed->data as $field => $value) { + $view = new View(empty($feed["view"]) ? "feed.mrss" : $feed["view"]); + unset($feed["view"]); + + foreach ($feed as $field => $value) { $view->$field = $value; } $view->feed_link = url::abs_site($feed_uri); @@ -43,7 +47,7 @@ class Rss_Controller extends Controller { $view->previous_page_link = url::site("$feed_uri?page={$previous_page}"); } - if ($page < $feed->max_pages) { + if ($page < $max_pages) { $next_page = $page + 1; $view->next_page_link = url::site("$feed_uri?page={$next_page}"); } diff --git a/modules/tag/helpers/tag_rss.php b/modules/tag/helpers/tag_rss.php index 7846edf6..3d6399ca 100644 --- a/modules/tag/helpers/tag_rss.php +++ b/modules/tag/helpers/tag_rss.php @@ -31,12 +31,11 @@ class tag_rss_Core { return Kohana::show_404(); } - $feed = new stdClass(); - $feed->data["children"] = $tag->items($limit, $offset, "photo"); - $feed->max_pages = ceil($tag->count / $limit); - $feed->data["title"] = $tag->name; - $feed->data["link"] = url::abs_site("tags/{$tag->id}"); - $feed->data["description"] = t("Photos related to %tag_name", array("tag_name" => $tag->name)); + $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; } -- cgit v1.2.3 From 08a5b753453057dedb4c8d25bd68264f92ac0fb8 Mon Sep 17 00:00:00 2001 From: unostar Date: Mon, 15 Jun 2009 02:02:25 -0700 Subject: Add string to localizer --- modules/user/views/admin_users.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index 68486e6d..542b8b8b 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -60,7 +60,7 @@ - Actions + $user): ?> -- cgit v1.2.3 From 2ecb00c492c1312e7214c5bb1c2d256225cf2c73 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 15 Jun 2009 03:43:06 +0800 Subject: Trap gallery2 errors when we try to load an invalid user id and abort loading that user. Signed-off-by: --- modules/g2_import/helpers/g2_import.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 33cfc158..30ddda50 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -253,7 +253,14 @@ class g2_import_Core { $g2_admin_group_id = g2(GalleryCoreApi::getPluginParameter("module", "core", "id.adminGroup")); - $g2_user = g2(GalleryCoreApi::loadEntitiesById($g2_user_id)); + try { + $g2_user = g2(GalleryCoreApi::loadEntitiesById($g2_user_id)); + } catch (Exception $e) { + $msg = t("Failed to import Gallery 2 user with id: %id", array("id" => $g2_user_id)); + Kohana::log("alert", $msg); + message::warning($msg); + return; + } $g2_groups = g2(GalleryCoreApi::fetchGroupsForUser($g2_user->getId())); try { -- cgit v1.2.3 From 3b684655e2afcb6d24885c98a7821db4d6db4e07 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 15 Jun 2009 07:40:57 +0800 Subject: Refactor feed code to use stdClass everywhere. Fix bugs in the max-pages calculation code. Move feed related data into the $feed variable and only pass that to the view. Signed-off-by: --- modules/comment/helpers/comment_rss.php | 48 +++++++++++++++++---------------- modules/comment/views/comment.mrss.php | 34 +++++++++++------------ modules/gallery/helpers/gallery_rss.php | 28 ++++++++++--------- modules/rss/controllers/rss.php | 19 ++++++------- modules/rss/helpers/rss.php | 6 ++--- modules/rss/views/feed.mrss.php | 18 ++++++------- modules/tag/helpers/tag_rss.php | 11 ++++---- 7 files changed, 82 insertions(+), 82 deletions(-) (limited to 'modules') diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index 56de4284..c3eb7b2b 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -21,43 +21,45 @@ class comment_rss_Core { static function available_feeds($item) { return array(array("description" => t("All new comments"), - "type" => "block", "uri" => "comments"), array("description" => sprintf(t("Comments on %s"), $item->title), - "type" => "block", "uri" => "comments/{$item->id}")); } static function comments($offset, $limit, $id) { - $orm = ORM::factory("comment") + $comments = ORM::factory("comment") ->where("state", "published") ->orderby("created", "DESC"); - if (!empty($id)) { - $orm->where("item_id", $id); + if ($id) { + $comments->where("item_id", $id); } - $feed["view"] = "comment.mrss"; - $comments = $orm->find_all($limit, $offset); - $feed["children"] = array(); + $feed->view = "comment.mrss"; + $comments = $comments->find_all($limit, $offset); + $feed->children = array(); foreach ($comments as $comment) { $item = $comment->item(); - $feed["children"][] = array( - "pub_date" => date("D, d M Y H:i:s T", $comment->created), - "text" => htmlspecialchars($comment->text), - "thumb_url" => $item->thumb_url(), - "thumb_height" => $item->thumb_height, - "thumb_width" => $item->thumb_width, - "item_link" => htmlspecialchars(url::abs_site("{$item->type}s/$item->id")), - "title" =>htmlspecialchars($item->title), - "author" => - empty($comment->guest_name) ? $comment->author()->full_name : $comment->guest_name - ); + $feed->children[] = new ArrayObject( + array("pub_date" => date("D, d M Y H:i:s T", $comment->created), + "text" => $comment->text, + "thumb_url" => $item->thumb_url(), + "thumb_height" => $item->thumb_height, + "thumb_width" => $item->thumb_width, + "item_uri" => url::abs_site("{$item->type}s/$item->id"), + "title" => $item->title, + "author" => $comment->author_name()), + ArrayObject::ARRAY_AS_PROPS); } - $feed["max_pages"] = ceil($comments->count() / $limit); - $feed["title"] = htmlspecialchars(t("Recent Comments")); - $feed["link"] = url::abs_site("albums/" . (empty($id) ? "1" : $id)); - $feed["description"] = t("Recent Comments"); + $all_comments = ORM::factory("comment")->where("state", "published"); + if ($id) { + $all_comments->where("item_id", $id); + } + + $feed->max_pages = ceil($all_comments->find_all()->count() / $limit); + $feed->title = htmlspecialchars(t("Recent Comments")); + $feed->uri = url::abs_site("albums/" . (empty($id) ? "1" : $id)); + $feed->description = t("Recent Comments"); return $feed; } diff --git a/modules/comment/views/comment.mrss.php b/modules/comment/views/comment.mrss.php index d2177026..4f520144 100644 --- a/modules/comment/views/comment.mrss.php +++ b/modules/comment/views/comment.mrss.php @@ -6,33 +6,33 @@ xmlns:fh="http://purl.org/syndication/history/1.0"> gallery3 - <?= p::clean($title) ?> - - + <?= p::clean($feed->title) ?> + uri ?> + description) ?> en-us - + - - + previous_page_uri)): ?> + - -