Rev 294 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 298 | freddie | 1 | <?php |
| 2 | |||
| 3 | require '../_taios.php'; |
||
| 4 | |||
| 5 | $page = new Taios_Page('Forum Post', '../'); |
||
| 6 | $page->drawHeader(); |
||
| 7 | $page->drawMiddle(); |
||
| 8 | |||
| 9 | $id = $page->getGetID(); |
||
| 10 | $forumPost = $page->getForumPost($id); |
||
| 11 | write('<p class="bold"><a href="index.php?parentID=' . $forumPost->category->ID . '">Back to Topics</a></p><br />'); |
||
| 12 | write('<h3>' . $forumPost->title . '</h3>'); |
||
| 13 | write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $forumPost->datePosted) . ' by ' . $forumPost->author->name . ' (' . $forumPost->author->username . ')</h5>'); |
||
| 14 | write('<p>' . $page->replaceBBCode($forumPost->content) . '</p>'); |
||
| 15 | if ($page->isLoggedIn()) |
||
| 16 | { |
||
| 17 | write('<p class="bold"><a href="add-post.php?parentID=' . $id . '">Post Reply</a>'); |
||
| 18 | if ($page->isUserAdmin($page->getLoggedInUser()) || $forumPost->author->ID == $page->getLoggedInUser()->ID) |
||
| 19 | { |
||
| 20 | write(' · <a href="edit-post.php?id=' . $id . '">Edit Post</a>'); |
||
| 21 | write(' · <a href="delete-post-do.php?id=' . $id . '">Delete Post</a>'); |
||
| 22 | } |
||
| 23 | write('</p>'); |
||
| 24 | } |
||
| 25 | write('<br />'); |
||
| 26 | |||
| 27 | $ids = $page->findIDs('ForumPosts', 'WHERE ParentID = ' . $id . ' ORDER BY DatePosted ASC'); |
||
| 28 | for ($i = 0; $i < count($ids); $i++) |
||
| 29 | { |
||
| 30 | $forumPost = $page->getForumPost($ids[$i]); |
||
| 31 | write('<h4>' . $forumPost->title . '</h4>'); |
||
| 32 | write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $forumPost->datePosted) . ' by ' . $forumPost->author->name . ' (' . $forumPost->author->username . ')</h5>'); |
||
| 33 | write('<p>' . $page->replaceBBCode($forumPost->content) . '</p>'); |
||
| 34 | if ($page->isUserAdmin($page->getLoggedInUser()) || $forumPost->author->ID == $page->getLoggedInUser()->ID) |
||
| 35 | { |
||
| 36 | write('<p class="bold"><a href="edit-post.php?id=' . $ids[$i] . '">Edit Post</a>'); |
||
| 37 | write(' · <a href="delete-post-do.php?id=' . $ids[$i] . '">Delete Post</a></p>'); |
||
| 38 | } |
||
| 39 | write('<br />'); |
||
| 40 | } |
||
| 41 | |||
| 42 | $page->drawFooter(); |
||
| 43 | |||
| 44 | ?> |
||
| 45 |