$queries_count = 0; define('DB_PREFIX', $d_pre); // Initialize a connection to the mysql database $sqlConnection = new Sql($d_user, $d_pw, $d_server); $sqlConnection->Connect($d_base); // Load all configuration saved in the mysql database $config = new Config(&$sqlConnection); $config->LoadAll(); // Initialize the translation of short texts in the system $translation = new Language(&$sqlConnection); $translation->AddSources(__ROOT__ . '/lang'); // Create a new user class $user = new Account(&$sqlConnection, &$translation, &$config); // Load the comascript interpreter for the html output, set document and style information $output = new ComaLate(); $output->SetDoctype(DOCTYPE_XHTML_TRANSITIONAL); $styleName = $config->Get('style', 'default'); $headerStyleName = GetPostOrGet('style'); if (!empty($headerStyleName)) { $styleName = $headerStyleName; } $output->LoadTemplate('./styles/', $styleName); $output->SetMeta('generator', 'ComaCMS v0.2 (http://comacms.berlios.de)'); // Set page conditions $output->SetCondition('notinadmin', true); // Try to get a name of the requested page if (!isset($page) && substr($_SERVER['PHP_SELF'], -9) == 'index.php') { $page = $config->Get('default_page', 'home'); } elseif (!isset($page)) { $page = ''; }