Subversion Repositories taios

Rev

Rev 285 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
284 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Add Category', '../');
6
 
7
$page->checkLoggedIn();
8
 
9
$parentID = $_POST['parentID'];
10
if (empty($parentID))
11
{
12
    $parentID = -1;
13
}
14
$categoryID = $_POST['categoryID'];
15
if (empty($categoryID))
16
{
17
    $parentID = -1;
18
}
19
 
20
$title = $_POST['title'];
21
$content = $_POST['content'];
22
 
471 muzer 23
if (!$page->isUserNormal($page->getLoggedInUser()))
24
{
25
    $page->redirect('add-post.php?error=You do not have permission to access this page');
26
}
27
 
284 tom 28
if (empty($title))
29
{
30
    $page->redirect('add-post.php?error=No Title Specified');
31
}
32
if (empty($title))
33
{
34
    $page->redirect('add-post.php?error=No Content Specified');
35
}
36
 
285 tom 37
$page->query('INSERT INTO ForumPosts VALUES (0, ' .$page->getLoggedInUser()->ID  . ', ' . $categoryID . ', ' . $parentID . ', "' . $title . '", "' . $content . '", NOW(), FALSE)');
284 tom 38
$page->redirect('index.php?parentID=' . $categoryID);
39
 
40
?>
41