Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 127 → Rev 128

/blog/add-post.php
18,28 → 18,31
 
$error = '';
 
$title = $_POST['title'];
$content = $_POST['content'];
$parentID = $_POST['parentID'];
$category = $_POST['category'];
if (isset($_POST['post']))
{
$title = $_POST['title'];
$content = $_POST['content'];
$parentID = $_POST['parentID'];
$category = $_POST['category'];
 
if (empty($title))
{
$error = "No Title Specified";
if (empty($title))
{
$error = "No Title Specified";
}
else if (empty($content))
{
$error = "No Content Specified";
}
else if (empty($parentID))
{
$error = "No Parent ID Specified";
}
else
{
$page->query('INSERT INTO BlogPosts VALUES(0, ' . $parentID . ', "' . $page->getLoggedInUser()->ID . '", "' . $title . '", "' . $content . '", NOW(), "' . $category . '", 0)');
$page->redirect('index.php');
}
}
else if (empty($content))
{
$error = "No Content Specified";
}
else if (empty($parentID))
{
$error = "No Parent ID Specified";
}
else
{
$page->query('INSERT INTO BlogPosts VALUES(0, ' . $parentID . ', "' . $page->getLoggedInUser()->ID . '", "' . $title . '", "' . $content . '", NOW(), "' . $category . '", 0)');
$page->redirect('index.php');
}
 
$page->drawHeader();
$page->drawBlogCategoriesMenu();
67,8 → 70,10
<td><input type="text" name="category" /></td>
</tr>
 
<input type="hidden" name="post" value="yes" />
 
<?php
write('<input type="hidden" name="parentID" value="' . getParentID() . '"/>');
write('<input type="hidden" name="parentID" value="' . getParentID() . '" />');
?>
 
<tr>