/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 />'); |
} |
19,7 → 19,7 |
{ |
$id = $ids[$i]; |
$post = $page->getBlogPost($id); |
write('<a href="post.php?id=' . $i . '"><h3>' . $post->title. '</h3></a>'); |
write('<a href="post.php?id=' . $ids[$i] . '"><h3>' . $post->title. '</h3></a>'); |
write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>'); |
write('<p>' . $post->content . '</p>'); |
} |
/_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) |
119,15 → 119,34 |
write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>'); |
write('<p>' . $post->content . '</p>'); |
$ids = $this->findIDs('BlogPosts', 'WHERE ParentID = ' . $id); |
$ids = $this->findIDs('BlogPosts', 'WHERE ParentID=' . $id); |
for ($i = 0; $i < count($ids); $i++) |
{ |
write('<p class="indent">'); |
$this->drawBlogPostTree($i); |
write('</p>'); |
write('<div class="indent">'); |
$this->drawBlogPostTree($ids[$i]); |
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(); |
17,13 → 17,23 |
{ |
if (isset($accessID) && $page->isUserAdmin($page->getLoggedInUser())) |
{ |
$page->query('UPDATE Users SET AccessID=' . $accessID . ' WHERE ID = ' . $userID); |
$page->query('UPDATE Users SET AccessID = "' . $accessID . '" WHERE ID = ' . $userID); |
} |
if (!empty($password)) |
{ |
$page->query('UPDATE Users SET Password=' . sha1($password) . ' WHERE ID = ' . $userID); |
$page->query('UPDATE Users SET Password = "' . sha1($password) . '" WHERE ID = ' . $userID); |
} |
if (!empty($email)) |
{ |
$page->query('UPDATE Users SET EmailAddress = "' . $email . '" WHERE ID = ' . $userID); |
} |
if (!empty($name)) |
{ |
$page->query('UPDATE Users SET Name = "' . $name . '" WHERE ID = ' . $userID); |
} |
} |
else |
{ |
37,6 → 47,6 |
} |
} |
$page->redirect('account.php?id=' . $id); |
$page->redirect('account.php?id=' . $userID); |
?> |