mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-30 19:50:36 -04:00
Merge commit 'upstream/master'
Conflicts: modules/akismet/views/admin_akismet.html.php modules/comment/helpers/comment_rss.php modules/gallery/helpers/gallery_rss.php modules/gallery/libraries/I18n.php modules/gallery/views/permissions_browse.html.php modules/gallery/views/simple_uploader.html.php modules/info/views/info_block.html.php modules/organize/controllers/organize.php modules/organize/views/organize.html.php modules/organize/views/organize_album.html.php themes/default/views/album.html.php themes/default/views/movie.html.php themes/default/views/photo.html.php
This commit is contained in:
@@ -34,41 +34,36 @@ class comment_rss_Core {
|
||||
}
|
||||
|
||||
$comments = ORM::factory("comment")
|
||||
->where("state", "published")
|
||||
->orderby("created", "DESC");
|
||||
$all_comments = ORM::factory("comment")
|
||||
->viewable()
|
||||
->where("state", "published")
|
||||
->orderby("created", "DESC");
|
||||
|
||||
if ($feed_id == "item") {
|
||||
$comments->where("item_id", $id);
|
||||
$all_comments->where("item_id", $id);
|
||||
}
|
||||
|
||||
if (!empty($comments)) {
|
||||
$feed->view = "comment.mrss";
|
||||
$comments = $comments->find_all($limit, $offset);
|
||||
$feed->children = array();
|
||||
foreach ($comments as $comment) {
|
||||
$item = $comment->item();
|
||||
$feed->children[] = new ArrayObject(
|
||||
array("pub_date" => date("D, d M Y H:i:s T", $comment->created),
|
||||
"text" => nl2br(SafeString::purify($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" => SafeString::purify($item->title),
|
||||
"author" => SafeString::of($comment->author_name())),
|
||||
ArrayObject::ARRAY_AS_PROPS);
|
||||
}
|
||||
|
||||
$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;
|
||||
$comments = $comments->find_all($limit, $offset);
|
||||
$feed->view = "comment.mrss";
|
||||
$feed->children = array();
|
||||
foreach ($comments as $comment) {
|
||||
$item = $comment->item();
|
||||
$feed->children[] = new ArrayObject(
|
||||
array("pub_date" => date("D, d M Y H:i:s T", $comment->created),
|
||||
"text" => nl2br(SafeString::purify($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" => SafeString::purify($item->title),
|
||||
"author" => SafeString::of($comment->author_name())),
|
||||
ArrayObject::ARRAY_AS_PROPS);
|
||||
}
|
||||
|
||||
$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");
|
||||
|
||||
return $feed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user