<?php

if (empty($mpv[3]))
    yun_error(mlang('权限不足'));
/**
 * 批量删除
 */
$js = '';
if (is_array($_POST['cids']))
{
    count($_POST['cids']) < 1 && yun_error(mlang('至少选择一项'));
    $cids = $_POST['cids'];
} elseif (C > 0)
{
    $cids = array(C);
} else
{
    yun_error(mlang('至少选择一项'));
}
$pid = B;
if (!$db->fetch_first('select * from (' . PF . 'article as article left join ' .
    PF . 'posts as post on article.menu_id=' . MID .
    ' && article.post_id=post.id) where article.post_id=' . $pid))
{
    yun_error(mlang('主题不存在'));
}
foreach ($cids as $cid)
{
    $cid = abs(intval($cid));
    if ($row = $db->fetch_first('select *,comment.id as id,comment.authorid as authorid,comment.content as content from (' .
        PF . 'comments as comment left join ' . PF .
        'posts as post on comment.post_id=post.id) left join ' . PF .
        'user as user on comment.authorid=user.id where comment.id=' . $cid .
        ' && post.id=' . $pid))
    {
        del_comment($cid, $row);
        $js .= 'parent.document.getElementById("cid_' . $cid .
            '").style.display="none";';
    }
}
yun_succeed(mlang('删除成功'), $js);

?>