/blog/post-add.php |
---|
6,13 → 6,13 |
if (isset($_POST['title']) && isset($_POST['content']) && isset($_POST['catagory']) && isset($_POST['parentID'])) |
{ |
$page->query('insert into BlogPosts VALUES(0, ' . $_POST['parentID'] . ', "' . $page->getLoggedInUser. '", "' . $_POST['title'] . '", "' . $_POST['content'] . '", NOW(), "' . $_POST['catagory'] . '", 0)'); |
$page->redirect("index.php"); |
$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(); |
write('<h3>Blog</h3>'); |
$page->drawMenuItem('Computing', 'index.php?cat=Computing'); |
$page->drawBlogCategoriesMenu(); |
$page->drawMiddle(); |
if ($page->isUserGM($page->getLoggedInUser())) |
/blog/post.php |
---|
9,12 → 9,12 |
$page->drawHeader(); |
write('<h3>Blog</h3>'); |
$page->drawMenuItem('Computing', 'index.php?cat=Computing'); |
$page->drawBlogCategoriesMenu(); |
$page->drawMiddle(); |
if ($page->isUserGM($page->getLoggedInUser())) |
{ |
write('<p class="bold"><a href="add-post.php">Add Post</a></p>'); |
write('<p class="bold"><a href="add-post.php?id="' . $_GET['id'] . '">Add Comment</a></p>'); |
write('<br />'); |
} |
/blog/index.php |
---|
5,12 → 5,12 |
$page = new Taios_Page('Blog Posts', '../'); |
$page->drawHeader(); |
write('<h3>Blog</h3>'); |
$page->drawMenuItem('Computing', 'index.php?cat=Computing'); |
$page->drawBlogCategoriesMenu(); |
$page->drawMiddle(); |
if ($page->isUserGM($page->getLoggedInUser())) |
{ |
write('<p class="bold"><a href="add-post.php">Add Post</a></p>'); |
write('<p class="bold"><a href="add-post.php?id=-1">Add Post</a></p>'); |
write('<br />'); |
} |
/_taios.php |
---|
67,7 → 67,7 |
function drawMenuItem($t, $u) |
{ |
write('<p><a href="' . $this->url . $u . '"</a>' . $t . '</a></p>'); |
write('<p><a href="' . $this->url . $u . '">' . $t . '</a></p>'); |
} |
function drawMiddle() |
95,7 → 95,7 |
$this->drawnFooter = true; |
} |
// die(); |
die(); |
} |
function drawError($text, $die = true) |
122,12 → 122,31 |
$ids = $this->findIDs('BlogPosts', 'WHERE ParentID=' . $id); |
for ($i = 0; $i < count($ids); $i++) |
{ |
write('<p class="indent">'); |
write('<div class="indent">'); |
$this->drawBlogPostTree($ids[$i]); |
write('</p>'); |
write('</div>'); |
} |
} |
function drawBlogCategoriesMenu($id) |
{ |
$cats = array(); |
$ids = $this->findIDs('BlogPosts'); |
for ($i = 0; $i < count($ids); $i++) |
{ |
$cat = $this->getBlogPost($ids[$i])->category; |
if (!in_array($cat, $cats)) |
{ |
array_push($cats, $cat); |
} |
} |
for ($i = 0; $i < count($cats); $i++) |
{ |
$this->drawMenuItem($cats[$i], $this->url . 'blog/index.php?cat=' . $cats[$i]); |
} |
} |
function redirect($url) |
{ |
/styles.css |
---|
110,6 → 110,7 |
font-weight: bold; |
} |
p.indent { |
margin-left: 5em; |
.indent { |
margin-left: 14px; |
border-left: 1px solid #BBBBBB; |
} |
/admin/account-do.php |
---|
1,8 → 1,8 |
<?php |
require '_taios.php'; |
require '../_taios.php'; |
$page = new Taios_Page('Update Account'); |
$page = new Taios_Page('Update Account', '../'); |
$userID = $page->getPostID(); |
$page->checkLoggedIn(); |