summaryrefslogtreecommitdiff
path: root/tpl/blog/view.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2012-04-13 19:26:18 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2012-04-13 19:26:18 +0200
commitddb6cadf66c7f6c26430a14658d232a88bcceb7a (patch)
tree1fd9e8c8bbe007f182e020354e27041f0952252e /tpl/blog/view.php
parenta535a9e7e017629178b45acc2e96e1d674a0d6fc (diff)
downloadBits-ddb6cadf66c7f6c26430a14658d232a88bcceb7a.tar.gz
Bits-ddb6cadf66c7f6c26430a14658d232a88bcceb7a.zip
Minor changes in navigation.
Diffstat (limited to 'tpl/blog/view.php')
-rw-r--r--tpl/blog/view.php54
1 files changed, 30 insertions, 24 deletions
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 ' | <a href="edit-blog-' . $post['id'] . '">edit</a>';
if ($can_delete && $post['owner_id'] == $user['id'])
echo ' | <a href="delete-blog-' . $post['id'] . '">delete</a>';
-if ($can_comment)
+if ($can_comment && !$is_draft)
echo ' | <a href="comment-blog-' . $post['id'] . '">post comment</a>';
+if ($is_draft)
+ echo ' | <a href="publish-blog-' . $post['id'] . '">publish</a>';
echo '</div>';
echo '<div class="small_right">published ' . $post['date'] . '</div>';
if ($post['tags'] != '') {
@@ -19,31 +21,35 @@ if ($post['tags'] != '') {
}
echo $post['text_html'];
-echo '<h2>Comments</h2>';
-
-if (count($comments) == 0) {
- echo 'No comments at the moment.';
-} else {
- foreach ($comments as $comment) {
- echo '<div class="blog_post">';
- $a = array();
- if ($can_delcom) $a[] = '<a href="delcom-blog-' . $comment['id'] . '">delete</a>';
- if ($can_comment && $comment['author_id'] == $user['id'])
- $a[] = '<a href="edcom-blog-' . $comment['id'] . '">edit</a>';
- if (count($a) > 0)
- echo '<div class="small_right">' . implode(" | ", $a) . '</div>';
-
- echo '<h3>' . $comment['date'] . ' by ' . $comment['author'] . '</h3>';
- echo '<div class="inside">' . $comment['text_html'] . '</div>';
- echo '</div>';
+if (!$is_draft) {
+
+ echo '<h2>Comments</h2>';
+
+ if (count($comments) == 0) {
+ echo 'No comments at the moment.';
+ } else {
+ foreach ($comments as $comment) {
+ echo '<div class="blog_post">';
+ $a = array();
+ if ($can_delcom) $a[] = '<a href="delcom-blog-' . $comment['id'] . '">delete</a>';
+ if ($can_comment && $comment['author_id'] == $user['id'])
+ $a[] = '<a href="edcom-blog-' . $comment['id'] . '">edit</a>';
+ if (count($a) > 0)
+ echo '<div class="small_right">' . implode(" | ", $a) . '</div>';
+
+ echo '<h3>' . $comment['date'] . ' by ' . $comment['author'] . '</h3>';
+ echo '<div class="inside">' . $comment['text_html'] . '</div>';
+ echo '</div>';
+ }
+ }
+
+ echo '<h3>Post a comment</h3>';
+ if ($can_comment) {
+ echo '<form class="blog_post" method="POST" action="index.php?p=comment-blog-' . $post['id'] . '"><textarea name="comment" style="height: 200px"></textarea><br /><div class="empty_label">&nbsp;</div><input type="submit" value="Comment" /></form>';
+ } else {
+ echo 'Please log in or register to post a comment.';
}
-}
-echo '<h3>Post a comment</h3>';
-if ($can_comment) {
- echo '<form class="blog_post" method="POST" action="index.php?p=comment-blog-' . $post['id'] . '"><textarea name="comment" style="height: 200px"></textarea><br /><div class="empty_label">&nbsp;</div><input type="submit" value="Comment" /></form>';
-} else {
- echo 'Please log in or register to post a comment.';
}