Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 290 → Rev 232

/wiki/edit.php
12,8 → 12,6
$page->drawHeader();
$page->drawMiddle();
 
$page->checkLoggedIn();
 
if ($page->isUserGM($page->getLoggedInUser()))
{
$filename = 'pages/' . $pageName . '.txt';
/wiki/edit-do.php
10,8 → 10,6
 
$page = new Taios_Page('Edit Page - ' . $pageName, '../');
 
$page->checkLoggedIn();
 
if ($page->isUserGM($page->getLoggedInUser()))
{
$filename = 'pages/' . $pageName . '.txt';
/admin/all-forum-categories.php
File deleted
/admin/all-forum-posts.php
File deleted
/admin/index.php
17,6 → 17,7
write('<h4><a href="all-blog-posts.php">Manage All Blog Posts</a></h4>');
write('<h4><a href="all-projects.php">Manage All Projects</a></h4>');
write('<h4><a href="all-forum-categories.php">Manage All Forum Categories</a></h4>');
write('<h4><a href="all-forum-topics.php">Manage All Forum Topics</a></h4>');
write('<h4><a href="all-forum-posts.php">Manage All Forum Posts</a></h4>');
}
 
/projects/edit-project.php
6,8 → 6,6
$page->drawHeader();
$page->drawMiddle();
 
$page->checkLoggedIn();
 
$project = $page->getProject($page->getGetID());
if (!$project)
{
/projects/index.php
49,7 → 49,7
write('</table>');
if ($page->isUserAdmin($page->getLoggedInUser()) || $user->ID == $project->author->ID)
{
write('<p class="bold"><a href="edit-project.php?id=' . $project->ID . '">Edit Project</a> &nbsp;&nbsp; &middot; &nbsp;&nbsp; <a href="delete-project-do.php?id=' . $project->ID . '">Delete Project</a></p>');
write('<p><a href="edit-project.php?id=' . $project->ID . '">Edit Project</a> &nbsp;&nbsp; &middot; &nbsp;&nbsp; <a href="delete-project-do.php?id=' . $project->ID . '">Delete Project</a></p>');
}
write('<br />');
}
/styles.css
61,7 → 61,6
border: 1px solid #000000;
color: #000000;
background-color: #B5D7FF;
width: 500px;
}
 
table {
/_taios.php
125,7 → 125,7
}
write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>');
write('<p>' . $this->replaceBBCode($post->content) . '</p>');
 
write('<br />');
if ($this->isUserNormal($this->getLoggedInUser()))
{
echo '<p class="bold"><a href="add-post.php?id=' . $id . '">Add Comment</a>';
284,7 → 284,7
$result = mysql_query($query);
if (!$result)
{
$this->drawError('Query Failed: ' . $query . "\n" . 'MySQL Error: ' . mysql_error());
$this->drawError('MySQL Error: ' . mysql_error());
}
return $result;
397,46 → 397,6
return false;
}
function getForumCategory($id)
{
$result = $this->query('SELECT * FROM ForumCategories WHERE ID = ' . $id);
while ($row = mysql_fetch_array($result))
{
$f = new ForumCategory;
$f->ID = $row['ID'];
$f->parent = $this->getForumCategory($row['ParentID']);
$f->title = $row['Title'];
$f->description = $row['Description'];
return $f;
}
return false;
}
function getForumPost($id)
{
$result = $this->query('SELECT * FROM ForumPosts WHERE ID = ' . $id);
while ($row = mysql_fetch_array($result))
{
$f = new ForumPost;
$f->ID = $row['ID'];
$f->author = $this->getUserByID($row['AuthorID']);
$f->category = $this->getForumCategory($row['CategoryID']);
$f->parent = $this->getForumPost($row['ParentID']);
$f->title = $row['Title'];
$f->content = $row['Content'];
$f->datePosted = strtotime($row['DatePosted']);
$f->spam = $row['Spam'];
return $f;
}
return false;
}
function delBlogPost($id)
{
$ids = $this->findIDs('BlogPosts', 'WHERE ParentID=' . $id);
508,26 → 468,6
public $lastUpdate;
}
 
