Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 283 → Rev 284

/forums/add-post.php
2,7 → 2,7
 
require '../_taios.php';
 
$page = new Taios_Page('Add Category', '../');
$page = new Taios_Page('Add Post', '../');
$page->drawHeader();
$page->drawMiddle();
 
40,7 → 40,7
</tr>
<tr>
<td class="bold">Content: </td>
<td><input type="text" name="content" /></td>
<td><textarea name="content"></textarea></td>
</tr>
<tr>
<td></td>
/forums/add-post-do.php
0,0 → 1,36
<?php
 
require '../_taios.php';
 
$page = new Taios_Page('Add Category', '../');
 
$page->checkLoggedIn();
 
$parentID = $_POST['parentID'];
if (empty($parentID))
{
$parentID = -1;
}
$categoryID = $_POST['categoryID'];
if (empty($categoryID))
{
$parentID = -1;
}
 
$title = $_POST['title'];
$content = $_POST['content'];
 
if (empty($title))
{
$page->redirect('add-post.php?error=No Title Specified');
}
if (empty($title))
{
$page->redirect('add-post.php?error=No Content Specified');
}
 
$page->query('INSERT INTO ForumPosts VALUES (0, ' .$page->getLoggedInUser()->ID . ', ' . $categoryID . ', ' . $parentID . ', "' . $title . '", "' . $content . '", NOW(), FALSE');
$page->redirect('index.php?parentID=' . $categoryID);
 
?>