Subversion Repositories taios

Rev

Rev 30 | Rev 47 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

require '../_taios.php';

function drawPost($id)
{
    $post = $page->getBlogPost($id);
    write('<h3>' . $post->title. '</h3>');
    write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>');
    write('<p>' . $post->content . '</p>');

    $ids = $page->findIDs('BlogPosts', 'WHERE ParentID = ' . $id);
    for ($i = 0; $i < count($ids); $i++)
    {
        write('<p class="indent">');
        drawPost($i);
        write('</p>');
    }

}

$page = new Taios_Page('Blog Posts', '../');

if (!isset($_GET['id']))
    $page->redirect("index.php");

$page->drawHeader();
write('<h3>Blog</h3>');
$page->drawMenuItem('Computing', 'index.php?cat=Computing');
$page->drawMiddle();

if ($page->isUserGM($page->getLoggedInUser()))
{
    write('<p class="bold"><a href="add-post.php">Add Post</a></p>');
    write('<br />');
}

drawPost($_GET['id']);


$page->drawFooter();

?>