Subversion Repositories taios

Rev

Rev 100 | Rev 106 | Go to most recent revision | Details | Compare with Previous | 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
 
103 freddie 7
if ($this->
8
 
100 freddie 9
if (isset($_POST['title']) && isset($_POST['content']) && isset($_POST['catagory']) && isset($_POST['parentID']))
10
{
11
    $page->query('insert into BlogPosts VALUES(0, ' . $_POST['parentID'] . ', "' . $page->getLoggedInUser()->ID . '", "' . $_POST['title'] . '", "' . $_POST['content'] . '", NOW(), "' . $_POST['catagory'] . '", 0)');
12
    $page->redirect('index.php');
13
}
14
 
15
$page->drawHeader();
16
$page->drawBlogCategoriesMenu();
17
$page->drawMiddle();
18
 
19
if ($page->isUserGM($page->getLoggedInUser()))
20
{
21
    write('<p class="bold"><a href="add-post.php">Add Post</a></p>');
22
    write('<br />');
23
}
24
 
25
?>
26
 
103 freddie 27
<form action="add-post.php" method="post">
100 freddie 28
<table>
29
<tr>
30
<td class="bold">Title: </td>
31
<td><input type="text" name="title" /></td>
32
</tr>
33
<tr>
34
<td class="bold">Content: </td>
103 freddie 35
<td><textarea name="content" style="width: 523px; height: 543px">Content Here</textarea></td>
100 freddie 36
</tr>
37
<tr>
38
<td class="bold">Catagory: </td>
39
<td><input type="text" name="catagory" /></td>
40
</tr>
41
 
42
<?php
43
write('<input type="hidden" name="parentID" value="' . $_GET['id'] . '"/>');
44
?>
45
 
46
<tr>
47
<td class="bold"></td>
48
<td><input type="submit" value="Post" /></td>
49
</tr>
50
</table>
51
</form>
52
 
53
<?php
54
 
55
$page->drawFooter();
56
 
57
?>