Subversion Repositories taios

Rev

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