コード例 #1
0
ファイル: mod.php プロジェクト: xianyuxmu/alinkagarden-xiuno
    $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'];
                $tid = $thread['tid'];
                if (forum_access_mod($fid, $gid, 'allowmove')) {
                    thread_update($tid, array('fid' => $newfid));
                    $arr = array('uid' => $uid, 'tid' => $thread['tid'], 'pid' => $thread['firstpid'], 'subject' => $thread['subject'], 'comment' => '', 'create_date' => $time, 'action' => 'move');
                    modlog_create($arr);
                }
            }
            message(0, '移动完成');
        }
    }
} elseif ($action == 'deleteuser') {
    $_uid = param(2, 0);
    $method != 'POST' and message(-1, 'Method error');
    empty($group['allowdeleteuser']) and message(-1, '您无权删除用户');
    $u = user_read($_uid);
    empty($u) and message(-1, '用户不存在或者已经被删除。');
    $u['gid'] < 6 and message(-1, '不允许删除管理组,请先调整用户用户组。');
コード例 #2
0
ファイル: post.php プロジェクト: jarryyen/xiuno-theme-flarum
} elseif ($action == 'delete') {
    $pid = param(2, 0);
    if ($method != 'POST') {
        message(-1, '方法不对');
    }
    $post = post_read($pid);
    empty($post) and message(-1, '帖子不存在:' . $pid);
    $tid = $post['tid'];
    $thread = thread_read($tid);
    empty($thread) and message(-1, '主题不存在:' . $tid);
    $fid = $thread['fid'];
    $forum = forum_read($fid);
    empty($forum) and message(-1, '板块不存在:' . $fid);
    $isfirst = $post['isfirst'];
    !forum_access_user($fid, $gid, 'allowpost') and message(-1, '您(' . $user['groupname'] . ')无权限在此版块回帖');
    $allowdelete = forum_access_mod($fid, $gid, 'allowdelete');
    !$allowdelete and !$post['allowdelete'] and message(-1, '无权删除该帖');
    if ($isfirst) {
        // 清除所有的回复。喜欢。还有相关资源
        thread_delete($tid);
    } else {
        post_delete($pid);
        post_list_cache_delete($tid);
    }
    message(0, '删除成功');
    // 接受 base64 文件上传
} elseif ($action == 'upload') {
    // 允许的文件后缀名
    $types = (include './conf/attach.conf.php');
    $allowtypes = $types['all'];
    empty($uid) and message(-1, '游客不允许上传文件');
コード例 #3
0
ファイル: post.php プロジェクト: xianyuxmu/alinkagarden-xiuno
<?php

// 创建新帖
!defined('DEBUG') and exit('Access Denied.');
include './xiunophp/xn_html_safe.func.php';
include './xiunophp/image.func.php';
$action = param(1);
$user = user_read($uid);
if ($action == 'update') {
    $pid = param(2);
    $post = post_read($pid);
    empty($post) and message(-1, '帖子不存在:' . $pid);
    $tid = $post['tid'];
    $thread = thread_read($tid);
    empty($thread) and message(-1, '主题不存在:' . $tid);
    $fid = $thread['fid'];
    $forum = forum_read($fid);
    empty($forum) and message(1, '板块不存在:' . $fid);
    $isfirst = $post['isfirst'];
    !forum_access_user($fid, $gid, 'allowpost') and message(-1, '您(' . $user['groupname'] . ')无权限在此版块回帖');
    $allowupdate = forum_access_mod($fid, $gid, 'allowupdate');
    !$allowupdate and !$post['allowupdate'] and message(-1, '无权编辑该贴');
    if ($method == 'GET') {
        $forumarr = xn_json_encode(arrlist_key_values($forumlist, 'fid', 'name'));
        $post['message'] = htmlspecialchars($post['message']);
        include './mobile/view/post_update.htm';
    }
} else {
    message(-1, '没有此功能');
}