All Data Structures Namespaces Files Functions Variables Pages
systemmng.php
Go to the documentation of this file.
<?php
if(!defined('IN_ADMIN')) {
exit('Access Denied');
}
$adminmsg = file_get_contents('./gamedata/adminmsg.htm') ;
$systemmsg = file_get_contents('./gamedata/systemmsg.htm') ;
if($command == 'edit') {
$ednum = 0;
$edfmt = Array(
'adminmsg'=>'html',
'systemmsg' => 'html',
'startmode'=>'int',
'starthour'=>'int',
'startmin'=>'int',
'iplimit'=>'int',
'newslimit'=>'int',
'alivelimit'=>'int',
'winlimit'=>'int',
'noiselimit'=>'int',
'chatlimit'=>'int',
'chatrefresh'=>'int',
'chatinnews'=>'int'
);
$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;
}elseif($val == 'html'){
${$key} = html_entity_decode(astrfilter($_POST[$key]),ENT_COMPAT);
}else{
${$key} = $_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){
if(in_array('adminmsg',array_keys($edlist))){
file_put_contents('./gamedata/adminmsg.htm',$adminmsg);
}
if(in_array('systemmsg',array_keys($edlist))){
file_put_contents('./gamedata/systemmsg.htm',$systemmsg);
}
//$adminlog = '';
//$gamecfg_file = config('gamecfg',$gamecfg);
$systemfile = file_get_contents('./gamedata/system.php');
foreach($edlist as $key => $val){
if($key != 'adminmsg' && $key != 'systemmsg'){
if($edfmt[$key] == 'int' || $edfmt[$key] == 'b'){
$systemfile = preg_replace("/[$]{$key}\s*\=\s*-?[0-9]+;/is", "\${$key} = ${$key};", $systemfile);
}else{
$systemfile = preg_replace("/[$]{$key}\s*\=\s*[\"'].*?[\"'];/is", "\${$key} = '${$key}';", $systemfile);
}
}
//$adminlog .= setadminlog('systemcfgmng',$key,$val);
}
file_put_contents('./gamedata/system.php',$systemfile);
//putadminlog($adminlog);
adminlog('systemmng');
$cmd_info .= '系统环境修改完毕';
}
}
$startmode_input = '';
for($i=0;$i<=3;$i++){
if($i==$startmode){
$startmode_input .= "<input type=\"radio\" name=\"startmode\" value=\"$i\" checked>".$lang['startmode_'.$i].'<br>';
} else {
$startmode_input .= "<input type=\"radio\" name=\"startmode\" value=\"$i\">".$lang['startmode_'.$i].'<br>';
}
}
include template('admin_systemmng');
?>
$cmd_info
while($gm=$db->fetch_array($result)) $cmd_info
Definition: gmlist.php:10
$systemmsg
$systemmsg
Definition: systemmng.php:7
$startmode
$startmode
Definition: system.php:16
$i
$i
Definition: botservice.php:267
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
$startmode_input
if($command== 'edit') $startmode_input
Definition: systemmng.php:80
astrfilter
astrfilter($str)
Definition: admin.php:91
adminlog
adminlog($op, $an1='', $an2='', $an3='')
Definition: admin.php:58
$adminmsg
if(!defined('IN_ADMIN')) $adminmsg
Definition: systemmng.php:6