Exemple #1
0
 } else {
     $itemids = $_POST['itemids'];
 }
 $itemids = str_replace('\\\'', '\'', $itemids);
 $idarr = explode(',', str_replace('\'', '', $itemids));
 // 评论删除的积分
 $uids = getuids($idarr, 'spacecomments', 'authorid');
 updatecredit('delcomment', $uids);
 if (empty($_POST['theop'])) {
     showmessage('please_choose_type_operation');
 }
 if (empty($itemids)) {
     showmessage('you_have_no_choice_information');
 }
 if ($_POST['theop'] == 'delete') {
     deleteitems('itemid', "'{$itemids}'", $_POST['undelete']);
 } elseif ($_POST['theop'] == 'deleteattach') {
     $filearr = array();
     $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('attachments') . " WHERE itemid IN ('{$itemids}')");
     while ($value = $_SGLOBAL['db']->fetch_array($query)) {
         if (!empty($value['filepath'])) {
             $filearr[] = A_DIR . '/' . $value['filepath'];
         }
         if (!empty($value['thumbpath'])) {
             $filearr[] = A_DIR . '/' . $value['thumbpath'];
         }
     }
     //删除附件
     if (!empty($filearr)) {
         foreach ($filearr as $value) {
             if (!@unlink($value)) {
Exemple #2
0
    }
    $catid = intval($_POST['catid']);
    $uparr = explode('_', $_POST['newcatid']);
    $uparr['type'] = trim($uparr[0]);
    $uparr['catid'] = intval($uparr[1]);
    $getcategoriessunid = getcategoriessunid($catid);
    if (in_array($newcatid, $getcategoriessunid)) {
        showmessage('category_del_catid_error');
    }
    $query = $_SGLOBAL['db']->query('SELECT catid FROM ' . tname('categories') . " WHERE upid='{$catid}'");
    if ($value = $_SGLOBAL['db']->fetch_array($query)) {
        showmessage('category_have_sub_cate');
    }
    if (empty($uparr['catid'])) {
        $_SGLOBAL['db']->query('DELETE FROM ' . tname('categories') . ' WHERE catid=\'' . $catid . '\'');
        deleteitems('catid', array($catid), 1);
        $_SGLOBAL['db']->query('UPDATE ' . tname('postitems') . ' SET catid=\'0\', folder=\'2\' WHERE catid=\'' . $catid . '\'');
    } else {
        $_SGLOBAL['db']->query('DELETE FROM ' . tname('categories') . ' WHERE catid=\'' . $catid . '\'');
        $_SGLOBAL['db']->query('UPDATE ' . tname('spaceitems') . ' SET catid=\'' . $uparr['catid'] . '\', type=\'' . $uparr['type'] . '\' WHERE catid=\'' . $catid . '\'');
        $_SGLOBAL['db']->query('UPDATE ' . tname('postitems') . ' SET catid=\'' . $uparr['catid'] . '\', type=\'' . $uparr['type'] . '\' WHERE catid=\'' . $catid . '\'');
    }
    updatecategorycache();
    updatehtmlpathcache();
    showmessage('category_delete_success', $newurl);
} elseif (submitcheck('movesubmit')) {
    //权限
    if (!(checkperm('manageeditcat') || checkperm('managemodcat'))) {
        showmessage('no_authority_management_operation');
    }
    $catid = intval($_POST['catid']);
Exemple #3
0
            deleteitems('itemid', '\'' . $itemidstr . '\'', 1);
            break;
        case 'movecat':
            $catarr = explode('_', $_POST['opcatid']);
            $_SGLOBAL['db']->query('UPDATE ' . tname($tablename) . ' SET type=\'' . $catarr[0] . '\', catid=\'' . $catarr[1] . '\' WHERE itemid IN (\'' . $itemidstr . '\')');
            break;
        case 'republish':
            moveitemfolder('\'' . $itemidstr . '\'', 2, 0);
            break;
        case 'remove':
            if ($_GET['status'] != 'delete') {
                //·¢²¼Ïä->ɾ³ý
                deleteitems('itemid', $itemidstr, 0);
            } else {
                //´ýÉóÏä->ɾ³ý
                deleteitems('itemid', $itemidstr, 0, 1);
            }
            break;
    }
    showmessage('check_op_ok', $theurl . '&page=' . $page . '&type=' . $type . '&grade=' . $grade . '&status=' . $status . '&searchtype=' . $searchtype . '&searchkey=' . rawurlencode($searchkeys));
}
//GET METHOD
$viewclass_help = $viewclass_no = $viewclass_ban = $viewclass_delete = $viewclass_yes = '';
if ($status == 'yes') {
    $viewclass_yes = ' class="active"';
} elseif ($status == 'help') {
    $viewclass_help = ' class="active"';
} elseif ($status == 'delete') {
    $viewclass_delete = ' class="active"';
} elseif ($status == 'ban') {
    $viewclass_ban = ' class="active"';
Exemple #4
0
if (submitcheck('listsubmit')) {
    if (!empty($_POST['item'])) {
        $itemidstr = implode('\',\'', $_POST['item']);
    } else {
        showmessage('space_no_item');
    }
    switch ($_POST['operation']) {
        case 'noproblem':
            $_SGLOBAL['db']->query('UPDATE ' . tname('reports') . ' SET status=\'1\' WHERE itemid IN (\'' . $itemidstr . '\')');
            break;
        case 'remove':
            deleteitems('itemid', $_POST['item']);
            $_SGLOBAL['db']->query('DELETE FROM ' . tname('reports') . ' WHERE itemid IN (\'' . $itemidstr . '\')');
            break;
        case 'rush':
            deleteitems('itemid', $_POST['item'], 1);
            $_SGLOBAL['db']->query('DELETE FROM ' . tname('reports') . ' WHERE itemid IN (\'' . $itemidstr . '\')');
            break;
    }
    showmessage('report_op_ok', $theurl . '&page=' . $page . '&status=' . $status);
}
//GET METHOD
$viewclass_no = $viewclass_yes = '';
if ($status == 'yes') {
    $viewclass_yes = ' class="active"';
} else {
    $viewclass_no = ' class="active"';
}
//LIST VIEW
$wheresqlarr = array();
if ($status == 'yes') {
Exemple #5
0
$active[] = array(0 => '', 1 => '', 2 => '', 'add' => '', 'edit' => '');
if ($_GET['op'] == 'add') {
    $active['add'] = ' class="active"';
} elseif ($_GET['op'] == 'edit') {
    $active['edit'] = ' class="active"';
} elseif (!$_SGET['folder']) {
    $active[0] = ' class="active"';
} elseif ($_SGET['folder'] == 1 && empty($thevalue)) {
    $active[1] = ' class="active"';
} elseif ($_SGET['folder'] == 2 && empty($thevalue)) {
    $active[2] = ' class="active"';
}
//清空垃圾箱信息
if (is_array($dellistarr) && !empty($dellistarr)) {
    $itemidstr = simplode($dellistarr);
    deleteitems('itemid', $itemidstr);
    $residual = $all - $delnum;
    echo label(array('type' => 'table-start', 'class' => 'listtable'));
    echo '<tr>';
    echo '<th>' . $alang['delete_all_message_0'] . $all . $alang['delete_all_message_1'] . $residual . $alang['delete_all_message_3'] . '</th>';
    echo '</tr>';
    echo label(array('type' => 'table-end'));
    if ($residual) {
        jumpurl($newurl . '&op=deleteallwaste&all=' . $all . '&delnum=' . $delnum, 1000, 'meta');
    } else {
        jumpurl($newurl, 1000, 'meta');
    }
}
//THE VALUE SHOW
if ($thevalue) {
    //缩略图