Tokiwa Battle Royale  GE777
A PHP Battle Royale inspired game
 All Data Structures Namespaces Files Functions Variables Pages
systemmng.php
Go to the documentation of this file.
1 <?php
2 if(!defined('IN_ADMIN')) {
3  exit('Access Denied');
4 }
5 
6 $adminmsg = file_get_contents('./gamedata/adminmsg.htm') ;
7 $systemmsg = file_get_contents('./gamedata/systemmsg.htm') ;
8 
9 if($command == 'edit') {
10  $ednum = 0;
11  $edfmt = Array(
12  'adminmsg'=>'html',
13  'systemmsg' => 'html',
14  'startmode'=>'int',
15  'starthour'=>'int',
16  'startmin'=>'int',
17  'iplimit'=>'int',
18  'newslimit'=>'int',
19  'alivelimit'=>'int',
20  'winlimit'=>'int',
21  'noiselimit'=>'int',
22  'chatlimit'=>'int',
23  'chatrefresh'=>'int',
24  'chatinnews'=>'int'
25  );
26  $edlist = Array();
27  $cmd_info = '';
28  foreach($edfmt as $key => $val){
29  if(isset($_POST[$key])){
30  ${'o_'.$key} = ${$key};
31  if($val == 'int'){
32  ${$key} = intval($_POST[$key]);
33  }elseif($val == 'b'){
34  intval($_POST[$key]) != 0 ? ${$key} = 1 : ${$key} = 0;
35  }elseif($val == 'html'){
36  ${$key} = html_entity_decode(astrfilter($_POST[$key]),ENT_COMPAT);
37  }else{
38  ${$key} = $_POST[$key];
39  }
40  if(${$key} != ${'o_'.$key}){
41  $ednum ++;
42  if(${$key}===''){
43  $cmd_info .= "$lang[$key] 已清空<br>";
44  }else{
45  $cmd_info .= "$lang[$key] 修改为 ${$key} <br>";
46  }
47  $edlist[$key] = ${$key};
48  }
49  }
50  }
51 
52  $cmd_info .= "提交的修改请求数量: $ednum <br>";
53 
54  if($ednum){
55  if(in_array('adminmsg',array_keys($edlist))){
56  file_put_contents('./gamedata/adminmsg.htm',$adminmsg);
57  }
58  if(in_array('systemmsg',array_keys($edlist))){
59  file_put_contents('./gamedata/systemmsg.htm',$systemmsg);
60  }
61  //$adminlog = '';
62  //$gamecfg_file = config('gamecfg',$gamecfg);
63  $systemfile = file_get_contents('./gamedata/system.php');
64  foreach($edlist as $key => $val){
65  if($key != 'adminmsg' && $key != 'systemmsg'){
66  if($edfmt[$key] == 'int' || $edfmt[$key] == 'b'){
67  $systemfile = preg_replace("/[$]{$key}\s*\=\s*-?[0-9]+;/is", "\${$key} = ${$key};", $systemfile);
68  }else{
69  $systemfile = preg_replace("/[$]{$key}\s*\=\s*[\"'].*?[\"'];/is", "\${$key} = '${$key}';", $systemfile);
70  }
71  }
72  //$adminlog .= setadminlog('systemcfgmng',$key,$val);
73  }
74  file_put_contents('./gamedata/system.php',$systemfile);
75  //putadminlog($adminlog);
76  adminlog('systemmng');
77  $cmd_info .= '系统环境修改完毕';
78  }
79 }
81 for($i=0;$i<=3;$i++){
82  if($i==$startmode){
83  $startmode_input .= "<input type=\"radio\" name=\"startmode\" value=\"$i\" checked>".$lang['startmode_'.$i].'<br>';
84  } else {
85  $startmode_input .= "<input type=\"radio\" name=\"startmode\" value=\"$i\">".$lang['startmode_'.$i].'<br>';
86  }
87 }
88 include template('admin_systemmng');
89 ?>
while($gm=$db->fetch_array($result)) $cmd_info
Definition: gmlist.php:10
$systemmsg
Definition: systemmng.php:7
$startmode
Definition: system.php:16
$i
Definition: botservice.php:267
【生存者数:<?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
if($command== 'edit') $startmode_input
Definition: systemmng.php:80
astrfilter($str)
Definition: admin.php:91
adminlog($op, $an1='', $an2='', $an3='')
Definition: admin.php:58
if(!defined('IN_ADMIN')) $adminmsg
Definition: systemmng.php:6