Subversion Repositories taios

Rev

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