Rev 266 | Rev 268 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
266 | tom | 1 | <?php |
2 | |||
3 | require '../_taios.php'; |
||
4 | |||
5 | $page = new Taios_Page('Add Category', '../'); |
||
6 | $page->drawHeader(); |
||
7 | $page->drawMiddle(); |
||
8 | |||
9 | $page->checkLoggedIn(); |
||
10 | |||
11 | $parentID = $_GET['parentID']; |
||
12 | if (empty($parentID)) |
||
13 | { |
||
14 | $parentID = -1; |
||
15 | } |
||
16 | |||
17 | $title = $_POST['title']; |
||
18 | $description = $_POST['description']; |
||
19 | |||
20 | if ($page->isUserAdmin($page->getLoggedInUser())) |
||
21 | { |
||
22 | if (empty($title)) |
||
23 | { |
||
24 | $page->redirect('add-category.php?error=No Title Specified'); |
||
25 | } |
||
26 | |||
267 | tom | 27 | $page->query('INSERT INTO ForumCategories VALUES (0, ' . $parentID . ', "' . $title . '", "' . $description . '")'); |
266 | tom | 28 | $page->redirect('index.php?parentID=' . $parentID); |
29 | } |
||
30 | else |
||
31 | { |
||
32 | $page->drawError('You do not have permission to access this page.'); |
||
33 | } |
||
34 | |||
35 | $page->drawFooter(); |
||
36 | |||
37 | ?> |
||
38 |