📄 comment_del.php
字号:
<?php
!$_SERVER['PHP_SELF'] && $_SERVER['PHP_SELF']=$_SERVER['SCRIPT_NAME'];
substr($_SERVER['PHP_SELF'],-9,-4)!=='admin' && exit('Forbidden');
include_once(R_P.'cache/sortcache.php');
if(!empty($_GET['do'])) {
if($_GET['do']=='do') {
$sid=$_POST['sid'];
$aid=$_POST['aid'];
$author=$_POST['author'];
$keyword=$_POST['author'];
$tcounts=$_POST['tcounts'];
$counts=$_POST['counts'];
$userip=$_POST['userip'];
$perpage=$_POST['perpage'];
$direct=!empty($_POST['direct']) ? $_POST['direct'] : 0;
if(!$sid && !$aid && !$author && !$keyword && !$counts && !$tcounts && !$userip) {
echo "<script language=\"javascript\">alert(\"没有提供足够的条件!请填写搜索条件!\")</script>";
echo "<meta http-equiv='refresh' content='0;url=admin.php?job=comment_del'>";
exit;
} else {
$sql='';
if($sid) {
$sql.="WHERE sid=$sid";
} else {
$sql.="WHERE sid!=-1";
}
if($aid) {
$aids=0;
$aid_array=explode(",",$aid);
foreach($aid_array as $value) {
if(is_numeric($value)) {
$aids.=','.$value;
}
}
$aids && $sql.=" AND aid IN($aids)";
}
if($author) {
$authorarray=explode(",",$author);
foreach($authorarray as $value) {
$value=addslashes(str_replace('*','%',$value));
$authorwhere.=" OR author LIKE '$value'";
}
$authorwhere=substr_replace($authorwhere,"",0,3);
$sql.=" AND ($authorwhere)";
}
if($keyword) {
$keyword=trim($keyword);
$keywordarray=explode(",",$keyword);
foreach($keywordarray as $value) {
$value=str_replace('*','%',$value);
$keywhere.=" OR content LIKE '%$value%' ";
}
$keywhere=substr_replace($keywhere,"",0,3);
$sql.=" AND ($keywhere) ";
}
if($userip) {
$userip=str_replace('*','%',$userip);
$sql.=" AND (userip LIKE '$userip') ";
}
if($tcounts) {
$sql.=" AND char_length(content)>".(int)$tcounts;
} elseif($counts) {
$sql.=" AND char_length(content)<".(int)$counts;
}
$rs=get_one("SELECT COUNT(*) AS count FROM duoxun_comment $sql");
$num=$rs['count'];
$pages=ceil($num/$perpage);
for($i=1;$i<$pages+1;$i++) {
$perpage && $start=($i-1)*$perpage && $sql.=" LIMIT $start,$perpage" ;;
query("DELETE FROM duoxun_comment $sql");
}
echo "<script language=\"javascript\">alert(\"已成功删除符合条件的评论记录!请继续进行管理操作!\")</script>";
echo "<meta http-equiv='refresh' content='0;url=admin.php?job=comment_del'>";
exit;
}
}
}
require_once template('comment_del','admin');
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -