Subversion Repositories taios

Rev

Rev 264 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

require '../_taios.php';

$page = new Taios_Page('Manage All Forum Posts', '../');
$page->drawHeader();
$page->drawMiddle();

$page->checkLoggedIn();

if ($page->isUserAdmin($page->getLoggedInUser()))
{
    write('<p class="bold">Use this to manage all the forum categories on the Tim32 Website.</p><br />');

    write('<table>');
    write('<tr>');
    write('<td class="bold">ID</td>');
    write('<td class="bold">Author</td>');
    write('<td class="bold">Category</td>');
    write('<td class="bold">Parent</td>');
    write('<td class="bold">Title</td>');
    write('<td class="bold">Content</td>');
    write('<td class="bold">Date Posted</td>');
    write('<td class="bold">Spam</td>');
    write('</tr>');

    $ids = $page->findIDs('ForumPosts');
    for ($i = 0; $i < count($ids); $i++)
    {
        $post = $page->getForumPost($ids[$i]);
        write('<tr>');
        write('<td><a href="../forums/post.php?id=' . $post->ID . '">' . $post->ID . '</a></td>');
        write('<td><a href="account.php?id=' . $post->author->ID . '">' . htmlentities($post->author->name, ENT_QUOTES) . '</a></td>');
        if (!$post->category)
        {
            write('<td style="color: #444444;">No Category</td>');
        }
        else
        {
            write('<td>' . htmlentities($post->category->title, ENT_QUOTES) . '</td>');
        }
        if (!$post->parent)
        {
            write('<td style="color: #444444;">No Parent</td>');
        }
        else
        {
            write('<td>' . htmlentities($post->parent->title, ENT_QUOTES) . '</td>');
        }
        write('<td>' . htmlentities($post->title, ENT_QUOTES) . '</td>');
        write('<td>' . str_replace("\n", ' ', htmlentities($post->content, ENT_QUOTES)) . '</td>');
        write('<td>' . date('j/m/Y H:i', $post->datePosted) . '</td>');
        write('<td>' . $post->spam . '</td>');
        write('</tr>');
    }
   
    write('</table>');
}
else
{
    $page->drawError('You do not have permission to access this page.');
}

$page->drawFooter();

?>