diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-25 19:49:17 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-25 19:49:17 -0800 |
commit | 1606961153fca681895a4f0145f7794000337539 (patch) | |
tree | 30a8fc8ed2dfcafe1c1aea13432ccd4b5a26be40 /modules/comment | |
parent | cc912935731c216a57e4c291548ec503a0c1607e (diff) | |
parent | 6023f2bb46598f9da096d63f7ab1dfb914eab6f7 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
Conflicts:
modules/gallery/libraries/MY_ORM.php
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/helpers/comment_event.php | 12 | ||||
-rw-r--r-- | modules/comment/views/user_profile_comments.html.php | 20 |
2 files changed, 32 insertions, 0 deletions
diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index bd336cda..12e8d73f 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -76,4 +76,16 @@ class comment_event_Core { $data[] = $row->text; } } + + static function show_user_profile($data) { + $view = new View("user_profile_comments.html"); + $view->comments = ORM::factory("comment") + ->order_by("created", "DESC") + ->where("state", "=", "published") + ->where("author_id", "=", $data->user->id) + ->find_all(); + if ($view->comments->count()) { + $data->content[] = (object)array("title" => t("Comments"), "view" => $view); + } + } } diff --git a/modules/comment/views/user_profile_comments.html.php b/modules/comment/views/user_profile_comments.html.php new file mode 100644 index 00000000..a2a641ba --- /dev/null +++ b/modules/comment/views/user_profile_comments.html.php @@ -0,0 +1,20 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<div id="g-comment-detail"> +<ul> + <? 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), + "title" => $comment->item()->title)); ?> + <a href="<?= $comment->item()->url() ?>"> + <?= $comment->item()->thumb_img(array(), 50) ?> + </a> + </p> + <div> + <?= nl2br(html::purify($comment->text)) ?> + </div> + </li> + <? endforeach ?> +</ul> +</div> |