Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 154 → Rev 160

/styles.css
72,6 → 72,10
border: 1px solid #888888;
}
 
img {
border: 2px solid #333333;
}
 
.sidebar {
left: 0px;
top: 0px;
/404.php
17,6 → 17,12
<p class="bold">404 - Page not found</p>
<p>The page you requested could not be found.</p>
 
<h4>Useful Links</h4>
 
<?php
 
$page->drawMenuItem('Tim32 Homepage', 'index.php');
 
$page->drawFooter();
 
?>
/blog/edit-post.php
0,0 → 1,87
<?php
 
require '../_taios.php';
 
$page = new Taios_Page('Blog Posts', '../');
 
if (!isset($_GET['id']))
$id = $_GET['id'];
else if (!isset($_POST['id']))
$id = $_POST['id'];
else
$page->redirect("index.php");
 
$page->checkLoggedIn();
 
$post = $page->getBlogPost($id);
if (!$page->isUserAdmin($page->getLoggedInUser()) && $page->getLoggedInUser()->ID != $post->author->ID)
{
$page->drawError('You do not have permission to access this page.');
}
 
$error = '';
 
if (isset($_POST['id']))
{
$title = $_POST['title'];
$content = $_POST['content'];
$category = $_POST['category'];
 
if (empty($title))
{
$error = "No Title Specified";
}
else if (empty($content))
{
$error = "No Content Specified";
}
else
{
$page->query('update BlogPosts set (Content="' . $content . '", Title="' . $title . '", Category="' . $category . '") where ID=' . $id);
$page->redirect('index.php');
}
}
 
$page->drawHeader();
$page->drawBlogCategoriesMenu();
$page->drawMiddle();
 
if (!empty($error))
{
$page->drawError($error, false);
}
 
?>
 
<form action="add-post.php?id=<?php echo getParentID(); ?>" method="post">
<table>
<tr>
<td class="bold">Title: </td>
<td><input type="text" name="title" value="<?php echo post->title; ?>/></td>
</tr>
<tr>
<td class="bold">Content: </td>
<td><textarea name="content" style="width: 500px; height: 300px;"><?php echo $post->content;</textarea></td>
</tr>
<tr>
<td class="bold">Catagory: </td>
<td><input type="text" name="category" /><?php echo $post->category; ?></td>
</tr>
 
<?php
write('<input type="hidden" name="is" value="' . $id . '" />');
?>
 
<tr>
<td class="bold"></td>
<td><input type="submit" value="Post" /></td>
</tr>
</table>
</form>
 
<?php
 
$page->drawFooter();
 
?>
 
/_taios.php
182,7 → 182,8
'/\[i\](.+?)\[\/i\]/is',
'/\[u\](.+?)\[\/u\]/is',
'/\[url\](.+?)\[\/url\]/is',
'/\[code\](.+?)\[\/code\]/is'
'/\[code\](.+?)\[\/code\]/is',
'/\[img\](.+?)\[\/img\]/is'
);
 
$html = array(
190,7 → 191,8
'<i>$1</i>',
'<u>$1</u>',
'<a href="$1">$1</a>',
'<div class="code">$1</div>'
'<div class="code">$1</div>',
'<img src="$1" />'
);
 
$newstr = preg_replace($bbcode, $html, $newstr);