Rev 294 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
<?php
require '../_taios.php';
$page = new Taios_Page
('Forum Post', '../');
$page->drawHeader();
$page->drawMiddle();
$id = $page->getGetID();
$forumPost = $page->getForumPost($id);
write
('<p class="bold"><a href="index.php?parentID=' . $forumPost->category->ID . '">Back to Topics</a></p><br />');
write
('<h3>' . $forumPost->title . '</h3>');
write
('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $forumPost->datePosted) . ' by ' . $forumPost->author->name . ' (' . $forumPost->author->username . ')</h5>');
write
('<p>' . $page->replaceBBCode($forumPost->content) . '</p>');
if ($page->isLoggedIn())
{
write
('<p class="bold"><a href="add-post.php?parentID=' . $id . '">Post Reply</a>');
if ($page->isUserAdmin($page->getLoggedInUser()) || $forumPost->author->ID == $page->getLoggedInUser()->ID)
{
write
(' · <a href="edit-post.php?id=' . $id . '">Edit Post</a>');
write
(' · <a href="delete-post-do.php?id=' . $id . '">Delete Post</a>');
}
write
('</p>');
}
write
('<br />');
$ids = $page->findIDs('ForumPosts', 'WHERE ParentID = ' . $id . ' ORDER BY DatePosted ASC');
for ($i = 0; $i < count($ids); $i++)
{
$forumPost = $page->getForumPost($ids[$i]);
write
('<h4>' . $forumPost->title . '</h4>');
write
('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $forumPost->datePosted) . ' by ' . $forumPost->author->name . ' (' . $forumPost->author->username . ')</h5>');
write
('<p>' . $page->replaceBBCode($forumPost->content) . '</p>');
if ($page->isUserAdmin($page->getLoggedInUser()) || $forumPost->author->ID == $page->getLoggedInUser()->ID)
{
write
('<p class="bold"><a href="edit-post.php?id=' . $ids[$i] . '">Edit Post</a>');
write
(' · <a href="delete-post-do.php?id=' . $ids[$i] . '">Delete Post</a></p>');
}
write
('<br />');
}
$page->drawFooter();
?>