However, I seem to have reached a stop, and need some brainstorming.
Here's how most of my pages have looked so far:
Code: Select all
<?php
// Start sessions
session_start();
// Start output buffering
ob_start();
// Include the loader module, which loops through all required plugins and loads them
require_once('modules/Loader.php');
// Define required plugins.
$plugins = array('MySQL','error_handler','Page');
// Include all plugins
$Loader = new Loader('modules/',$plugins);
// Initiate the custom error handler without logging (0).
$error = new error_handler(0);
// Connect to MySQL Database
$MySQL = new MySQL('host','database','user','pass') or trigger_error('MySQL Connection Failed');
// Page, handles content
$Page = new Page($MySQL,$_GET['page']);
?>Now, to actually put some content on the page:
Code: Select all
<html>
<head>
<title>
<?php
$Page->getTitle();
?>
</title>
</head>
<body>
<div>
<?php
$Page->printBody();
?>
</div>
</body>
</html>
<?php
ob_flush();
?>Let's say I next add another module called News, which will handle the printing of newsposts on the front page. Then I'd replace $Page->printBody() with an switch of if/else statement. Something like:
Code: Select all
if($_GET['page'])
{
$Page->printBody();
}
else
{
$News->printNews();
}Any ideas are welcome!