예제 #1
0
 $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') {
     $forumlist_allowthread = forum_list_access_filter($forumlist, $gid, 'allowthread');
     $forumarr = xn_json_encode(arrlist_key_values($forumlist_allowthread, 'fid', 'name'));
     $post['message'] = htmlspecialchars($post['message']);
     // 将未插入帖子的附件加入到末尾。
     $attachlist = $imagelist = $filelist = array();
     if ($post['images'] || $post['files']) {
         $attachlist = attach_find_by_pid($post['pid']);
         list($imagelist, $filelist) = attach_list_not_in_message($attachlist, $post['message']);
         $post['message'] .= post_attach_list_add($imagelist, $filelist);
     }
     check_standard_browser();
     include './flarum/view/post_update.htm';
 } elseif ($method == 'POST') {
     $subject = htmlspecialchars(param('subject', '', FALSE));
     $message = param('message', '', FALSE);
     $seo_url = strtolower(param('seo_url'));
     empty($message) and message(2, '内容不能为空');
예제 #2
0
<?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, '没有此功能');
}