class ForumCategory
{
public $ID;
public $parent;
public $title;
public $description;
}
 
class ForumPost
{
public $id;
public $author;
public $category;
public $parent;
public $title;
public $content;
public $datePosted;
public $spam;
}
 
function write($str)
{
echo $str;
/install.sql
51,13 → 51,22
PRIMARY KEY(ID)
);
 
CREATE TABLE ForumPosts
CREATE TABLE ForumTopics
(
ID INT NOT NUll AUTO_INCREMENT,
AuthorID INT,
CategoryID INT,
ParentID INT,
Title TEXT,
DatePosted DATETIME,
PRIMARY KEY(ID)
);
 
CREATE TABLE ForumPosts
(
ID INT NOT NUll AUTO_INCREMENT,
AuthorID INT,
TopicID INT,
Title TEXT,
Content TEXT,
DatePosted DATETIME,
Spam BOOLEAN,
67,6 → 76,3
INSERT INTO Users VALUES (1, 0, "admin", SHA1("password"), "admins@tim32.org", "Tim32 Admin", 0);
INSERT INTO BlogPosts VALUES(1, -1, 1, "Welcome to Tim32!", "Welcome to the new Tim32 website! It has had a complete design re-think to make it simpler and easier to use!", NOW(), "Tim32", FALSE);
INSERT INTO Projects VALUES (1, 1, "TAIOS", "TAIOS (The All In One System) is a PHP based system to make the Tim32 website very self contained and altogether.", "http://websvn.kde.org/*checkout*/trunk/kdesupport/oxygen-icons/64x64/categories/applications-internet.png", "", "http://tim32.org/~tom/taios/", "SVN", NOW());
INSERT INTO ForumCategories VALUES (1, -1, "Tim32", "Talk about Tim32 in here");
INSERT INTO ForumCategories VALUES (2, 1, "TAIOS", "Talk about TAIOS in here");
INSERT INTO ForumPosts VALUES (1, 1, 2, -1, "TAIOS Almost Finished", "As I speak we are currently in the process of finilising TAIOS so it works perfectly! I'm pleased to accounce that TAIOS should be ready within the next week or so! :D", NOW(), FALSE);
/forums/add-post-do.php
File deleted
/forums/add-post.php
File deleted
/forums/delete-category-do.php
File deleted
/forums/edit-category-do.php
File deleted
/forums/edit-category.php
File deleted
/forums/add-category-do.php
File deleted
/forums/add-category.php
File deleted
/forums/post.php
File deleted
/forums/index.php
6,68 → 6,8
$page->drawHeader();
$page->drawMiddle();
 
$parentID = $_GET['parentID'];
if (empty($parentID))
{
$parentID = -1;
}
write('<br /><p class="bold">This page is currently under construction.</p>');
 
write('<p class="bold">');
if ($parentID != -1)
{
write('<a href="index.php?parentID=-1">Back to root</a>');
}
if ($page->isLoggedIn())
{
if ($parentID != -1)
{
write(' &middot; ');
}
write('<a href="add-post.php?categoryID=' . $parentID . '">Add Post</a>');
}
if ($page->isUserAdmin($page->getLoggedInUser()))
{
if ($page->isLoggedIn())
{
write(' &middot; ');
}
write('<a href="add-category.php?parentID=' . $parentID . '">Add Category</a>');
}
write('</p><br />');
 
$ids = $page->findIDs('ForumCategories', 'WHERE ParentID = ' . $parentID . ' ORDER BY Title ASC');
 
if (count($ids) >= 1)
{
write('<h3>Categories</h3>');
}
 
for ($i = 0; $i < count($ids); $i++)
{
$forumCategory = $page->getForumCategory($ids[$i]);
write('<h4><a href="index.php?parentID=' . $forumCategory->ID . '">' . $forumCategory->title . '</a></h4>');
write('<p>' . $forumCategory->description . '</p>');
if ($page->isUserAdmin($page->getLoggedInUser()))
{
write('<p class="bold"><a href="edit-category.php?id=' . $forumCategory->ID . '">Edit Category</a> &nbsp;&nbsp; &middot; &nbsp;&nbsp; <a href="delete-category-do.php?id=' . $forumCategory->ID . '">Delete Category</a></p>');
}
write('<br />');
}
 
$ids = $page->findIDs('ForumPosts', 'WHERE CategoryID = ' . $parentID . ' AND ParentID = -1 ORDER BY Title ASC');
 
if (count($ids) >= 1)
{
write('<h3>Topics</h3>');
}
 
for ($i = 0; $i < count($ids); $i++)
{
$forumPost = $page->getForumPost($ids[$i]);
write('<h4><a href="post.php?id=' . $forumPost->ID . '">' . $forumPost->title . '</a></h4>');
write('<br />');
}
 
$page->drawFooter();
 
?>
/photos/albums/Lassitor/Lassitor.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/photos/albums/Lassitor/Lassitor.png
Property changes:
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: photos/albums/Lassitor/Lassitor-3d.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: photos/albums/Lassitor/Lassitor-3d.png
===================================================================
--- photos/albums/Lassitor/Lassitor-3d.png (revision 290)
+++ photos/albums/Lassitor/Lassitor-3d.png (nonexistent)
/photos/albums/Lassitor/Lassitor-3d.png
Property changes:
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: photos/album.php
===================================================================
--- photos/album.php (revision 290)
+++ photos/album.php (nonexistent)
@@ -1,72 +0,0 @@
-
-
-require '../_taios.php';
-
-function getImageSizes($sourceImageFilePath, $maxResizeWidth, $maxResizeHeight) {
-
- $size = getimagesize($sourceImageFilePath);
- $origWidth = $size[0];
- $origHeight = $size[1];
-
- $resizedWidth = $origWidth;
- $resizedHeight = $origHeight;
-
- if ($resizedWidth > $maxResizeWidth)
- {
- $aspectRatio = $maxResizeWidth / $resizedWidth;
- $resizedWidth = round($aspectRatio * $resizedWidth);
- $resizedHeight = round($aspectRatio * $resizedHeight);
- }
- if ($resizedHeight > $maxResizeHeight)
- {
- $aspectRatio = $maxResizeHeight / $resizedHeight;
- $resizedWidth = round($aspectRatio * $resizedWidth);
- $resizedHeight = round($aspectRatio * $resizedHeight);
- }
-
- return array($resizedWidth, $resizedHeight);
-}
-
-$page = new Taios_Page('Photo Albums', '../');
-$page->drawHeader();
-$page->drawMiddle();
-
-$dirName = $_GET['dir'];
-if (empty($dirName))
-{
- $page->redirect('index.php');
-}
-
-write('

Back to Photos


');
-
-write('');');');');');
-write('
-
-$i = 0;
-
-$dir = dir('albums/' . $dirName);
-while (($file = $dir->read()) !== false)
-{
- if ($file[0] != '.')
- {
- if ($i >= 4)
- {
- write('
- }
-
- $filename = 'albums/' . $dirName . '/' . $file;
- $size = getImageSizes($filename, 200, 200);
-
- write('
-
- $i++;
- }
-}
-
-write('
-write('');
-
-$page->drawFooter();
-
-?>
-
Index: photos/index.php
===================================================================
--- photos/index.php (revision 290)
+++ photos/index.php (revision 232)
@@ -2,21 +2,12 @@
require '../_taios.php';
-$page = new Taios_Page('Photo Albums', '../');
+$page = new Taios_Page('Photos', '../');
$page->drawHeader();
$page->drawMiddle();
-write('

Here we have all sorts of photos from Tim32.


');
+write('

This page is currently under construction.

');
-$dir = dir('albums/');
-while (($file = $dir->read()) !== false)
-{
- if ($file[0] != '.')
- {
- write('

' . $file . '

');
- }
-}
-
$page->drawFooter();
?>