All Data Structures Namespaces Files Functions Variables Pages
configmng.php
Go to the documentation of this file.
<?php
if(!defined('IN_ADMIN')) {
exit('Access Denied');
}
if($command == 'edit') {
$ednum = 0;
$edfmt = Array('authkey'=>'','bbsurl'=>'','gameurl'=>'','homepage'=>'','moveut'=>'int','moveutmin'=>'int','tplrefresh'=>'b','errorinfo'=>'b');
$edlist = Array();
$cmd_info = '';
foreach($edfmt as $key => $val){
if(isset($_POST[$key])){
${'o_'.$key} = ${$key};
if($val == 'int'){
${$key} = intval($_POST[$key]);
}elseif($val == 'b'){
intval($_POST[$key]) != 0 ? ${$key} = 1 : ${$key} = 0;
}else{
${$key} = astrfilter($_POST[$key]);
}
if(${$key} != ${'o_'.$key}){
$ednum ++;
if(${$key}===''){
$cmd_info .= "$lang[$key] 已清空<br>";
}else{
$cmd_info .= "$lang[$key] 修改为 ${$key} <br>";
}
$edlist[$key] = ${$key};
}
}
}
$cmd_info .= "提交的修改请求数量： $ednum <br>";
if($ednum){
//$adminlog = '';
$configfile = file_get_contents('./config.inc.php');
foreach($edlist as $key => $val){
if($edfmt[$key] == 'int' || $edfmt[$key] == 'b'){
$configfile = preg_replace("/[$]{$key}\s*\=\s*-?[0-9]+;/is", "\${$key} = ${$key};", $configfile);
}else{
$configfile = preg_replace("/[$]{$key}\s*\=\s*[\"'].*?[\"'];/is", "\${$key} = '${$key}';", $configfile);
}
//$adminlog .= setadminlog('configmng',$key,$val);
}
file_put_contents('./config.inc.php',$configfile);
//putadminlog($adminlog);
adminlog('configmng');
$cmd_info .= '服务参数已修改';
}
}
$sysnow = time();
list($nowsec,$nowmin,$nowhour,$nowday,$nowmonth,$nowyear,$nowwday,$nowyday,$nowisdst) = localtime($sysnow);
$nowmonth++;
$nowyear += 1900;
$orin_time = $nowyear.$lang['year'].$nowmonth.$lang['month'].$nowday.$lang['day'].$nowhour.$lang['hour'].$nowmin.$lang['min'];
list($setsec,$setmin,$sethour,$setday,$setmonth,$setyear,$setwday,$setyday,$setisdst) = localtime($sysnow + $moveut*3600 + $moveutmin*60);
$setmonth++;
$setyear += 1900;
$set_time = $setyear.$lang['year'].$setmonth.$lang['month'].$setday.$lang['day'].$sethour.$lang['hour'].$setmin.$lang['min'];
include template('admin_configmng');
?>
$cmd_info
while($gm=$db->fetch_array($result)) $cmd_info
Definition: gmlist.php:10
$moveutmin
$moveutmin
Definition: config.inc.php:52
$setyear
$setyear
Definition: configmng.php:61
$sysnow
if(!defined('IN_ADMIN')) if($command== 'edit') $sysnow
Definition: configmng.php:54
$set_time
$set_time
Definition: configmng.php:62
$moveut
$moveut
Definition: config.inc.php:49
$orin_time
$orin_time
Definition: configmng.php:58
elseif
【生存者数：<?php echo $alivenum?> 人】< input type="button"value="显示全部幸存者"onClick="$('alivemode').value='all';$('gbmode').value='none';postCmd('alive','alive.php');"></p > if($gamblingon &&$gamestate >=20) elseif($gamblingon &&$gamestate<=10)
Definition: 1_alive.tpl.php:18
$setmonth
$setmonth
Definition: configmng.php:60
astrfilter
astrfilter($str)
Definition: admin.php:91
$nowmonth
$nowmonth
Definition: configmng.php:56
$nowyear
$nowyear
Definition: configmng.php:57
adminlog
adminlog($op, $an1='', $an2='', $an3='')
Definition: admin.php:58