db->fnExecute = '_count_execs'; $config = new DatabaseConfig($database); // load the theme parts $_theme = $config->get_string("theme", "default"); if(!file_exists("themes/$_theme")) $_theme = "default"; require_once "themes/$_theme/page.class.php"; require_once "themes/$_theme/layout.class.php"; require_once "themes/$_theme/themelet.class.php"; $themelets = glob("ext/*/theme.php"); foreach($themelets as $filename) { require_once $filename; } $custom_themelets = glob("themes/$_theme/*.theme.php"); if($custom_themelets) { $m = array(); foreach($custom_themelets as $filename) { if(preg_match("/themes\/$_theme\/(.*)\.theme\.php/",$filename,$m) && array_contains($themelets, "ext/{$m[1]}/theme.php")) { require_once $filename; } } } // initialise the extensions foreach(get_declared_classes() as $class) { if(is_subclass_of($class, "SimpleExtension")) { $c = new $class(); $c->i_am($c); add_event_listener($c); } } // start the page generation waterfall $page = new Page(); $user = _get_user($config, $database); send_event(new InitExtEvent()); send_event(_get_page_request()); $page->display(); // for databases which support transactions if($database->engine->name != "sqlite") { $database->db->CommitTrans(true); } } catch(Exception $e) { $version = VERSION; $message = $e->getMessage(); header("HTTP/1.0 500 Internal Error"); print << Internal error - SCore-$version

Internal Error

$message EOD; } ?>