Rev 22 | Rev 57 | 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 | |||
22 | freddie | 17 | $ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1'); |
18 | for ($i = 0; $i < count($ids); $i++) |
||
16 | freddie | 19 | { |
22 | freddie | 20 | $id = $ids[$i]; |
21 | $post = $page->getBlogPost($id); |
||
44 | freddie | 22 | write('<a href="post.php?id=' . $ids[$i] . '"><h3>' . $post->title. '</h3></a>'); |
22 | freddie | 23 | write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>'); |
24 | write('<p>' . $post->content . '</p>'); |
||
16 | freddie | 25 | } |
26 | |||
22 | freddie | 27 | |
16 | freddie | 28 | $page->drawFooter(); |
29 | |||
30 | ?> |