/blog/index.php |
---|
23,6 → 23,11 |
write('<p>Only showing blog posts from the ' . $_GET['cat'] . ' category. <a href="index.php">Reset Filtering</a></p><br />'); |
} |
if(!$page->isUserGM($page->getLoggedInUser())) |
{ |
$query = $query . ' AND Category != "Drafts"'; |
} |
$query = $query . " ORDER BY DatePosted DESC"; |
$ids = $page->findIDs('BlogPosts', $query); |
/blog/rss.php |
---|
13,7 → 13,7 |
write('<description>This is the RSS feed for the Tim32 Blog.</description>'); |
write('<link>http://tim32.org/blog/</link>'); |
$ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1 ORDER BY DatePosted DESC'); |
$ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1 AND CATEGORY != "Drafts" ORDER BY DatePosted DESC'); |
for ($i = 0; $i < count($ids); $i++) |
{ |
$id = $ids[$i]; |
/index.php |
---|
14,7 → 14,9 |
?> |
<p class="bold">Welcome to Tim32!</p> |
<p>Tim32 is a 10 year-old laptop running Ubuntu Server Edition 10.04.</p> |
<?php |
write('<p>Tim32 is a ' . (date("Y") - 2000) . '-year-old laptop running Ubuntu Server Edition 10.04.</p>'); |
?> |
<br /> |
<h3 title="Take the Tim32 challenge: http://tim32.org/challenge/">Latest Blog Posts</h3> |
22,7 → 24,7 |
<?php |
$ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1 ORDER BY DatePosted DESC'); |
$ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1 AND Category != "Drafts" ORDER BY DatePosted DESC'); |
for ($i = 0; $i < 4 && $i < count($ids); $i++) |
{ |
$id = $ids[$i]; |
/login-do.php |
---|
8,19 → 8,24 |
$password = $_POST['password']; |
$remember = $_POST['remember'] == 'yes'; |
if(strpos($_POST['oldurl'], "tim32.org") === FALSE || strpos($_POST['oldurl'], "login") !== FALSE) |
$redirurl = "http://tim32.org"; |
else |
$redirurl = $_POST['oldurl']; |
if (empty($username)) |
{ |
$page->redirect('login.php?error=No Username Specified'); |
$page->redirect('login.php?error=No Username Specified&oldurl=' . urlencode($redirurl)); |
} |
if (empty($password)) |
{ |
$page->redirect('login.php?error=No Password Specified'); |
$page->redirect('login.php?error=No Password Specified&oldurl=' . urlencode($redirurl)); |
} |
$user = $page->getUserByUsername($username); |
if (!$user || $user->password != sha1($password)) |
{ |
$page->redirect('login.php?error=Incorrect Username or Password'); |
$page->redirect('login.php?error=Incorrect Username or Password&oldurl=' . urlencode($redirurl)); |
} |
$expires = -1; |
32,6 → 37,6 |
setcookie('Tim32_Login', $user->username . '|~|' . $user->password, $expires, '/'); |
$page->redirect('index.php'); |
$page->redirect($redirurl); |
?> |
/login.php |
---|
21,6 → 21,12 |
?> |
<form action="login-do.php" method="POST"> |
<?php |
$redirurl = $_SERVER['HTTP_REFERER']; |
if($_GET['oldurl']) |
$redirurl = $_GET['oldurl']; |
write('<input type="hidden" name="oldurl" value="' . $redirurl . '" />'); |
?> |
<table> |
<tr> |
<td class="bold">Username: </td> |
/_taios.php |
---|
40,7 → 40,7 |
write('<body>'); |
write('<div class="sidebar">'); |
write('<div class="sidebar-header">'); |
write('<h1>Tim32</h1>'); |
write('<a href="' . $this->url . '"><h1>Tim32</h1></a>'); |
write('</div>'); |
write('<div class="sidebar-menu">'); |
$this->drawMenuItem('Home', 'index.php'); |
93,7 → 93,7 |
write('</div>'); |
write('</div>'); |
write('<div class="content">'); |
write('<h2>' . $this->title . '</h2>'); |
write('<a href="./"><h2>' . $this->title . '</h2></a>'); |
$this->drawnMiddle = true; |
} |
170,7 → 170,7 |
for ($i = 0; $i < count($ids); $i++) |
{ |
$cat = $this->getBlogPost($ids[$i])->category; |
if (!in_array($cat, $cats)) |
if (!in_array($cat, $cats) && ($cat != "Drafts" || $this->isUserGM($this->getLoggedInUser()))) |
{ |
array_push($cats, $cat); |
} |
237,7 → 237,7 |
'<u>$1</u>', |
'<a href="$1">$1</a>', |
'<a href="$1">$2</a>', |
'<div class="code">$1</div>', |
'</p><div class="code">$1</div><p>', |
'<img src="$1" />', |
'<ul>$1</ul>', |
'<ol>$1</ol>', |