Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 190 → Rev 191

/projects/index.php
6,7 → 6,15
$page->drawHeader();
$page->drawMiddle();
 
write('<br /><p class="bold">This page is currently under construction.</p>');
$ids = $page->findIDs('Projects', 'ORDER BY LastUpdate DESC');
for ($i = 0; $i < count($ids); $i++)
{
$id = $ids[$i];
$project = $page->getProject($id);
write('<h3>' . $project->title . '</h3>');
write('<br />');
}
 
$page->drawFooter();
 
/_taios.php
374,13 → 374,38
$this->drawError('Cannot find blog post, #' . $id);
}
function getProject($id)
{
$result = $this->query('SELECT * FROM Projects WHERE ID = ' . $id);
while ($row = mysql_fetch_array($result))
{
$project = new Project;
$project->ID = $row['ID'];
$project->author = $this->getUserByID($row['AuthorID']);
$project->title = $row['Title'];
$project->description = $row['Description'];
$project->logoURL = $row['LogoURL'];
$project->downloadURL = $row['DownloadURL'];
$project->websiteURl = $row['WebsiteURL'];
$project->latestVersion = $row['LatestVersion'];
$project->lastUpdate = strtotime($row['LastUpdate']);
return $project;
}
return false;
}
function delBlogPost($id)
{
$ids = $this->findIDs('BlogPosts', 'WHERE ParentID=' . $id);
for ($i = 0; $i < count($ids); $i++)
{
$this->delBlogPost($ids[$i]);
}
 
$this->query('delete from BlogPosts where ID=' . $id);
$this->query('DELETE FROM BlogPosts WHERE ID=' . $id);
}
 
function getGetID()
430,6 → 455,19
public $spam;
}
 
class Project
{
public $ID;
public $author;
public $title;
public $description;
public $logoURL;
public $downloadURL;
public $websiteURL;
public $latestVersion;
public $lastUpdate;
}
 
function write($str)
{
echo $str;
/install.sql
35,8 → 35,10
Title TEXT,
Description TEXT,
LogoURL TEXT,
DownloadURL TEXT,
WebsiteURL TEXT,
LatestVersion TEXT,
LastUpdate DATETIME
PRIMARY KEY(ID)
);
 
73,3 → 75,4
 
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());