Subversion Repositories taios

Rev

Rev 62 | Rev 64 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16 freddie 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Blog Posts', '../');
6
$page->drawHeader();
60 tom 7
 
57 tom 8
$page->drawBlogCategoriesMenu();
16 freddie 9
$page->drawMiddle();
10
 
11
if ($page->isUserGM($page->getLoggedInUser()))
12
{
47 freddie 13
    write('<p class="bold"><a href="add-post.php?id=-1">Add Post</a></p>');
16 freddie 14
    write('<br />');
15
}
16
 
62 tom 17
$query = 'WHERE ParentID = -1';
18
 
19
if (isset($_GET['cat']))
20
{
63 tom 21
    $query = $query . ' AND Category = "' . $_GET['cat'] . '"';
62 tom 22
}
23
 
24
$ids = $page->findIDs('BlogPosts', $query);
22 freddie 25
for ($i = 0; $i < count($ids); $i++)
16 freddie 26
{
22 freddie 27
    $id = $ids[$i];
28
    $post = $page->getBlogPost($id);
44 freddie 29
    write('<a href="post.php?id=' . $ids[$i] . '"><h3>' . $post->title. '</h3></a>');
22 freddie 30
    write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>');
31
    write('<p>' . $post->content . '</p>');
16 freddie 32
}
33
 
22 freddie 34
 
16 freddie 35
$page->drawFooter();
36
 
37
?>