/blog/post-add.php |
---|
File deleted |
/blog/add-post.php |
---|
0,0 → 1,57 |
<?php |
require '../_taios.php'; |
$page = new Taios_Page('Blog Posts', '../'); |
if ($this-> |
if (isset($_POST['title']) && isset($_POST['content']) && isset($_POST['catagory']) && isset($_POST['parentID'])) |
{ |
$page->query('insert into BlogPosts VALUES(0, ' . $_POST['parentID'] . ', "' . $page->getLoggedInUser()->ID . '", "' . $_POST['title'] . '", "' . $_POST['content'] . '", NOW(), "' . $_POST['catagory'] . '", 0)'); |
$page->redirect('index.php'); |
} |
$page->drawHeader(); |
$page->drawBlogCategoriesMenu(); |
$page->drawMiddle(); |
if ($page->isUserGM($page->getLoggedInUser())) |
{ |
write('<p class="bold"><a href="add-post.php">Add Post</a></p>'); |
write('<br />'); |
} |
?> |
<form action="add-post.php" method="post"> |
<table> |
<tr> |
<td class="bold">Title: </td> |
<td><input type="text" name="title" /></td> |
</tr> |
<tr> |
<td class="bold">Content: </td> |
<td><textarea name="content" style="width: 523px; height: 543px">Content Here</textarea></td> |
</tr> |
<tr> |
<td class="bold">Catagory: </td> |
<td><input type="text" name="catagory" /></td> |
</tr> |
<?php |
write('<input type="hidden" name="parentID" value="' . $_GET['id'] . '"/>'); |
?> |
<tr> |
<td class="bold"></td> |
<td><input type="submit" value="Post" /></td> |
</tr> |
</table> |
</form> |
<?php |
$page->drawFooter(); |
?> |
/blog/post.php |
---|
4,7 → 4,7 |
$page = new Taios_Page('Blog Posts', '../'); |
if ($_GET['id'] == -1) |
if (!isset($_GET['id']) || $_GET['id'] == "" || $_GET['id'] == -1) |
$page->redirect('index.php'); |
if (!isset($_GET['id'])) |
/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++) |
{ |
$post = $page->getBlogPost($ids[$i]); |
write('<tr>'); |
write('<td><a href="../blog/edit-post.php?id=' . $post->ID . '">' . $post->ID . '</a></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/all-accounts.php |
---|
28,7 → 28,7 |
{ |
$user = $page->getUserByID($ids[$i]); |
write('<tr>'); |
write('<td>' . $user->ID . '</td>'); |
write('<td><a href="account.php?id=' . $user->ID . '">' . $user->ID . '</a></td>'); |
write('<td>' . $user->accessID . '</td>'); |
write('<td>' . $user->username . '</td>'); |
write('<td>' . $user->password . '</td>'); |
/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>'); |
/_taios.php |
---|
124,7 → 124,7 |
write('<br />'); |
if ($this->isUserNormal($this->getLoggedInUser())) |
{ |
write('<p class="bold"><a href="post-add.php?id=' . $id . '">Add Comment</a></p>'); |
write('<p class="bold"><a href="add-post.php?id=' . $id . '">Add Comment</a></p>'); |
write('<br />'); |
} |