Subversion Repositories taios

Rev

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

Rev Author Line No. Line
169 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Forums', '../');
6
$page->drawHeader();
7
$page->drawMiddle();
8
 
246 tom 9
$parentID = $_GET['parentID'];
10
if (empty($parentID))
11
{
12
    $parentID = -1;
13
}
169 tom 14
 
246 tom 15
$ids = $page->findIDs('ForumCategories', 'WHERE ParentID = ' . $parentID . ' ORDER BY Title ASC');
252 tom 16
 
17
if (count($ids) >= 1)
18
{
19
    write('<h3>Categories</h3>');
20
}
21
 
246 tom 22
for ($i = 0; $i < count($ids); $i++)
23
{
251 tom 24
    $forumCategory = $page->getForumCategory($ids[$i]);
254 tom 25
    write('<h4><a href="index.php?parentID=' . $forumCategory->ID . '">' . $forumCategory->title . '</a></h4>');
246 tom 26
    write('<p>' . $forumCategory->description . '</p>');
252 tom 27
    write('<br />');
246 tom 28
}
29
 
252 tom 30
$ids = $page->findIDs('ForumPosts', 'WHERE CategoryID = ' . $parentID . ' AND ParentID = -1 ORDER BY Title ASC');
31
 
32
if (count($ids) >= 1)
33
{
34
    write('<h3>Topics</h3>');
35
}
36
 
37
for ($i = 0; $i < count($ids); $i++)
38
{
39
    $forumPost = $page->getForumPost($ids[$i]);
40
    write('<h4><a href="post.php?id=' . $forumPost->ID . '">' . $forumPost->title . '</a></h4>');
41
    write('<br />');
42
}
43
 
169 tom 44
$page->drawFooter();
45
 
46
?>
47