aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/views/default/object/blog.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/blog/views/default/object/blog.php')
-rw-r--r--mod/blog/views/default/object/blog.php25
1 files changed, 15 insertions, 10 deletions
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index f1240256a..4a8541261 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -24,9 +24,10 @@ $excerpt = $blog->excerpt;
$body = $blog->description;
$owner_icon = elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny'));
$tags = elgg_view('output/tags', array('tags' => $blog->tags));
-$date = friendly_time($blog->time_created);
+$date = friendly_time($blog->publish_date);
-if ($blog->comments_on == 'Yes') {
+// The "on" status changes for comments, so best to check for !Off
+if ($blog->comments_on != 'Off') {
$comments_count = elgg_count_comments($blog);
$comments_link = "<a href=\"{$blog->getURL()}#annotations\">" . sprintf(elgg_echo("comments"), $comments_count) . '</a>';
} else {
@@ -34,27 +35,31 @@ if ($blog->comments_on == 'Yes') {
}
// links to delete or edit.
+$edit = '';
if ($blog->canEdit()) {
$edit_url = "{$vars['url']}pg/blog/{$owner->username}/edit/{$blog->getGUID()}/";
$edit_link = "<a href=\"$edit_url\">" . elgg_echo('edit') . '</a>';
$delete_url = "{$vars['url']}action/blog/delete?guid={$blog->getGUID()}";
- $delete_link = "<span class='delete_button'>".elgg_view('output/confirmlink', array(
+ $delete_link = "<span class='delete_button'>" . elgg_view('output/confirmlink', array(
'href' => $delete_url,
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm')
- ))."</span>";
+ )) . "</span>";
- $edit = "$edit_link $delete_link";
-} else {
- $edit = '';
+ $status = '';
+ if ($blog->status != 'published') {
+ $status_text = elgg_echo("blog:status:{$blog->status}");
+ $status = "<span class='blog_status'>$status_text</a>";
+ }
+
+ $edit = "$status $edit_link $delete_link";
}
// include a view for plugins to extend
$edit = elgg_view("blogs/options", array("object_type" => 'blog')) .$edit;
if ($full) {
- // The "on" status changes for comments, so best to check for !Off
if ($blog->comments_on != 'Off') {
$comments = elgg_view_comments($blog);
} else {
@@ -67,7 +72,7 @@ echo <<<___END
<div class="blogpost clearfloat">
<div id="content_header" class="clearfloat">
<div class="content_header_title"><h2>$owner_title</h2></div>
- </div>
+ </div>
<div class="entity_listing_icon">
$owner_icon
</div>
@@ -90,7 +95,7 @@ ___END;
} else {
echo <<<___END
-<div class="blog entity_listing clearfloat">
+<div class="blog $status_class entity_listing clearfloat">
<div class="entity_listing_icon">
$owner_icon
</div>