Commit 46187c17 authored by Nemo Ma's avatar Nemo Ma Committed by GitHub

Merge pull request #74 from hikawiier/waaagh

update clean-master
parents 651a5455 ffef2ffd
...@@ -20,6 +20,7 @@ $admin_cmd_list = Array( ...@@ -20,6 +20,7 @@ $admin_cmd_list = Array(
'npcmng' => 5, 'npcmng' => 5,
'gameinfomng' => 5, 'gameinfomng' => 5,
'antiAFKmng' => 4, 'antiAFKmng' => 4,
'templates_clean' => 4,
); );
if(!$cuser||!$cpass) { gexit($_ERROR['no_login'],__file__,__line__); } if(!$cuser||!$cpass) { gexit($_ERROR['no_login'],__file__,__line__); }
......
...@@ -251,6 +251,8 @@ $lang = array ...@@ -251,6 +251,8 @@ $lang = array
'vnmixlist_comment' => '检查或退回已被采纳的合成', 'vnmixlist_comment' => '检查或退回已被采纳的合成',
'gamecheck' => '当前游戏自检', 'gamecheck' => '当前游戏自检',
'gamecheck_comment' => '修正游戏人数异常和移动下拉框消失的功能', 'gamecheck_comment' => '修正游戏人数异常和移动下拉框消失的功能',
'templates_clean' => '清空模板缓存',
'templates_clean_comment' => '清空已生成的模板缓存文件',
'pcmng' => '玩家数据管理', 'pcmng' => '玩家数据管理',
'pcmng_comment' => '修改当前局玩家的各数值,不影响帐号', 'pcmng_comment' => '修改当前局玩家的各数值,不影响帐号',
......
<?php
if(!defined('IN_ADMIN')) {
exit('Access Denied');
}
$dir = GAME_ROOT.'./gamedata/templates/';
if(!isset($sub_cmd))
{
$cmd_info = "即将清空路径{$dir}下的.tpl后缀文件,";
$cmd_info .= "确认清理吗?<br>";
$cmd_info .= "
<form method=\"post\" name=\"admin\" onsubmit=\"admin.php\">
<input type=\"hidden\" name=\"mode\" id=\"mode\" value=\"templates_clean\">
<input type=\"hidden\" name=\"sub_cmd\" id=\"sub_cmd\" value=\"confirm\">
<input type=\"submit\" style=\"width:100;height:40;\" value=\"清空\" onclick=\"$('command').value='templates_clean';\">
</form>
";
}
else
{
$tpl_file = scandir($dir);
if(!empty($tpl_file))
{
$cmd_info = "开始清理缓存文件……<br>";
foreach($tpl_file as $key => $file_name)
{
if(strpos($file_name,'.tpl')!==false)
{
$cmd_info .= "已删除文件{$file_name}<br>";
unlink($dir.$file_name);
}
}
$cmd_info .= "清理完成!<br>";
}
}
include template('admin_menu');
?>
\ No newline at end of file
...@@ -86,6 +86,11 @@ ...@@ -86,6 +86,11 @@
<td>$lang['gamecheck_comment']</td> <td>$lang['gamecheck_comment']</td>
<td>$admin_cmd_list['gamecheck']</td> <td>$admin_cmd_list['gamecheck']</td>
</tr> </tr>
<tr height="45px">
<td><input type="submit" style="width:100;height:40;" value="$lang['templates_clean']" onclick="$('command').value='templates_clean'" <!--{if $mygroup < $admin_cmd_list['templates_clean']}-->disabled="true"<!--{/if}-->></td>
<td>$lang['templates_clean_comment']</td>
<td>$admin_cmd_list['templates_clean']</td>
</tr>
</table> </table>
</td> </td>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment