<?php
!defined('ADMIN')&&die("<meta http-equiv='refresh' content=0;url='/'>");
if(ADMIN<15)Js_to("没有权限！",URL._1.D.L.D);
FN("title","留言/评论管理");
global $z,$i,$title;
_F("top");
$r=GL($z->R("setting","id=1"),4);
?>
<tt id="tw"></tt>
<fieldset class="form">
<script type="text/javascript" src="system/js/py.js"></script>
<legend><h1><b><var><img src="system/img/left.gif" /></var><dfn class="hide"><img src="system/img/right.gif" /></dfn></b>　<a href="<?php echo URL._1.D._2.D?>"><?php echo $title?></a></h1></legend>
<ul><tt></tt></ul>
<div class="fieldset"><big><samp class="del">&#9682;</samp><span>&#9681;</span>过滤关键词设置:<del></del></big>
<div class="hide">
<form action="" method="post" name="form" onSubmit="return ps();">
<tt></tt>
<ul>
<dt>禁止内容:</dt>
<dd><li><textarea rows="15" name="pl_c" class="w5"><?php echo $r['pl_c'];?></textarea> 每行只能一个词</li></dd>
<tt></tt></ul>
<input name="cgi" type="hidden" value="setting" />
<ul><tt></tt></ul>
<ul>
<big><input type="submit" value="保 存 设 置"/></big>
</ul>
</form>
</div>
</div>
<tt></tt>
<ul><tt></tt></ul>
<div class="fieldset"><big><samp>&#9682;</samp><span class="del">&#9681;</span>留言/评论内容:</big>
<div>
<main>
<?php
if(_5!='id')echo '
<dd><input type="text" size="11" id="zi" placeholder="请输入关键词" onfocus="this.select()" value="'.(_4?_4:'').'">
<b onclick="souzi()">搜索</b></dd>';?>
<dd>
<a href="<?php echo URL._1.D._2.HZ?>"><b>全部评论</b></a>
</dd>
<p></p>
<script>
function souzi(a){
	if(a>=0)return window.location.href="<?php echo URL._1.D._2.D?>1/<?php echo _4?_4:0?>/"+a+"/";
	var zi=document.getElementById("zi").value;
	if(/[_\/]/.test(zi)){
		tanchuang('错误！','搜索内容不能含有“ _ \\ / ”字符！');
	}else window.location.href="<?php echo URL._1.D._2.D?>1/"+encodeURI(zi)+"/<?php echo _5?_5:0?>/";
}
</script>
</main>
<?php
echo $i['rank']>19&&$i['rank']<99?'<div id="ngly"><div class="red"><img src="system/img/warning.gif" />注意: 尽量不用管理员账号回复评论</div><div>（您可以先创建虚拟禁止登录用户，然后点<q>无密码登录</q>后发布信息，这样能够隐藏管理员真实身份，确保网站安全。）</div></div>':'<i id="ngly"></i>';

$_2= trim(_2)==""?1:substr(urldecode(_2),0,99);
$p = intval(_3)?intval(_3):1;
$d=5;
$a=($p-1)*$d;
$tj='';
$_4=_4?urldecode(_4):0;
if(_5=='id')$tj='id='.$_4;
elseif(_4)$tj="nid LIKE '%".$_4."%' or uname LIKE '%".$_4."%' or link LIKE '%".$_4."%' or email LIKE '%".$_4."%' or ip LIKE '%".$_4."%' or re LIKE '%".$_4."%' or content LIKE '%".$_4."%'";

$s=$z->S("pl",$tj);
$fenye = URL._1.D.$_2."/";
$m = ceil($s/$d);
$dir=S($p,$m,$s,$fenye,D.$_4.D);
foreach(id(array($z,$tj,$a,$d)) as $v){
	foreach($v as $k=>$f)$$k=_4?preg_replace("#$_4#","<u>$_4</u>",$f):$f;
	$nr=$v['nid']?'评论来自文章:<q><a id="u'.$v['id'].'" href="'.URL.'p-'.$v['url'].HZ.'" target="_blank"><img src="system/img/link.png" />'.$v['title'].'</a></q>　<bdi><a href="'.URL._1.'_id/'.$v['nid'].HZ.'"><img src="system/img/iconedit.gif" />修改</a></bdi>':'<q class="lv"> 内容来自<a id="u'.$v['id'].'" href="'.URL.'guestbook/" target="_blank"><img src="system/img/link.png" />留言板</a></q>';
?>
<ul class="re"><dt class="pa"><label><b>№ <?php echo $v['id']?></b> <input type="checkbox" value="<?php echo $v['id']?>"> </label></dt><dd>
<div>
<b>时间:</b><?php echo $v['atime']?><br>
<b>留言者:</b><i class="lan"><?php echo $uname?></i><br>
<b>网址:</b><img src="system/img/lnk.png"> <a target="_blank" href="<?php echo URL?>url?<?php echo $v['link']?>"><?php echo $link?></a><br>
<b>邮箱:</b><img src="system/img/email.gif"> <?php if($v['email'])echo '<a href="mailto:'.$v['email'].'">[ 发信 ]</a>';?>　<i id="em<?php echo $v['id']?>"><?php echo $email?></i><br>
<b>留言者ip:</b><a target="_blank" href="https://www.baidu.com/s?wd=<?php echo $v['ip']?>"><?php echo $ip?></a><br>
<h5><?php echo $nr?></h5>
<div class="pl7"><b>留言内容:</b><pre class="lan"><?php echo preg_replace("|\[\/(\w+)\]|","<img src=\"images/emot/$1.gif\" />",$content);?></pre></div>
</div>
<div class="pl8" onclick="liuyan(<?php echo $v['id']?>,'a')"><b>管理员回复:</b><pre id="re<?php echo $v['id']?>" class="pl81"><?php echo $re?></pre></div>
<div class="pl9">
<strong>操作:</strong>
<b onclick="liuyan(<?php echo $v['id']?>,'s')">　<img src="system/img/note_error.gif" />删除留言</b>　
<b onclick="liuyan(<?php echo $v['id']?>,'a')"><img src="system/img/i.png" />修改/回复留言</b>　
<b class="x<?php echo $v['id'].($v['yn']?' hide':'')?>" onclick="liuyan(<?php echo $v['id']?>,'c')"><img src="system/img/note_ok.gif" />前台显示留言</b>　
<b class="y<?php echo $v['id'].($v['yn']?'':' hide')?>" onclick="liuyan(<?php echo $v['id']?>,'d')"><img src="system/img/warning.gif" />屏蔽留言</b>
<tt></tt>
</div></dd></ul>
<?php }?>
<ul><dt> </dt><dd><span class="anniu1 pb">全选 / 取消全选</span><span class="anniu1 pc">删除</span></dd></ul>
<tt></tt>
<dir><?php echo $dir.' <span>（共'.$s.'条）</span>'?></dir>
<ul><tt></tt></ul>

</div></div>
<ul><tt></tt></ul>

</fieldset>
<?php
_F("end");