diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
commit | 4766f36a4d74924f21ff329c4318ce4e069ffa04 (patch) | |
tree | 969b84632f2a8b0db79788a8a6db8e41d63e5cb4 /views/default/annotation/latest_comments.php | |
parent | 57a217fd6b708844407486046a1faa23b46cac08 (diff) | |
download | elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.gz elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.bz2 |
Pulled in the interface changes.
git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/annotation/latest_comments.php')
-rwxr-xr-x | views/default/annotation/latest_comments.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/views/default/annotation/latest_comments.php b/views/default/annotation/latest_comments.php new file mode 100755 index 000000000..85ddfab7b --- /dev/null +++ b/views/default/annotation/latest_comments.php @@ -0,0 +1,39 @@ +<?php +/** + * Display latest comments on objects + **/ + +if($vars['comments']){ + global $CONFIG; + + echo "<div class='sidebar container'>"; + echo "<h2>" . elgg_echo('latestcomments') . "</h2>"; + foreach($vars['comments'] as $comment){ + //grab the entity the comment is on + $entity = get_entity($comment->entity_guid); + //comment owner + $comment_owner = get_user($comment->owner_guid); + $friendlytime = friendly_time($comment->time_created); // get timestamp for comment + + //set the title + if($entity->title) + $objecttitle = $entity->title; + else + $objecttitle = elgg_echo('file:untitled'); + + //if the entity has been deleted, don't link to it + if($entity){ + $url = $entity->getURL(); // get url to file for comment link + $url_display = "<a href=\"{$url}\">{$objecttitle}</a>"; + //$owner = $entity->getOwnerEntity(); // get file owner + }else{ + $url_display = $objecttitle; + } + + echo "<div class='LatestComment'><span class='generic_comment_icon'>" . elgg_view("profile/icon",array('entity' => $comment_owner, 'size' => 'tiny')) . "</span>"; + echo "<p class='owner_timestamp'><a href=\"{$vars['url']}pg/profile/{$comment_owner->username}\">{$comment_owner->name}</a> " . elgg_echo('on') . " {$url_display} <small>{$friendlytime}</small></p>"; + echo "<div class='clearfloat'></div></div>"; + + } + echo "</div>"; +}
\ No newline at end of file |