Rev 96 | Rev 104 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
96 | tom | 1 | <?php |
2 | |||
3 | require '../_taios.php'; |
||
4 | |||
5 | $page = new Taios_Page('Manage All Blog 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 blog posts 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">ParentID</td>'); |
||
19 | write('<td class="bold">AuthorID</td>'); |
||
20 | write('<td class="bold">Title</td>'); |
||
21 | write('<td class="bold">Content</td>'); |
||
22 | write('<td class="bold">DatePosted</td>'); |
||
23 | write('<td class="bold">Category</td>'); |
||
24 | write('<td class="bold">Spam</td>'); |
||
25 | write('</tr>'); |
||
26 | |||
27 | $ids = $page->findIDs('BlogPosts'); |
||
28 | for ($i = 0; $i < count($ids); $i++) |
||
29 | { |
||
98 | tom | 30 | $post = $page->getBlogPost($ids[$i]); |
96 | tom | 31 | write('<tr>'); |
32 | write('<td>' . $post->ID . '</td>'); |
||
33 | if ($post->parent == -1) |
||
34 | { |
||
35 | write('<td>' . $post->parent . '</td>'); |
||
36 | } |
||
37 | else |
||
38 | { |
||
39 | write('<td>' . $post->parent->ID . '</td>'); |
||
40 | } |
||
41 | write('<td>' . $post->author->ID . '</td>'); |
||
42 | write('<td>' . $post->title . '</td>'); |
||
43 | write('<td>' . $post->content . '</td>'); |
||
44 | write('<td>' . $post->datePosted . '</td>'); |
||
45 | write('<td>' . $post->category . '</td>'); |
||
46 | write('<td>' . $post->spam . '</td>'); |
||
47 | write('</tr>'); |
||
48 | } |
||
49 | |||
50 | write('</table>'); |
||
51 | } |
||
52 | else |
||
53 | { |
||
54 | drawError('You do not have permission to access this page.'); |
||
55 | } |
||
56 | |||
57 | $page->drawFooter(); |
||
58 | |||
59 | ?> |
||
60 |