Beispiel #1
0
            foreach ($threadlist as &$thread) {
                $fid = $thread['fid'];
                $tid = $thread['tid'];
                if (forum_access_mod($fid, $gid, 'allowdelete')) {
                    thread_delete($tid);
                    $arr = array('uid' => $uid, 'tid' => $thread['tid'], 'pid' => $thread['firstpid'], 'subject' => $thread['subject'], 'comment' => '', 'create_date' => $time, 'action' => 'delete');
                    modlog_create($arr);
                }
            }
            message(0, '删除完成');
        }
    }
} elseif ($action == 'move') {
    $tids = param(2);
    $arr = explode('_', $tids);
    $tidarr = param_force($arr, array(0));
    empty($tidarr) and message(-1, '请选择主题');
    $header['title'] = '移动';
    if ($method == 'GET') {
        // 选中第一个
        $tid = $tidarr[0];
        $thread = thread_read($tid);
        include './pc/view/mod_move.htm';
    } else {
        if ($method == 'POST') {
            $newfid = param('newfid', 0);
            !forum_read($newfid) and message(1, '板块不存在');
            $threadlist = thread_find_by_tids($tidarr, 1, 1000);
            // 设置置顶
            foreach ($threadlist as &$thread) {
                $fid = $thread['fid'];
Beispiel #2
0
function param($key, $defval = '', $safe = TRUE)
{
    if (!isset($_REQUEST[$key]) || $key === 0 && empty($_REQUEST[$key])) {
        if (is_array($defval)) {
            return array();
        } else {
            return $defval;
        }
    }
    $val = $_REQUEST[$key];
    $val = param_force($val, $defval, $safe);
    return $val;
}