summaryrefslogtreecommitdiff
path: root/model/Post.php
diff options
context:
space:
mode:
Diffstat (limited to 'model/Post.php')
-rw-r--r--model/Post.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/model/Post.php b/model/Post.php
index 91cd3be..308b5ac 100644
--- a/model/Post.php
+++ b/model/Post.php
@@ -15,7 +15,7 @@ function add_quote($dbc, $thread_id, $matches) {
$reply = mysqli_fetch_assoc($result);
if (empty($reply)) {
- return '<blockquote>Invalid quote!</blockquote>';
+ return '<blockquote><span style="color:red;">This post has been deleted</span></blockquote>';
}
$id = $id + 1;
@@ -59,7 +59,16 @@ class Post {
}
function display_content($dbc) {
- echo '<div class="header"><b>#' . $this->id . '</b> Posted by <a href="viewuser.php?id='. $this->author->id.'">' . $this->author->name . '</a> on ' . date('m/d/Y g:ia', strtotime($this->date)) . '<br></div>';
+ echo '<div class="header"><b>#' . $this->id . '</b>';
+ echo ' Posted by <a href="viewuser.php?id='. $this->author->id . '">' . $this->author->name . '</a>';
+ echo ' on ' . date('m/d/Y g:ia', strtotime($this->date));
+ if (isset($_SESSION['signed_in']) && $_SESSION['user_id'] == $this->author->id) {
+ echo '<span style="float:right;">';
+ echo '[<a href="includes/manage_post.php?action=edit&id=' . $this->id . '">Edit</a>] ';
+ echo '[<a href="includes/manage_post.php?action=delete&id=' . $this->id . '">Delete</a>]';
+ echo'</span>';
+ }
+ echo '</div>';
$post_content = $this->content;
$thread_id = $this->id;