Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 276 → Rev 281

/forums/index.php
17,9 → 17,17
{
write('<a href="index.php?parentID=-1">Back to root</a>');
}
if ($page->isLoggedIn())
{
if ($parentID 1= -1)
{
write(' &middot; ');
}
write('<a href="add-post.php?categoryID=' . $parentID . '">Add Post</a>');
}
if ($page->isUserAdmin($page->getLoggedInUser()))
{
if ($parentID != -1)
if ($page->isLoggedIn())
{
write(' &middot; ');
}
/forums/edit-category.php
0,0 → 1,59
<?php
 
require '../_taios.php';
 
$page = new Taios_Page('Edit Category', '../');
$page->drawHeader();
$page->drawMiddle();
 
$page->checkLoggedIn();
 
$id = $page->getGetID();
$cat = $page->getForumCategory($id);
 
if ($page->isUserAdmin($page->getLoggedInUser()) && $cat)
{
 
if (isset($_GET['error']))
{
$page->drawError($_GET['error'], false);
}
 
?>
 
<form action="edit-category-do.php" method="POST">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<table>
<tr>
<td class="bold">Title: </td>
<td><input type="text" name="title" value="<?php echo $cat->title; ?>" /></td>
</tr>
<tr>
<td class="bold">Description: </td>
<td><input type="text" name="description" value="<?php echo $cat->description; ?>" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Edit" /></td>
</tr>
</table>
</form>
 
<?php
}
else
{
if (!$cat)
{
$page->drawError('No such Forum Category, #' . $id);
}
else
{
$page->drawError('You do not have permission to access this page.');
}
}
 
$page->drawFooter();
 
?>
 
/forums/edit-category-do.php
0,0 → 1,30
<?php
 
require '../_taios.php';
 
$page = new Taios_Page('Edit Category', '../');
 
$page->checkLoggedIn();
 
$id = $page->getPostID();
 
$title = $_POST['title'];
$description = $_POST['description'];
 
if ($page->isUserAdmin($page->getLoggedInUser()))
{
if (empty($title))
{
$page->redirect('edit-category.php?error=No Title Specified');
}
$page->query('UPDATE ForumCategories SET Title = "' . $title . '", Description = "' . $description . '" WHERE ID = ' . $id);
$page->redirect('index.php');
}
else
{
$page->drawError('You do not have permission to access this page.');
}
 
?>