From eab5d71d06a5b34b34efbbc53a23e3026fcae47d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 1 Sep 2009 20:39:08 -0700 Subject: Revert "Rename $comment_model to $comments." This reverts commit d85a8b20bbe0a5be0a03da70354169d41f418d41. --- modules/comment/helpers/comment_rss.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/comment/helpers') diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index b539887b..2d54dc7b 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -33,16 +33,16 @@ class comment_rss_Core { return; } - $comments = ORM::factory("comment") + $comment_model = ORM::factory("comment") ->viewable() ->where("state", "published") ->orderby("created", "DESC"); if ($feed_id == "item") { - $comments->where("item_id", $id); + $comment_model->where("item_id", $id); } - $comments = $comments->find_all($limit, $offset); + $comments = $comment_model->find_all($limit, $offset); $feed->view = "comment.mrss"; $feed->children = array(); foreach ($comments as $comment) { @@ -59,7 +59,7 @@ class comment_rss_Core { ArrayObject::ARRAY_AS_PROPS); } - $feed->max_pages = ceil($comments->count_all() / $limit); + $feed->max_pages = ceil($comment_model->count_all() / $limit); $feed->title = htmlspecialchars(t("Recent Comments")); $feed->uri = url::abs_site("albums/" . (empty($id) ? "1" : $id)); $feed->description = t("Recent Comments"); -- cgit v1.2.3 From d5cd6a92e7f9b88b76cfa5e4b8104a701e58c9f0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 1 Sep 2009 20:40:18 -0700 Subject: Rename $comment_model to $comments, this time without stomping on the pre-existing variable. --- modules/comment/helpers/comment_rss.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/comment/helpers') diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index 2d54dc7b..4424981d 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -33,19 +33,18 @@ class comment_rss_Core { return; } - $comment_model = ORM::factory("comment") + $comments = ORM::factory("comment") ->viewable() ->where("state", "published") ->orderby("created", "DESC"); if ($feed_id == "item") { - $comment_model->where("item_id", $id); + $comments->where("item_id", $id); } - $comments = $comment_model->find_all($limit, $offset); $feed->view = "comment.mrss"; $feed->children = array(); - foreach ($comments as $comment) { + foreach ($comments->find_all($limit, $offset) as $comment) { $item = $comment->item(); $feed->children[] = new ArrayObject( array("pub_date" => date("D, d M Y H:i:s T", $comment->created), @@ -59,7 +58,7 @@ class comment_rss_Core { ArrayObject::ARRAY_AS_PROPS); } - $feed->max_pages = ceil($comment_model->count_all() / $limit); + $feed->max_pages = ceil($comments->count_all() / $limit); $feed->title = htmlspecialchars(t("Recent Comments")); $feed->uri = url::abs_site("albums/" . (empty($id) ? "1" : $id)); $feed->description = t("Recent Comments"); -- cgit v1.2.3