Example #1
0
 public static function init_lang_tpl()
 {
     $dir = PHPDISK_ROOT . 'system/global/';
     make_dir($dir);
     $file = $dir . 'lang_settings.inc.php';
     file_exists($file) ? require_once $file : lang_cache();
     $file = $dir . 'tpl_settings.inc.php';
     file_exists($file) ? require_once $file : tpl_cache();
     if (count($tpl_settings)) {
         foreach ($tpl_settings as $v) {
             if ($v[actived] && $v[tpl_type] == 'user') {
                 $user_tpl_dir = $v[tpl_name];
             }
             if ($v[actived] && $v[tpl_type] == 'admin') {
                 $admin_tpl_dir = $v[tpl_name];
             }
         }
     }
     if (count($lang_settings)) {
         foreach ($lang_settings as $v) {
             if ($v[actived]) {
                 $lang_name = $v[lang_name];
             }
         }
     }
     $user_tpl_dir = $user_tpl_dir ? "templates/{$user_tpl_dir}/" : 'templates/default/';
     $admin_tpl_dir = $admin_tpl_dir ? "templates/{$admin_tpl_dir}/" : 'templates/admin/';
     $lang_name = $lang_name ? $lang_name : 'zh_cn';
     return array('user_tpl_dir' => $user_tpl_dir, 'admin_tpl_dir' => $admin_tpl_dir, 'lang_name' => $lang_name);
 }
Example #2
0
 public static function init_lang_tpl()
 {
     global $C, $settings, $auth;
     $dir = PHPDISK_ROOT . 'system/global/';
     make_dir($dir);
     $file = $dir . 'lang_settings.inc.php';
     file_exists($file) ? require_once $file : lang_cache();
     $file = $dir . 'tpl_settings.inc.php';
     file_exists($file) ? require_once $file : tpl_cache();
     if (count($tpl_settings)) {
         foreach ($tpl_settings as $v) {
             if ($v[actived] && $v[tpl_type] == 'user') {
                 $user_tpl_dir = $v[tpl_name];
             }
             if ($v[actived] && $v[tpl_type] == 'admin') {
                 $admin_tpl_dir = $v[tpl_name];
             }
         }
     }
     if (count($lang_settings)) {
         foreach ($lang_settings as $v) {
             if ($v[actived]) {
                 $lang_name = $v[lang_name];
             }
         }
     }
     if ($settings[open_switch_tpls]) {
         $ptpl = gpc('ptpl', 'C', '');
         $user_tpl_dir = $C[tpl_name] = $ptpl ? check_template($ptpl) ? $ptpl : $user_tpl_dir : $user_tpl_dir;
         //$C[tpl_name] = $user_tpl_dir;
     }
     $arr = get_template_info($user_tpl_dir);
     $is_fms = $arr['template_core'] == 'fms' && $auth[open_fms] ? 1 : 0;
     $user_tpl_dir = $user_tpl_dir ? "templates/{$user_tpl_dir}/" : 'templates/default/';
     $admin_tpl_dir = $admin_tpl_dir ? "templates/{$admin_tpl_dir}/" : 'templates/admin/';
     $lang_name = $lang_name ? $lang_name : 'zh_cn';
     return array('user_tpl_dir' => $user_tpl_dir, 'admin_tpl_dir' => $admin_tpl_dir, 'lang_name' => $lang_name, 'fms' => $is_fms);
 }
Example #3
0
$up_size = gpc('up_size','G','');
$dir = PHPDISK_ROOT.'system/global/';
make_dir($dir);
$upload_max = get_byte_value(ini_get('upload_max_filesize'));
$post_max = get_byte_value(ini_get('post_max_size'));
$max_php_file_size = min($upload_max, $post_max);
$up_size = $max_php_file_size;
if($up_size==$max_php_file_size){
	$str = '您的网盘支持单个文件上传最大 <u style=\"font-size:14px;\">'.str_replace(' ','',get_size($max_php_file_size,'B',0)).'B</u>';
}else{
	$str = '您的网盘支持单个文件上传信息:<br>网盘主站, <u>'.str_replace(' ','',get_size($max_php_file_size,'B',0)).'B</u> ; 子服, <u>'.str_replace(' ','',get_size($up_size,'B',0)).'B</u><br><span <span style=\"color:red\">两个服务配置不一致!请重新配置,否则文件上传将可能会出现异常。</span>';
}

if($code && ($code==$configs['server_key'])){
	settings_cache();
	lang_cache();
	tpl_cache();
	group_settings_cache();
	echo 'var callback="[PHPDisk Tips] <span style=\"color:blue;\">'.__('sub_server_config_update_success').'</span><br><br>'.$str.'";';
}else{
	echo 'var callback="[PHPDisk Tips] <span style=\"color:red\">'.__('sub_server_config_update_fail').'</span><br><br>'.$str.'";';
}

?>
function update_config(){
	document.getElementById('tips').innerHTML = callback;
	document.getElementById('tips').innerHTML += '<br><br><div align="center"><input type="button" class="btn" onclick="javascript:window.close();" value="<?php 
echo __('btn_close');
?>
"></div>';
}