Rev 254 | 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 | |
265 | tom | 15 | if ($page->isUserAdmin($page->getLoggedInUser())) |
16 | { |
||
17 | write('<p class="bold"><a href="add-category.php?parentID=' . $parentID . '">Add Category</a></p><br />'); |
||
18 | } |
||
19 | |||
246 | tom | 20 | $ids = $page->findIDs('ForumCategories', 'WHERE ParentID = ' . $parentID . ' ORDER BY Title ASC'); |
252 | tom | 21 | |
22 | if (count($ids) >= 1) |
||
23 | { |
||
24 | write('<h3>Categories</h3>'); |
||
25 | } |
||
26 | |||
246 | tom | 27 | for ($i = 0; $i < count($ids); $i++) |
28 | { |
||
251 | tom | 29 | $forumCategory = $page->getForumCategory($ids[$i]); |
254 | tom | 30 | write('<h4><a href="index.php?parentID=' . $forumCategory->ID . '">' . $forumCategory->title . '</a></h4>'); |
246 | tom | 31 | write('<p>' . $forumCategory->description . '</p>'); |
252 | tom | 32 | write('<br />'); |
246 | tom | 33 | } |
34 | |||
252 | tom | 35 | $ids = $page->findIDs('ForumPosts', 'WHERE CategoryID = ' . $parentID . ' AND ParentID = -1 ORDER BY Title ASC'); |
36 | |||
37 | if (count($ids) >= 1) |
||
38 | { |
||
39 | write('<h3>Topics</h3>'); |
||
40 | } |
||
41 | |||
42 | for ($i = 0; $i < count($ids); $i++) |
||
43 | { |
||
44 | $forumPost = $page->getForumPost($ids[$i]); |
||
45 | write('<h4><a href="post.php?id=' . $forumPost->ID . '">' . $forumPost->title . '</a></h4>'); |
||
46 | write('<br />'); |
||
47 | } |
||
48 | |||
169 | tom | 49 | $page->drawFooter(); |
50 | |||
51 | ?> |
||
52 |