Rev 13 | Rev 17 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16 | freddie | 1 | <?php |
2 | |||
3 | require '../_taios.php'; |
||
4 | |||
5 | $page = new Taios_Page('Blog Posts', '../'); |
||
6 | $page->drawHeader(); |
||
7 | write('<h3>Blog</h3>'); |
||
8 | $page->drawMenuItem('Computing', 'index.php?cat=Computing'); |
||
9 | $page->drawMiddle(); |
||
10 | |||
11 | if ($page->isUserGM($page->getLoggedInUser())) |
||
12 | { |
||
13 | write('<p class="bold"><a href="add-post.php">Add Post</a></p>'); |
||
14 | write('<br />'); |
||
15 | } |
||
16 | |||
17 | if (isset($_GET['post'])) |
||
18 | { |
||
19 | |||
20 | } |
||
21 | else |
||
22 | { |
||
23 | $ids = $page->findIDs('BlogPosts'); |
||
24 | for ($i = 0; $i < count($ids); $i++) |
||
25 | { |
||
26 | $id = $ids[$i]; |
||
27 | $post = $page->getBlogPost($id); |
||
28 | if ($post->ParentID == -1) |
||
29 | { |
||
30 | write('<h3>' . $post->title. '</h3>'); |
||
31 | write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>'); |
||
32 | write('<p>' . $post->content . '</p>'); |
||
33 | } |
||
34 | } |
||
35 | } |
||
36 | |||
37 | $page->drawFooter(); |
||
38 | |||
39 | ?> |