function deleteinfo($ids)
{
    global $_SGLOBAL;
    include_once S_ROOT . './source/function_delete.php';
    $deltype = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('report') . " WHERE rid IN (" . simplode($ids) . ")");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $deltype[$value['idtype']][] = $value['id'];
    }
    $gid = getgroupid($_SGLOBAL['member']['credit'], $_SGLOBAL['member']['groupid']);
    //执行相应的删除操作
    foreach ($deltype as $key => $value) {
        switch ($key) {
            case 'blog':
                $_SGLOBAL['usergroup'][$gid]['manageblog'] = 1;
                deleteblogs($value);
                break;
            case 'picid':
                $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1;
                deletepics($value);
                break;
            case 'album':
                $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1;
                deletealbums($value);
                break;
            case 'thread':
                $_SGLOBAL['usergroup'][$gid]['managethread'] = 1;
                deletethreads(0, $value);
                break;
            case 'mtag':
                $_SGLOBAL['usergroup'][$gid]['managemtag'] = 1;
                deletemtag($value);
                break;
            case 'share':
                $_SGLOBAL['usergroup'][$gid]['manageshare'] = 1;
                deleteshares($value);
                break;
            case 'space':
                $_SGLOBAL['usergroup'][$gid]['managespace'] = 1;
                foreach ($value as $uid) {
                    deletespace($uid);
                }
                break;
        }
    }
}
}

//权限
if(!checkperm('managemtag')) {
	cpmessage('no_authority_management_operation');
}

@include_once(S_ROOT.'./data/data_profield.php');
$managebatch = checkperm('managebatch');
if(submitcheck('opsubmit')) {
	if(!$managebatch && count($_POST['ids']) > 1) {
		cpmessage('no_authority_management_operation');
	}
	if($_POST['optype'] == 'delete') {
		include_once(S_ROOT.'./source/function_delete.php');
		if(!empty($_POST['ids']) && deletemtag($_POST['ids'])) {
			cpmessage('do_success', $_POST['mpurl']);
		} else {
			cpmessage('choose_to_delete_the_columns_tag');
		}
	} elseif($_POST['optype'] == 'merge') {
		
		$_POST['merge_newfieldid'] = intval($_POST['merge_newfieldid']);
		$_POST['newtagname'] = shtmlspecialchars(trim($_POST['newtagname']));
		//检索新tag存在否
		$newtagid = getcount('mtag', array('tagname'=>$_POST['newtagname'], 'fieldid'=>$_POST['merge_newfieldid']), 'tagid');
		if(empty($newtagid)) {
			cpmessage('designated_to_merge_the_columns_do_not_exist');
		}
		//开始合并
		include_once(S_ROOT.'./source/function_op.php');
Exemple #3
0
function mtag_out($mtag, $uids)
{
    global $_SGLOBAL;
    $_SGLOBAL['db']->query("DELETE FROM " . tname('tagspace') . " WHERE tagid='{$mtag['tagid']}' AND uid IN (" . simplode($uids) . ")");
    //更新成员数
    $count = getcount('tagspace', array('tagid' => $mtag['tagid']));
    if ($count > 0) {
        updatetable('mtag', array('membernum' => $count), array('tagid' => $mtag['tagid']));
    } else {
        //解散
        include_once S_ROOT . './source/function_delete.php';
        deletemtag(array($mtag['tagid']));
    }
}
Exemple #4
0
function deleteinfo($ids)
{
    global $_SGLOBAL;
    include_once S_ROOT . './source/function_delete.php';
    $deltype = array();
    $reportuser = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('report') . " WHERE rid IN (" . simplode($ids) . ")");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $value['user'] = unserialize($value['uids']);
        $reportuser[] = array_shift(array_flip($value['user']));
        $deltype[$value['idtype']][] = $value['id'];
    }
    $gid = getgroupid($_SGLOBAL['member']['experience'], $_SGLOBAL['member']['groupid']);
    //Perform the corresponding delete operations
    $i = 0;
    $_SGLOBAL['usergroup'][$gid]['managebatch'] = 1;
    foreach ($deltype as $key => $value) {
        switch ($key) {
            case 'blogid':
                $_SGLOBAL['usergroup'][$gid]['manageblog'] = 1;
                deleteblogs($value);
                break;
            case 'picid':
                $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1;
                deletepics($value);
                break;
            case 'albumid':
                $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1;
                deletealbums($value);
                break;
            case 'tid':
                $_SGLOBAL['usergroup'][$gid]['managethread'] = 1;
                deletethreads(0, $value);
                break;
            case 'tagid':
                $_SGLOBAL['usergroup'][$gid]['managemtag'] = 1;
                deletemtag($value);
                break;
            case 'sid':
                $_SGLOBAL['usergroup'][$gid]['manageshare'] = 1;
                deleteshares($value);
                break;
            case 'uid':
                $_SGLOBAL['usergroup'][$gid]['managedelspace'] = 1;
                foreach ($value as $uid) {
                    deletespace($uid);
                }
                break;
            case 'eventid':
                $_SGLOBAL['usergroup'][$gid]['manageevent'] = 1;
                deleteevents($value);
                break;
            case 'pid':
                $_SGLOBAL['usergroup'][$gid]['managepoll'] = 1;
                deletepolls($value);
                break;
            case 'comment':
                $_SGLOBAL['usergroup'][$gid]['managecomment'] = 1;
                deletecomments($value);
                break;
            case 'post':
                $_SGLOBAL['usergroup'][$gid]['managethread'] = 1;
                deleteposts(0, $value);
                break;
        }
        //The first reporter award
        getreward('report', 1, $reportuser[$i], '', 0);
        $i++;
    }
}