Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 254 → Rev 265

/forums/index.php
12,6 → 12,11
$parentID = -1;
}
 
if ($page->isUserAdmin($page->getLoggedInUser()))
{
write('<p class="bold"><a href="add-category.php?parentID=' . $parentID . '">Add Category</a></p><br />');
}
 
$ids = $page->findIDs('ForumCategories', 'WHERE ParentID = ' . $parentID . ' ORDER BY Title ASC');
 
if (count($ids) >= 1)
/forums/post.php
0,0 → 1,29
<?php
 
require '../_taios.php';
 
$page = new Taios_Page('Forum Post', '../');
$page->drawHeader();
$page->drawMiddle();
 
$id = $page->getGetID();
$forumPost = $page->getForumPost($id);
write('<p class="bold"><a href="index.php?parentID=' . $forumPost->category->ID . '">Back to Topics</a></p><br />');
 
write('<h3>' . $forumPost->title . '</h3>');
write('<p>' . $page->replaceBBCode($forumPost->content) . '</p>');
write('<br />');
 
$ids = $page->findIDs('ForumPosts', 'WHERE ParentID = ' . $id . ' ORDER BY DatePosted DESC');
for ($i = 0; $i < count($ids); $i++)
{
$forumPost = $page->getForumPost($ids[$i]);
write('<h4>' . $forumPost->title . '</h4>');
write('<p>' . $page->replaceBBCode($forumPost->content) . '</p>');
write('<br />');
}
 
$page->drawFooter();
 
?>
 
/admin/all-forum-posts.php
0,0 → 1,67
<?php
 
require '../_taios.php';
 
$page = new Taios_Page('Manage All Forum Posts', '../');
$page->drawHeader();
$page->drawMiddle();
 
$page->checkLoggedIn();
 
if ($page->isUserAdmin($page->getLoggedInUser()))
{
write('<p class="bold">Use this to manage all the forum categories on the Tim32 Website.</p><br />');
 
write('<table>');
write('<tr>');
write('<td class="bold">ID</td>');
write('<td class="bold">Author</td>');
write('<td class="bold">Category</td>');
write('<td class="bold">Parent</td>');
write('<td class="bold">Title</td>');
write('<td class="bold">Content</td>');
write('<td class="bold">Date Posted</td>');
write('<td class="bold">Spam</td>');
write('</tr>');
 
$ids = $page->findIDs('ForumPosts');
for ($i = 0; $i < count($ids); $i++)
{
$post = $page->getForumPost($ids[$i]);
write('<tr>');
write('<td><a href="../forums/post.php?id=' . $post->ID . '">' . $post->ID . '</a></td>');
write('<td><a href="account.php?id=' . $post->author->ID . '">' . $post->author->name . '</a></td>');
if (!$post->category)
{
write('<td style="color: #444444;">No Category</td>');
}
else
{
write('<td>' . $post->category->title . '</td>');
}
if (!$post->parent)
{
write('<td style="color: #444444;">No Parent</td>');
}
else
{
write('<td>' . $post->parent->title . '</td>');
}
write('<td>' . $post->title . '</td>');
write('<td>' . str_replace("\n", ' ', $post->content) . '</td>');
write('<td>' . date('j/m/Y H:i', $post->datePosted) . '</td>');
write('<td>' . $post->spam . '</td>');
write('</tr>');
}
write('</table>');
}
else
{
$page->drawError('You do not have permission to access this page.');
}
 
$page->drawFooter();
 
?>
 
/admin/all-forum-categories.php
0,0 → 1,52
<?php
 
require '../_taios.php';
 
$page = new Taios_Page('Manage All Forum Categories', '../');
$page->drawHeader();
$page->drawMiddle();
 
$page->checkLoggedIn();
 
if ($page->isUserAdmin($page->getLoggedInUser()))
{
write('<p class="bold">Use this to manage all the forum categories on the Tim32 Website.</p><br />');
 
write('<table>');
write('<tr>');
write('<td class="bold">ID</td>');
write('<td class="bold">Parent</td>');
write('<td class="bold">Title</td>');
write('<td class="bold">Description</td>');
write('</tr>');
 
$ids = $page->findIDs('ForumCategories');
for ($i = 0; $i < count($ids); $i++)
{
$cat = $page->getForumCategory($ids[$i]);
write('<tr>');
write('<td><a href="../forums/index.php?parentID=' . $cat->ID . '">' . $cat->ID . '</a></td>');
if (!$cat->parent)
{
write('<td style="color: #444444;">No Parent</td>');
}
else
{
write('<td>' . $cat->parent->title . '</td>');
}
write('<td>' . $cat->title . '</td>');
write('<td>' . $cat->description . '</td>');
write('</tr>');
}
write('</table>');
}
else
{
$page->drawError('You do not have permission to access this page.');
}
 
$page->drawFooter();
 
?>
 
/admin/index.php
17,7 → 17,6
write('<h4><a href="all-blog-posts.php">Manage All Blog Posts</a></h4>');
write('<h4><a href="all-projects.php">Manage All Projects</a></h4>');
write('<h4><a href="all-forum-categories.php">Manage All Forum Categories</a></h4>');
write('<h4><a href="all-forum-topics.php">Manage All Forum Topics</a></h4>');
write('<h4><a href="all-forum-posts.php">Manage All Forum Posts</a></h4>');
}
 
/_taios.php
405,7 → 405,7
$f = new ForumCategory;
$f->ID = $row['ID'];
$f->parentID = $row['ParentID'];
$f->parent = $this->getForumCategory($row['ParentID']);
$f->title = $row['Title'];
$f->description = $row['Description'];
511,7 → 511,7
class ForumCategory
{
public $ID;
public $parentID;
public $parent;
public $title;
public $description;
}