예제 #1
0
extract($config['settings']);
//setup
date_default_timezone_set($timezone);
//database
require 'db.php';
$db = new db($dbfile);
if (filesize($dbfile) == 0) {
    $db->setup('data/db.sql');
}
//route
require 'route.php';
$route = new route('home');
$basepath = $route->basepath;
$path = $route->path;
//do we need to redirect?
$newpath = $route->checkpath($path);
if ($path != $newpath) {
    $route->redirect($basepath . $newpath);
}
//backwards compat
if ($path == 'frontpage') {
    $route->redirect($basepath);
}
if (isset($_GET['page'])) {
    $route->redirect($basepath . htmlspecialchars($_GET['page']));
}
//set title
$pagetitle = isset($config['title'][$path]) ? $config['title'][$path] : ucwords(str_replace('-', ' ', $path));
//view
require 'view.php';
$view = new view();