Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 251 → Rev 252

/_taios.php
415,6 → 415,28
return false;
}
function getForumPost($id)
{
$result = $this->query('SELECT * FROM ForumPosts WHERE ID = ' . $id);
while ($row = mysql_fetch_array($result))
{
$f = new ForumPost;
$f->ID = $row['ID'];
$f->author = $this->getUserByID($row['AuthorID']);
$f->category = $this->getForumCategory($row['CategoryID']);
$f->parent = $this->getForumPost($row['ParentID']);
$f->title = $row['Title'];
$f->content = $row['Content'];
$f->datePosted = strtotime($row['DatePosted']);
$f->spam = $row['Spam'];
return $f;
}
return false;
}
function delBlogPost($id)
{
$ids = $this->findIDs('BlogPosts', 'WHERE ParentID=' . $id);
494,6 → 516,18
public $description;
}
 
class ForumPost
{
public $id;
public $author;
public $category;
public $parent;
public $title;
public $content
public $datePosted;
public $spam;
}
 
function write($str)
{
echo $str;
/forums/index.php
13,13 → 13,34
}
 
$ids = $page->findIDs('ForumCategories', 'WHERE ParentID = ' . $parentID . ' ORDER BY Title ASC');
 
if (count($ids) >= 1)
{
write('<h3>Categories</h3>');
}
 
for ($i = 0; $i < count($ids); $i++)
{
$forumCategory = $page->getForumCategory($ids[$i]);
write('<h4><a href="index.php?parentID=' . $forumCategory->parentID . '">' . $forumCategory->title . '</a></h4>');
write('<p>' . $forumCategory->description . '</p>');
write('<br />');
}
 
$ids = $page->findIDs('ForumPosts', 'WHERE CategoryID = ' . $parentID . ' AND ParentID = -1 ORDER BY Title ASC');
 
if (count($ids) >= 1)
{
write('<h3>Topics</h3>');
}
 
for ($i = 0; $i < count($ids); $i++)
{
$forumPost = $page->getForumPost($ids[$i]);
write('<h4><a href="post.php?id=' . $forumPost->ID . '">' . $forumPost->title . '</a></h4>');
write('<br />');
}
 
$page->drawFooter();
 
?>