Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 46 → Rev 70

/_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)
115,7 → 115,7
function drawBlogPostTree($id)
{
$post = $this->getBlogPost($id);
write('<h3>' . $post->title. '</h3>');
write('<a href="' . $this->url . 'blog/post.php?' . $id . '"><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>');
 
122,16 → 122,36
$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()
{
$cats = array();
$ids = $this->findIDs('BlogPosts', 'WHERE ParentID = -1');
for ($i = 0; $i < count($ids); $i++)
{
$cat = $this->getBlogPost($ids[$i])->category;
if (!in_array($cat, $cats))
{
array_push($cats, $cat);
}
}
write('<h3>Categories</h3>');
for ($i = 0; $i < count($cats); $i++)
{
$this->drawMenuItem($cats[$i], 'blog/index.php?cat=' . $cats[$i]);
}
}
 
function redirect($url)
function redirect($u)
{
header('Location: ' . $url);
header('Location: ' . $u);
die();
}
/admin/account-do.php
50,3 → 50,4
$page->redirect('account.php?id=' . $userID);
 
?>
 
/admin/account.php
57,3 → 57,4
$page->drawFooter();
 
?>
 
/admin/index.php
24,3 → 24,4
$page->drawFooter();
 
?>
 
/blog/index.php
4,17 → 4,24
 
$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 />');
}
 
$ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1');
$query = 'WHERE ParentID = -1';
 
if (isset($_GET['cat']))
{
$query = $query . ' AND Category = "' . $_GET['cat'] . '"';
write('<p>Only showing blog posts from the ' . $_GET['cat'] . ' category. <a href="index.php">Reset Filtering</a></p><br />');
}
 
$ids = $page->findIDs('BlogPosts', $query);
for ($i = 0; $i < count($ids); $i++)
{
$id = $ids[$i];
/blog/post-add.php
6,13 → 6,12
 
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
8,13 → 8,12
$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()))
{
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 />');
}
 
23,3 → 22,4
$page->drawFooter();
 
?>
 
/styles.css
110,6 → 110,7
font-weight: bold;
}
 
p.indent {
margin-left: 5em;
.indent {
margin-left: 14px;
border-left: 1px solid #BBBBBB;
}