Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 30 → Rev 31

/blog/post.php
2,6 → 2,23
 
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']))
20,23 → 37,7
 
drawPost($_GET['id']);
 
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->drawFooter();
 
?>