leguevent/edit.php
2020-12-01 15:23:04 +08:00

47 lines
1.2 KiB
PHP

<?php
if(!isn(r('modigames'))){
$games = trim(_r("games"));
$games = str_replace("\r","",$games);
$arr = explode("\n",$games);
$configJson['games'] = $arr;
file_put_contents("config.json",json_encode($configJson));
}
if(!isn(r('modiroles'))){
$roles = trim(_r("roles"));
$roles = str_replace("\r","",$roles);
$arr = explode("\n",$roles);
$configJson['roles'] = $arr;
file_put_contents("config.json",json_encode($configJson));
}
require_once(ROOT.'./_config.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<h3>游戏编辑</h3>
<form name="form1" method="post" action="">
<p>每行一个</p>
<p>
<textarea name="games" id="games" cols="45" rows="5" style="width:90%;height:300px;"><?=implode("\n",$GAMES)?></textarea>
</p>
<p>
<input type="submit" name="modigames" id="button" value="提交">
</p>
</form>
<h3>哪些人可以编辑?</h3>
<form name="form1" method="post" action="">
<p>每行一个</p>
<p>
<textarea name="roles" id="roles" cols="45" rows="5" style="width:90%;height:300px;"><?=implode("\n",$ROLES)?></textarea>
</p>
<p>
<input type="submit" name="modiroles" id="button" value="提交">
</p>
</form>
<p>&nbsp;</p>
</body>
</html>