Subversion Repositories taios

Rev

Rev 254 | Rev 266 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

require '../_taios.php';

$page = new Taios_Page('Forums', '../');
$page->drawHeader();
$page->drawMiddle();

$parentID = $_GET['parentID'];
if (empty($parentID))
{
    $parentID = -1;
}

if ($page->isUserAdmin($page->getLoggedInUser()))
{
    write('<p class="bold"><a href="add-category.php?parentID=' . $parentID . '">Add Category</a></p><br />');
}

$ids = $page->findIDs('ForumCategories', 'WHERE ParentID = ' . $parentID . ' ORDER BY Title ASC');

if (count($ids) >= 1)
{
    write('<h3>Categories</h3>');
}

for ($i = 0; $i < count($ids); $i++)
{
    $forumCategory = $page->getForumCategory($ids[$i]);
    write('<h4><a href="index.php?parentID=' . $forumCategory->ID . '">' . $forumCategory->title . '</a></h4>');
    write('<p>' . $forumCategory->description . '</p>');
    write('<br />');
}

$ids = $page->findIDs('ForumPosts', 'WHERE CategoryID = ' . $parentID . ' AND ParentID = -1 ORDER BY Title ASC');

if (count($ids) >= 1)
{
    write('<h3>Topics</h3>');
}

for ($i = 0; $i < count($ids); $i++)
{
    $forumPost = $page->getForumPost($ids[$i]);
    write('<h4><a href="post.php?id=' . $forumPost->ID . '">' . $forumPost->title . '</a></h4>');
    write('<br />');
}

$page->drawFooter();

?>