Subversion Repositories taios

Rev

Rev 106 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
100 freddie 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Blog Posts', '../');
6
 
7
if (isset($_POST['title']) && isset($_POST['content']) && isset($_POST['catagory']) && isset($_POST['parentID']))
8
{
9
    $page->query('insert into BlogPosts VALUES(0, ' . $_POST['parentID'] . ', "' . $page->getLoggedInUser()->ID . '", "' . $_POST['title'] . '", "' . $_POST['content'] . '", NOW(), "' . $_POST['catagory'] . '", 0)');
10
    $page->redirect('index.php');
11
}
12
 
13
$page->drawHeader();
14
$page->drawBlogCategoriesMenu();
15
$page->drawMiddle();
16
 
17
if ($page->isUserGM($page->getLoggedInUser()))
18
{
19
    write('<p class="bold"><a href="add-post.php">Add Post</a></p>');
20
    write('<br />');
21
}
22
 
23
?>
24
 
25
<form action="post-add.php" method="post">
26
<table>
27
<tr>
28
<td class="bold">Title: </td>
29
<td><input type="text" name="title" /></td>
30
</tr>
31
<tr>
32
<td class="bold">Content: </td>
33
<td><input type="text" name="content" /></td>
34
</tr>
35
<tr>
36
<td class="bold">Catagory: </td>
37
<td><input type="text" name="catagory" /></td>
38
</tr>
39
 
40
<?php
41
write('<input type="hidden" name="parentID" value="' . $_GET['id'] . '"/>');
42
?>
43
 
44
<tr>
45
<td class="bold"></td>
46
<td><input type="submit" value="Post" /></td>
47
</tr>
48
</table>
49
</form>
50
 
51
<?php
52
 
53
$page->drawFooter();
54
 
55
?>