From ddb6cadf66c7f6c26430a14658d232a88bcceb7a Mon Sep 17 00:00:00 2001 From: Nicolas BERNSTEIN Date: Fri, 13 Apr 2012 19:26:18 +0200 Subject: Minor changes in navigation. --- tpl/blog/view.php | 54 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'tpl/blog/view.php') diff --git a/tpl/blog/view.php b/tpl/blog/view.php index 0f0c89c..32f1073 100644 --- a/tpl/blog/view.php +++ b/tpl/blog/view.php @@ -10,8 +10,10 @@ if ($can_edit && $post['owner_id'] == $user['id']) echo ' | edit'; if ($can_delete && $post['owner_id'] == $user['id']) echo ' | delete'; -if ($can_comment) +if ($can_comment && !$is_draft) echo ' | post comment'; +if ($is_draft) + echo ' | publish'; echo ''; echo '
published ' . $post['date'] . '
'; if ($post['tags'] != '') { @@ -19,31 +21,35 @@ if ($post['tags'] != '') { } echo $post['text_html']; -echo '

Comments

'; - -if (count($comments) == 0) { - echo 'No comments at the moment.'; -} else { - foreach ($comments as $comment) { - echo '
'; - $a = array(); - if ($can_delcom) $a[] = 'delete'; - if ($can_comment && $comment['author_id'] == $user['id']) - $a[] = 'edit'; - if (count($a) > 0) - echo '
' . implode(" | ", $a) . '
'; - - echo '

' . $comment['date'] . ' by ' . $comment['author'] . '

'; - echo '
' . $comment['text_html'] . '
'; - echo '
'; +if (!$is_draft) { + + echo '

Comments

'; + + if (count($comments) == 0) { + echo 'No comments at the moment.'; + } else { + foreach ($comments as $comment) { + echo '
'; + $a = array(); + if ($can_delcom) $a[] = 'delete'; + if ($can_comment && $comment['author_id'] == $user['id']) + $a[] = 'edit'; + if (count($a) > 0) + echo '
' . implode(" | ", $a) . '
'; + + echo '

' . $comment['date'] . ' by ' . $comment['author'] . '

'; + echo '
' . $comment['text_html'] . '
'; + echo '
'; + } + } + + echo '

Post a comment

'; + if ($can_comment) { + echo '

 
'; + } else { + echo 'Please log in or register to post a comment.'; } -} -echo '

Post a comment

'; -if ($can_comment) { - echo '

 
'; -} else { - echo 'Please log in or register to post a comment.'; } -- cgit v1.2.3