Example #1
0
if (!$connected or empty($connected)) {
    $msg = L("db_conn_error", 'msg', $pdb->ErrorMsg());
    $msg .= "<br />" . L("db_conn_error_no", 'msg', $pdb->ErrorNo());
    if (!file_exists(DATA_PATH . "install.lock")) {
        $msg .= "<br /><a href='install/install.php'>" . L("please_reinstall_program", "msg") . "</a>";
    }
    header_sent($msg);
    exit;
}
if ($dbcharset && mysql_get_server_info() > '4.1') {
    $pdb->Execute("SET NAMES '{$dbcharset}'");
}
if (!file_exists(CACHE_PATH . "cache_setting.php")) {
    require_once LIB_PATH . "cache.class.php";
    $cache = new Caches();
    if ($cache->cacheAll()) {
        $msg .= "<a href='index.php'>" . L("cached_and_refresh") . "</a>";
        header_sent($msg);
        exit;
    }
}
$cachelost = (include CACHE_PATH . 'cache_setting.php') ? '' : 'settings';
$phpb2b_auth_key = md5($_PB_CACHE['setting']['auth_key'] . pb_getenv('HTTP_USER_AGENT'));
$php_self = pb_getenv('PHP_SELF');
$base_script = basename($php_self);
list($basefilename) = explode('.', $base_script);
if ($headercharset) {
    @header('Content-Type: text/html; charset=' . $charset);
}
//timezone
$time_offset = isset($_PB_CACHE['setting']['time_offset']) ? $_PB_CACHE['setting']['time_offset'] : 0;
Example #2
0
$file = new Files();
$conditions = null;
$tpl_file = "language";
if (isset($_POST['action'])) {
    $vals = $datas = array();
    foreach ($_POST['data']['item'] as $key => $val) {
        $_POST['data']['language'][$val]['img'] = str_replace(array("../", "../../"), "", $_POST['data']['language'][$val]['img']);
        $vals[$val] = $_POST['data']['language'][$val];
    }
    $datas['languages'] = serialize($vals);
    $setting->replace($datas);
    if (isset($_POST['update_dot'])) {
        foreach ($vals as $lang => $lang_var) {
            pb_configmake($lang, false);
            $cache->lang_dirname = $lang;
            $cache->cacheAll();
        }
    } else {
        pb_configmake($app_lang, false);
        $cache->updateLanguages();
    }
    flash("success");
}
$result = $file->getFolders("../languages/");
$items = array();
$installed_languages = array();
if (!empty($G['setting']['languages'])) {
    $installed_languages = unserialize($G['setting']['languages']);
}
if (!empty($result)) {
    foreach ($result as $key => $val) {