} require_once K_COUCH_DIR . 'functions.php'; $FUNCS = new KFuncs(); // Language file global $t; $t = array(); require_once K_COUCH_DIR . 'lang/EN.php'; $FUNCS->_t = $t; if (K_ADMIN_LANG != 'EN' && file_exists(K_COUCH_DIR . 'lang/' . K_ADMIN_LANG . '.php')) { $t = array(); require_once K_COUCH_DIR . 'lang/' . K_ADMIN_LANG . '.php'; $FUNCS->_t = array_merge($FUNCS->_t, $t); } unset($t); if (get_magic_quotes_gpc()) { $_GET = $FUNCS->stripslashes_deep($_GET); $_POST = $FUNCS->stripslashes_deep($_POST); $_COOKIE = $FUNCS->stripslashes_deep($_COOKIE); } $_GET = $FUNCS->sanitize_deep($_GET); require_once K_COUCH_DIR . 'db.php'; $DB = new KDB(); if (!$DB->connect()) { die('<h1>Could not connect to database</h1>' . mysql_error()); } // get Couch's version $_rs = @mysql_query("select k_value from " . K_TBL_SETTINGS . " where k_key='k_couch_version'", $DB->conn); if ($_rs && ($_row = mysql_fetch_row($_rs))) { $_ver = $_row[0]; if (version_compare(K_COUCH_VERSION, $_ver, ">")) { // Upgrade required