Example #1
0
/*
	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: admincp_bwzt.php 12568 2009-07-08 07:38:01Z zhengqingpeng $
*/
if (!defined('IN_UCHOME') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
//权限
if (!($allowmanage = checkperm('managebwzt'))) {
    $_GET['uid'] = $_SGLOBAL['supe_uid'];
    //只能操作本人的
    $_GET['username'] = '';
}
if (submitcheck('batchsubmit')) {
    include_once S_ROOT . './source/function_delete.php';
    if (!empty($_POST['ids']) && deletebwzts($_POST['ids'])) {
        cpmessage('do_success', $_POST['mpurl']);
    } else {
        cpmessage('the_correct_choice_to_delete_the_log');
    }
}
$mpurl = 'admincp.php?ac=bwzt';
//处理搜索
$intkeys = array('uid', 'friend', 'bwztid');
$strkeys = array('username');
$randkeys = array(array('sstrtotime', 'dateline'), array('intval', 'viewnum'), array('intval', 'replynum'), array('intval', 'hot'));
$likekeys = array('subject');
$results = getwheres($intkeys, $strkeys, $randkeys, $likekeys, 'b.');
$wherearr = $results['wherearr'];
$mpurl .= '&' . implode('&', $results['urls']);
//限制条件2
Example #2
0
    if ($newbwzt = bwzt_post($_POST, $bwzt)) {
        if (empty($bwzt) && $newbwzt['topicid']) {
            $url = 'space.php?do=topic&topicid=' . $newbwzt['topicid'] . '&view=bwzt';
        } else {
            $url = 'space.php?uid=' . $newbwzt['uid'] . '&do=bwzt&id=' . $newbwzt['bwztid'];
        }
        showmessage('do_success', $url, 0);
    } else {
        showmessage('that_should_at_least_write_things');
    }
}
if ($_GET['op'] == 'delete') {
    //删除
    if (submitcheck('deletesubmit')) {
        include_once S_ROOT . './source/function_delete.php';
        if (deletebwzts(array($bwztid))) {
            showmessage('do_success', "space.php?uid={$bwzt['uid']}&do=bwzt&view=me");
        } else {
            showmessage('failed_to_delete_operation');
        }
    }
} elseif ($_GET['op'] == 'goto') {
    $id = intval($_GET['id']);
    $uid = $id ? getcount('bwzt', array('bwztid' => $id), 'uid') : 0;
    showmessage('do_success', "space.php?uid={$uid}&do=bwzt&id={$id}", 0);
} elseif ($_GET['op'] == 'edithot') {
    //权限
    if (!checkperm('managebwzt')) {
        showmessage('no_privilege');
    }
    if (submitcheck('hotsubmit')) {