Subversion Repositories taios

Rev

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

<?php

require '../_taios.php';

$page = new Taios_Page('Blog Posts', '../');

if (isset($_POST['title']) && isset($_POST['content']) && isset($_POST['catagory']) && isset($_POST['parentID']))
{
    $page->query('insert into BlogPosts VALUES(0, ' . $_POST['parentID'] . ', "' . $page->getLoggedInUser()->ID . '", "' . $_POST['title'] . '", "' . $_POST['content'] . '", NOW(), "' . $_POST['catagory'] . '", 0)');
    $page->redirect('index.php');
}

$page->drawHeader();
$page->drawBlogCategoriesMenu();
$page->drawMiddle();

if ($page->isUserGM($page->getLoggedInUser()))
{
    write('<p class="bold"><a href="add-post.php">Add Post</a></p>');
    write('<br />');
}

?>

<form action="post-add.php" method="post">
<table>
<tr>
<td class="bold">Title: </td>
<td><input type="text" name="title" /></td>
</tr>
<tr>
<td class="bold">Content: </td>
<td><input type="text" name="content" /></td>
</tr>
<tr>
<td class="bold">Catagory: </td>
<td><input type="text" name="catagory" /></td>
</tr>

<?php
write('<input type="hidden" name="parentID" value="' . $_GET['id'] . '"/>');
?>

<tr>
<td class="bold"></td>
<td><input type="submit" value="Post" /></td>
</tr>
</table>
</form>

<?php

$page->drawFooter();

?>