Rev 22 | Rev 26 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 22 | 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 | |||
| 25 | freddie | 17 | if (isset($_GET['id'])) |
| 22 | freddie | 18 | { |
| 25 | freddie | 19 | $post = $page->getBlogPost($_GET['id']); |
| 22 | freddie | 20 | write('<h3>' . $post->title. '</h3>'); |
| 21 | write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>'); |
||
| 22 | write('<p>' . $post->content . '</p>'); |
||
| 23 | } |
||
| 24 | else |
||
| 25 | { |
||
| 26 | write('<h3>Fail</h3>'); |
||
| 27 | write('<p>No Post ID Given</p>'); |
||
| 28 | } |
||
| 29 | |||
| 30 | $page->drawFooter(); |
||
| 31 | |||
| 32 | ?> |