Subversion Repositories taios

Rev

Rev 29 | Rev 31 | 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', '../');
26 freddie 6
 
7
if (!isset($_GET['id']))
8
    $page->redirect("index.php");
9
 
22 freddie 10
$page->drawHeader();
11
write('<h3>Blog</h3>');
12
$page->drawMenuItem('Computing', 'index.php?cat=Computing');
13
$page->drawMiddle();
14
 
15
if ($page->isUserGM($page->getLoggedInUser()))
16
{
17
    write('<p class="bold"><a href="add-post.php">Add Post</a></p>');
18
    write('<br />');
19
}
20
 
28 freddie 21
drawPost($_GET['id']);
22 freddie 22
 
28 freddie 23
function drawPost($id)
24
{
25
    $post = $page->getBlogPost($id);
26
    write('<h3>' . $post->title. '</h3>');
27
    write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>');
28
    write('<p>' . $post->content . '</p>');
29
 
30
    $ids = $page->findIDs('BlogPosts', 'WHERE ParentID = ' . $id);
31
    for ($i = 0; $i < count($ids); $i++)
32
    {
30 freddie 33
        write('<p class="indent">');
28 freddie 34
        drawPost($i);
29 freddie 35
        write('</p>');
28 freddie 36
    }
37
 
38
}
39
 
22 freddie 40
$page->drawFooter();
41
 
42
?>