header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Datum in het verleden
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
error_reporting(0);
require_once ( dirname(__FILE__) . "/lib/include.inc.php");
require_once ( dirname(__FILE__) . "/lib/base/base.class.php");
require_once ( dirname(__FILE__) . "/settings/set.databases.php");
require_once ( dirname(__FILE__) . "/lib/dispatch.class.php");
require_once ( dirname(__FILE__) . "/modules/mod.sidebar.php");
require_once ( dirname(__FILE__) . "/modules/mod.seo.php");
$db = NULL;
if ( class_exists("Database") ) {
$db = new Database();
$db->connect();
}
$tpl = new TemplatePower($config['path'] . "/templates/layout.tpl");
$tpl->assignInclude("LEFT-SIDEBAR", $config['path'] . "/templates/left-sidebar.tpl");
/* Main modules*/
$pages = array();
if (count($_GET)>0) {
$a = each($_GET);
array_push($pages, $a['key']);
}
if ( count($pages) >0) {
$pages[0] = trim ($pages[0]);
if ( substr($pages[0], strlen($pages[0])-1, 1) == '/' ) {
$pages[0] = substr($pages[0], 0, strlen($pages[0])-1);
}
$pages = split ('\/', $pages[0]);
//preg_match ('/\//', $pages[0], $pages);
}
/*
Dispatch to proper module
*/
try {
$mod = new Dispatch( $tpl, $pages );
$mod->Run();
} catch (Exception $e) {
die ('Catched error: ' . $e );
}
/*
Set top navigation
*/
$_activeTab = 1;
if (count($pages)>0) {
switch ($pages[0]) {
case 'nieuwste-artikelen':
$_activeTab = 2;
break;
case 'meest-gelezen':
$_activeTab = 3;
break;
case 'help':
$_activeTab = 4;
break;
default:
break;
}
}
$tpl->NewBlock ("top-navigation");
$tpl->Assign (
array (
'nav_top_active_' . $_activeTab => 'active',
'nav_top_active_' . $_activeTab . '_strong_pre' => '',
'nav_top_active_' . $_activeTab . '_strong_post' => '',
'nav_top_active_' . $_activeTab . '_span' => ''
)
);
/*
Sidebar
*/
$sidebar = new Sidebar($tpl);
$sidebar->Run($pages);
/*
Set global template variables
*/
$tpl->AssignGlobal(array(
'url' => $config['url'],
'urlimg' => $config['urlimg']
));
require_once ( dirname(__FILE__) . "/lib/footer.inc.php");
?>