diff options
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/helpers/comment_block.php | 2 | ||||
-rw-r--r-- | modules/comment/views/admin_block_recent_comments.html.php | 21 |
2 files changed, 7 insertions, 16 deletions
diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php index 03a2cb11..47025a6c 100644 --- a/modules/comment/helpers/comment_block.php +++ b/modules/comment/helpers/comment_block.php @@ -33,6 +33,8 @@ class comment_block_Core { $block->id = "gRecentComments"; $block->title = _("Recent Comments"); $block->content = new View("admin_block_recent_comments.html"); + $block->content->comments = + ORM::factory("comment")->orderby("created", "DESC")->limit(5)->find_all(); return $block; } }
\ No newline at end of file diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index eb4f9eca..76414300 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -1,21 +1,10 @@ <? defined("SYSPATH") or die("No direct script access."); ?> <ul> + <? foreach ($comments as $comment): ?> <li> - 2008-12-10 23:02:23 <a href="#">Bob</a> said "<i>Doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi...</i>" - </li> - <li> - 2008-12-10 23:02:23 <a href="#">Bob</a> said "<i>Architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas...</i>" - </li> - <li> - 2008-12-10 23:02:23 <a href="#">Bob</a> said "<i>Sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione...</i>" - </li> - <li> - 2008-12-10 23:02:23 <a href="#">Bob</a> said "<i>Voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit,...</i>" - </li> - <li> - 2008-12-10 23:02:23 <a href="#">Bob</a> said "<i>Amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut...</i>" - </li> - <li> - 2008-12-10 23:02:23 <a href="#">Bob</a> said "<i>Labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum...</i>" + <?= date("Y-M-d H:i:s", $comment->created) ?> + <? printf(_("%s said %s"), "<a href=\"#\">$comment->author</a>", + "<i>\"" . text::limit_words($comment->text, 50) . "\"</i>"); ?> </li> + <? endforeach ?> </ul> |