/forums/add-category-do.php |
---|
0,0 → 1,34 |
<?php |
require '../_taios.php'; |
$page = new Taios_Page('Add Category', '../'); |
$page->checkLoggedIn(); |
$parentID = $_POST['parentID']; |
if (empty($parentID)) |
{ |
$parentID = -1; |
} |
$title = $_POST['title']; |
$description = $_POST['description']; |
if ($page->isUserAdmin($page->getLoggedInUser())) |
{ |
if (empty($title)) |
{ |
$page->redirect('add-category.php?error=No Title Specified'); |
} |
$page->query('INSERT INTO ForumCategories VALUES (0, ' . $parentID . ', "' . $title . '", "' . $description . '")'); |
$page->redirect('index.php?parentID=' . $parentID); |
} |
else |
{ |
$page->drawError('You do not have permission to access this page.'); |
} |
?> |
/forums/add-category.php |
---|
0,0 → 1,55 |
<?php |
require '../_taios.php'; |
$page = new Taios_Page('Add Category', '../'); |
$page->drawHeader(); |
$page->drawMiddle(); |
$page->checkLoggedIn(); |
$parentID = $_GET['parentID']; |
if (empty($parentID)) |
{ |
$parentID = -1; |
} |
if ($page->isUserAdmin($page->getLoggedInUser())) |
{ |
if (isset($_GET['error'])) |
{ |
$page->drawError($_GET['error'], false); |
} |
?> |
<form action="add-category-do.php" method="POST"> |
<input type="hidden" name="parentID" value="<?php echo $parentID; ?>" /> |
<table> |
<tr> |
<td class="bold">Title: </td> |
<td><input type="text" name="title" /></td> |
</tr> |
<tr> |
<td class="bold">Description: </td> |
<td><input type="text" name="description" /></td> |
</tr> |
<tr> |
<td></td> |
<td><input type="submit" value="Add" /></td> |
</tr> |
</table> |
</form> |
<?php |
} |
else |
{ |
$page->drawError('You do not have permission to access this page.'); |
} |
$page->drawFooter(); |
?> |
/forums/index.php |
---|
12,6 → 12,12 |
$parentID = -1; |
} |
if ($page->isUserAdmin($page->getLoggedInUser())) |
{ |
write('<p class="bold"><a href="add-category.php?parentID=' . $parentID . '">Add Category</a></p>'); |
} |
write('<br />'); |
$ids = $page->findIDs('ForumCategories', 'WHERE ParentID = ' . $parentID . ' ORDER BY Title ASC'); |
if (count($ids) >= 1) |
/admin/all-forum-posts.php |
---|
48,7 → 48,7 |
write('<td>' . $post->parent->title . '</td>'); |
} |
write('<td>' . $post->title . '</td>'); |
write('<td>' . str_replace("\n", ' ', $post->description) . '</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>'); |