Esempio n. 1
0
//检查权限
jieqi_getconfigs(JIEQI_MODULE_NAME, 'power');
$canedit = jieqi_checkpower($jieqiPower['article']['manageallarticle'], $jieqiUsersStatus, $jieqiUsersGroup, true);
if (!$canedit && !empty($_SESSION['jieqiUserId'])) {
    //除了斑竹,作者、发表者和代理人可以修改文章
    $tmpvar = $_SESSION['jieqiUserId'];
    if ($tmpvar > 0 && ($article->getVar('authorid') == $tmpvar || $article->getVar('agentid') == $tmpvar)) {
        $canedit = true;
    }
}
if (!$canedit) {
    jieqi_printfail($jieqiLang['article']['noper_delete_chapters']);
}
//执行删除
$cids = '';
foreach ($_REQUEST['chapterid'] as $cid) {
    $cid = intval($cid);
    if ($cid) {
        if ($cids != '') {
            $cids .= ', ';
        }
        $cids .= $cid;
    }
}
if ($cids != '') {
    include_once $jieqiModules['article']['path'] . '/include/operatefunction.php';
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('chapterid', '(' . $cids . ')', 'IN'));
    jieqi_article_delchapter($_REQUEST['articleid'], $criteria, true);
}
jieqi_jumppage($article_static_url . '/articlemanage.php?id=' . $_REQUEST['articleid'], LANG_DO_SUCCESS, $jieqiLang['article']['chapter_batchdel_success']);
Esempio n. 2
0
    $resnum = $query->db->getRowsNum($res);
    echo sprintf($jieqiLang['article']['clean_show_num'], $resnum);
    ob_flush();
    flush();
    include_once $jieqiModules['article']['path'] . '/include/operatefunction.php';
    if (!in_array($_POST['operate'], array('delarticle', 'delchapter', 'delattach'))) {
        $badparm = true;
    }
    $criteria = new CriteriaCompo(new Criteria('attachment', '', '!='));
    while ($row = $query->getRow()) {
        if ($_POST['operate'] == 'delarticle') {
            $ret = jieqi_article_delete($row['articleid'], false);
        } elseif ($_POST['operate'] == 'delchapter') {
            $ret = jieqi_article_clean($row['articleid'], false);
        } elseif ($_POST['operate'] == 'delattach') {
            $ret = jieqi_article_delchapter($row['articleid'], $criteria, false);
        }
        if (is_object($ret)) {
            echo sprintf($jieqiLang['article']['clean_article_doing'], $ret->getVar('articlename'), $ret->getVar('articleid'));
            ob_flush();
            flush();
        }
    }
    echo $jieqiLang['article']['clean_all_success'];
    ob_flush();
    flush();
} else {
    include_once JIEQI_ROOT_PATH . '/admin/header.php';
    $jieqiTpl->assign('article_static_url', $article_static_url);
    $jieqiTpl->assign('article_dynamic_url', $article_dynamic_url);
    $jieqiTpl->assign('url_batchclean', $article_static_url . '/admin/batchclean.php?do=submit');