Rev 263 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
262 | tom | 1 | <?php |
2 | |||
3 | require '../_taios.php'; |
||
4 | |||
5 | $page = new Taios_Page('Manage All Forum Posts', '../'); |
||
6 | $page->drawHeader(); |
||
7 | $page->drawMiddle(); |
||
8 | |||
9 | $page->checkLoggedIn(); |
||
10 | |||
11 | if ($page->isUserAdmin($page->getLoggedInUser())) |
||
12 | { |
||
13 | write('<p class="bold">Use this to manage all the forum categories on the Tim32 Website.</p><br />'); |
||
14 | |||
15 | write('<table>'); |
||
16 | write('<tr>'); |
||
17 | write('<td class="bold">ID</td>'); |
||
18 | write('<td class="bold">Author</td>'); |
||
19 | write('<td class="bold">Category</td>'); |
||
20 | write('<td class="bold">Parent</td>'); |
||
21 | write('<td class="bold">Title</td>'); |
||
22 | write('<td class="bold">Content</td>'); |
||
23 | write('<td class="bold">Date Posted</td>'); |
||
24 | write('<td class="bold">Spam</td>'); |
||
25 | write('</tr>'); |
||
26 | |||
27 | $ids = $page->findIDs('ForumPosts'); |
||
28 | for ($i = 0; $i < count($ids); $i++) |
||
29 | { |
||
30 | $post = $page->getForumPost($ids[$i]); |
||
31 | write('<tr>'); |
||
32 | write('<td><a href="../forums/post.php?id=' . $post->ID . '">' . $post->ID . '</a></td>'); |
||
33 | write('<td><a href="account.php?id=' . $post->parent->ID . '">' . $post->parent->name . '</a></td>'); |
||
34 | if (!$post->category) |
||
35 | { |
||
36 | write('<td style="color: #444444;">No Category</td>'); |
||
37 | } |
||
38 | else |
||
39 | { |
||
40 | write('<td>' . $post->category->title . '</td>'); |
||
41 | } |
||
42 | if (!$post->parent) |
||
43 | { |
||
44 | write('<td style="color: #444444;">No Parent</td>'); |
||
45 | } |
||
46 | else |
||
47 | { |
||
48 | write('<td>' . $post->parent->title . '</td>'); |
||
49 | } |
||
50 | write('<td>' . $post->title . '</td>'); |
||
51 | write('<td>' . str_replace("\n", ' ', $post->description) . '</td>'); |
||
52 | write('<td>' . date('j/m/Y H:i', $post->datePosted) . '</td>'); |
||
53 | write('<td>' . $post->spam . '</td>'); |
||
54 | write('</tr>'); |
||
55 | } |
||
56 | |||
57 | write('</table>'); |
||
58 | } |
||
59 | else |
||
60 | { |
||
61 | $page->drawError('You do not have permission to access this page.'); |
||
62 | } |
||
63 | |||
64 | $page->drawFooter(); |
||
65 | |||
66 | ?> |
||
67 |