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"); ?>