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