summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/controllers/admin_manage_comments.php10
-rw-r--r--modules/comment/controllers/comments.php4
-rw-r--r--modules/comment/views/comments.html.php6
-rw-r--r--modules/comment/views/user_profile_comments.html.php4
4 files changed, 13 insertions, 11 deletions
diff --git a/modules/comment/controllers/admin_manage_comments.php b/modules/comment/controllers/admin_manage_comments.php
index e451791f..0889dc4e 100644
--- a/modules/comment/controllers/admin_manage_comments.php
+++ b/modules/comment/controllers/admin_manage_comments.php
@@ -35,9 +35,9 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
public function menu_labels() {
$menu = $this->_menu($this->_counts());
json::reply(array((string) $menu->get("unpublished")->label,
- (string) $menu->get("published")->label,
- (string) $menu->get("spam")->label,
- (string) $menu->get("deleted")->label));
+ (string) $menu->get("published")->label,
+ (string) $menu->get("spam")->label,
+ (string) $menu->get("deleted")->label));
}
public function queue($state) {
@@ -51,8 +51,10 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
$view->content->state = $state;
$view->content->comments = ORM::factory("comment")
->order_by("created", "DESC")
+ ->order_by("id", "DESC")
->where("state", "=", $state)
- ->limit(self::$items_per_page, ($page - 1) * self::$items_per_page)
+ ->limit(self::$items_per_page)
+ ->offset(($page - 1) * self::$items_per_page)
->find_all();
$view->content->pager = new Pagination();
$view->content->pager->initialize(
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 6ec4132b..ff0e9ce1 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -57,8 +57,8 @@ class Comments_Controller extends Controller {
$view->comment = $comment;
json::reply(array("result" => "success",
- "view" => (string)$view,
- "form" => (string)comment::get_add_form($item)));
+ "view" => (string)$view,
+ "form" => (string)comment::get_add_form($item)));
} else {
$form = comment::prefill_add_form($form);
json::reply(array("result" => "error", "form" => (string)$form));
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index da45f57b..b524f5da 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -36,11 +36,11 @@
</a>
<? if ($comment->author()->guest): ?>
<?= t('on %date %name said',
- array("date" => date("Y-M-d H:i:s", $comment->created),
- "name" => html::clean($comment->author_name()))); ?>
+ array("date" => gallery::date_time($comment->created),
+ "name" => html::clean($comment->author_name()))); ?>
<? else: ?>
<?= t('on %date <a href="%url">%name</a> said',
- array("date" => date("Y-M-d H:i:s", $comment->created),
+ array("date" => gallery::date_time($comment->created),
"url" => user_profile::url($comment->author_id),
"name" => html::clean($comment->author_name()))); ?>
<? endif ?>
diff --git a/modules/comment/views/user_profile_comments.html.php b/modules/comment/views/user_profile_comments.html.php
index a2a641ba..377b2d95 100644
--- a/modules/comment/views/user_profile_comments.html.php
+++ b/modules/comment/views/user_profile_comments.html.php
@@ -4,8 +4,8 @@
<? foreach ($comments as $comment): ?>
<li id="g-comment-<?= $comment->id ?>">
<p class="g-author">
- <?= t('on %date for %title ',
- array("date" => date("Y-M-d H:i:s", $comment->created),
+ <?= t("on %date for %title ",
+ array("date" => gallery::date_time($comment->created),
"title" => $comment->item()->title)); ?>
<a href="<?= $comment->item()->url() ?>">
<?= $comment->item()->thumb_img(array(), 50) ?>