template_dir = TEMPLATE_DIR; $smarty->compile_dir = COMPILE_DIR; $smarty->cache_dir = CACHE_DIR; $smarty->config_dir = CONFIG_DIR; // Pass config variables to Smarty object. $smarty->assign('config', array( 'webpath' => WEB_PATH, 'rootpath' => ROOT_PATH, 'repo' => REPO_DIR) ); // Instantiate SQL class. $db = new SQL(); // Define PEAR options. $dsn = array ( 'phptype' => 'mysql', 'dbsyntax' => 'mysql', 'username' => DB_USER, 'password' => DB_PASS, 'hostspec' => DB_HOST, 'database' => DB_NAME ); // Try to connect. If we do not connect, show standard 'gone fishing' error page. if (!$db->connect($dsn)) { $wrapper = 'inc/wrappers/nonav.tpl'; $smarty->assign( array( 'content'=>'site-down.tpl', 'error'=>$db->error ) ); $smarty->display($wrapper); exit; } ?>