"guestbook","uid"=>UID]) ); if(empty($s)){ $s = []; } if(!Check_Path("data/user/{$u}/MessageBoard")){ exit("

创建目录失败,请检查权限

"); } $dir = DIR."/data/user/{$u}/MessageBoard/"; if($_POST['type'] == 'set'){ msg(-1,'免费不支持此功能'); }elseif($_POST['type'] == 'del'){ msg(-1,'免费不支持此功能'); } $dbs = scandir($dir); $newdbs = $dbs; //列表过滤 for ($i=0; $i < count($dbs); $i++) { if( ($dbs[$i] == '.') || ($dbs[$i] == '..') || ( substr($newdbs[$i], -5) != '.json') ) { unset($newdbs[$i]); } } $dbs = $newdbs; //赋值过滤后的数据 $num = count($dbs); //取列表数 rsort($dbs,2); //按时间从大到小重排序 $data = []; //符合条件时显示使用说明 if($s['help'] != 'del'|| !count($dbs) || isset($_GET['help'])){ $id = 1; $arr['type'] = '使用说明'; $arr['contact'] = '271152681@qq.com'; $arr['title'] = 'TwoNav 极简留言板'; $arr['content'] = "1.极简留言板采用轻量设计,整体只有几KB\n2.留言数据存放路径/data/user/xxx/MessageBoard/ (xxx表示用户名)\n3.默认是禁止留言的,点击上方蓝色字(禁止留言/允许留言)可切换状态\n4.使用方法: 点击极简留言板(蓝字)>把地址栏的URL复制>在后台添加链接即可(部分主题已支持自动展现入口)\n5.本条信息被删除时如果存在留言则不显示,没有留言时依旧会显示!\n6.有提交长度限制,类型32,联系方式64,标题128,内容2048字节!若不够用请自己修改源代码!\n7.为了防止被恶意提交,当留言数超过256时将不在接收留言!"; $arr['time'] = date("Y-m-d H:i:s",time()); $arr['ip'] = '127.0.0.1'; $arr['id'] = $id; $arr['file'] = 'help'; $data['help'] = $arr; }else{ $id = 0; } //遍历数据库,获取时间,大小 foreach ($dbs as $key => $value) { $id ++; $arr['id'] = $id; try{ //读取信息文件 $info_file = @file_get_contents($dir.$value); $info = json_decode($info_file,true); $arr['type'] = $info['type']; //类型 $arr['contact'] = $info['contact']; //联系方式 $arr['title'] = $info['title']; //标题 $arr['content'] = $info['content']; //内容 $arr['time'] = date("Y-m-d H:i:s",$info['time']); //提交时间 $arr['ip'] = $info['ip']; //ip $arr['file'] = $value; //MD5 }catch (\Throwable $th) { $arr['type'] = 'Null'; $arr['contact'] = 'Null'; $arr['title'] = 'Null'; $arr['content'] = 'Null'; $arr['time'] = 'Null'; $arr['ip'] = 'Null'; $arr['file'] = $value; } $data[$key] = $arr; } $show = 5; //展开的数量 $title='留言管理';require dirname(__DIR__).'/header.php'; ?>
" target="_blank">TowNav 极简留言板
当前设置:

删除

终端地址: '. $value['ip'] .'
联系方式: '. $value['contact'] .'

'. str_replace("\n","
",str_replace(" "," ",$value['content'])) ; ?>

当前没有留言 ';}?>