Subversion Repositories taios

Rev

Rev 484 | 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>' . htmlentities($forumPost->title, ENT_QUOTES) . '</h3>');
write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $forumPost->datePosted) . ' by ' . htmlentities($forumPost->author->name, ENT_QUOTES) . ' (' . htmlentities($forumPost->author->username, ENT_QUOTES) . ')</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(' &nbsp; &middot; &nbsp; <a href="edit-post.php?id=' . $id . '">Edit Post</a>');
        write(' &nbsp; &middot; &nbsp; <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>' . htmlentities($forumPost->title, ENT_QUOTES) . '</h4>');
    write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $forumPost->datePosted) . ' by ' . htmlentities($forumPost->author->name, ENT_QUOTES) . ' (' . htmlentities($forumPost->author->username, ENT_QUOTES) . ')</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(' &nbsp; &middot; &nbsp; <a href="delete-post-do.php?id=' . $ids[$i] . '">Delete Post</a></p>');
    }
    write('<br />');
}

$page->drawFooter();

?>