/blog/post.php |
---|
4,6 → 4,9 |
$page = new Taios_Page('Blog Posts', '../'); |
if (!isset($_GET['id']) || $_GET['id'] == "" || $_GET['id'] == -1) |
$page->redirect('index.php'); |
if (!isset($_GET['id'])) |
$page->redirect("index.php"); |
11,7 → 14,7 |
$page->drawBlogCategoriesMenu(); |
$page->drawMiddle(); |
$page->drawBlogPostTree($_GET['id']); |
$page->drawBlogPostTree($_GET['id'], true); |
$page->drawFooter(); |
/admin/all-blog-posts.php |
---|
0,0 → 1,60 |
<?php |
require '../_taios.php'; |
$page = new Taios_Page('Manage All Blog Posts', '../'); |
$page->drawHeader(); |
$page->drawMiddle(); |
$page->checkLoggedIn(); |
if ($page->isUserAdmin($page->getLoggedInUser())) |
{ |
write('<p class="bold">Use this to manage all the blog posts on the Tim32 Website.</p><br />'); |
write('<table>'); |
write('<tr>'); |
write('<td class="bold">ID</td>'); |
write('<td class="bold">ParentID</td>'); |
write('<td class="bold">AuthorID</td>'); |
write('<td class="bold">Title</td>'); |
write('<td class="bold">Content</td>'); |
write('<td class="bold">DatePosted</td>'); |
write('<td class="bold">Category</td>'); |
write('<td class="bold">Spam</td>'); |
write('</tr>'); |
$ids = $page->findIDs('BlogPosts'); |
for ($i = 0; $i < count($ids); $i++) |
{ |
$poast = $page->getBlog($ids[$i]); |
write('<tr>'); |
write('<td>' . $post->ID . '</td>'); |
if ($post->parent == -1) |
{ |
write('<td>' . $post->parent . '</td>'); |
} |
else |
{ |
write('<td>' . $post->parent->ID . '</td>'); |
} |
write('<td>' . $post->author->ID . '</td>'); |
write('<td>' . $post->title . '</td>'); |
write('<td>' . $post->content . '</td>'); |
write('<td>' . $post->datePosted . '</td>'); |
write('<td>' . $post->category . '</td>'); |
write('<td>' . $post->spam . '</td>'); |
write('</tr>'); |
} |
write('</table>'); |
} |
else |
{ |
drawError('You do not have permission to access this page.'); |
} |
$page->drawFooter(); |
?> |
/admin/index.php |
---|
15,7 → 15,6 |
{ |
write('<h4><a href="all-accounts.php">Manage All Accounts</a></h4>'); |
write('<h4><a href="all-blog-posts.php">Manage All Blog Posts</a></h4>'); |
write('<h4><a href="all-blog-comments.php">Manage All Blog Comments</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>'); |
/admin/all-accounts.php |
---|
10,6 → 10,8 |
if ($page->isUserAdmin($page->getLoggedInUser())) |
{ |
write('<p class="bold">Use this to manage all the accounts on the Tim32 Website.</p><br />'); |
write('<table>'); |
write('<tr>'); |
write('<td class="bold">ID</td>'); |
/_taios.php |
---|
112,16 → 112,19 |
} |
} |
function drawBlogPostTree($id) |
function drawBlogPostTree($id, $first = false) |
{ |
$post = $this->getBlogPost($id); |
write('<a href="' . $this->url . 'blog/post.php?id=' . $id . '"><h3>' . $post->title. '</h3></a>'); |
if ($first) |
write('<h3><a href="post.php?id=' . $id . '">' . $post->title. '</a> <a href="post.php?id=' . $post->parent->ID . '">^</a></h3>'); |
else |
write('<a href="post.php?id=' . $id . '"><h3>' . $post->title. '</h3></a>'); |
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>'); |
write('<br />'); |
if ($this->isUserNormal($this->getLoggedInUser())) |
{ |
write('<p class="bold"><a href="add-commend.php?id="' . $id . '">Add Comment</a></p>'); |
write('<p class="bold"><a href="post-add.php?id=' . $id . '">Add Comment</a></p>'); |
write('<br />'); |
} |
/styles.css |
---|
68,7 → 68,7 |
} |
td { |
padding: 1px; |
padding: 3px; |
border: 1px solid #888888; |
} |