Пример #1
0
bbs_session_modify_user_mode(BBS_MODE_EDIT);
assert_login();
$brdnum = @$_GET["bid"];
settype($brdnum, "integer");
$brdarr = array();
$isnormalboard = bbs_safe_getboard($brdnum, "", $brdarr);
if (is_null($isnormalboard)) {
    html_error_quit("错误的讨论区");
}
$board = $brdarr["NAME"];
$usernum = $currentuser["index"];
$brd_encode = urlencode($board);
if (bbs_checkpostperm($usernum, $brdnum) == 0) {
    html_error_quit("错误的讨论区或者您无权在此讨论区发表文章");
}
if (bbs_is_readonly_board($brdarr)) {
    html_error_quit("不能在只读讨论区发表文章");
}
$ftype = $dir_modes["NORMAL"];
bbs_board_nav_header($brdarr, "修改附件");
if (isset($_GET['id'])) {
    $id = intval($_GET['id']);
} else {
    html_error_quit("错误的文编号");
}
$articles = array();
$num = bbs_get_records_from_id($brdarr["NAME"], $id, $ftype, $articles);
if ($num == 0) {
    html_error_quit("错误的文编号");
}
@($action = $_GET["act"]);
Пример #2
0
function atomic_get_board($checkpost = false)
{
    global $currentuser, $atomic_board, $atomic_brdarr, $atomic_brdnum, $atomic_ftype, $dir_modes;
    if (isset($_GET["board"])) {
        $atomic_board = $_GET["board"];
    } else {
        atomic_error("错误的讨论区");
    }
    $brdarr = array();
    $atomic_brdnum = bbs_getboard($atomic_board, $brdarr);
    $atomic_brdarr = $brdarr;
    if ($atomic_brdnum == 0) {
        $boards = array();
        if (bbs_searchboard($atomic_board, 0, $boards)) {
            if (sizeof($boards) == 1) {
                cache_header("nocache");
                header("Location: atomic.php?act=board&board=" . urlencode($boards[0]['NAME']));
                exit;
            }
            if (sizeof($boards) > 1) {
                atomic_header();
                $html = "多个匹配的讨论区: ";
                foreach ($boards as $board) {
                    if (!$board['NAME']) {
                        continue;
                    }
                    $html .= '<a href="?act=board&board=' . $board['NAME'] . '">' . $board['NAME'] . '</a> ';
                }
                echo $html;
                atomic_footer();
                exit;
            }
        }
        atomic_error("错误的讨论区");
    }
    $atomic_board = $atomic_brdarr["NAME"];
    $usernum = $currentuser["index"];
    if (bbs_checkreadperm($usernum, $atomic_brdnum) == 0) {
        atomic_error("错误的讨论区");
    }
    if ($atomic_brdarr["FLAG"] & BBS_BOARD_GROUP) {
        atomic_error("不支持版面组");
    }
    bbs_set_onboard($atomic_brdnum, 1);
    if ($checkpost) {
        if (bbs_checkpostperm($usernum, $atomic_brdnum) == 0) {
            atomic_error("错误的讨论区或者您无权在此讨论区发表文章");
        }
        if (bbs_is_readonly_board($atomic_brdarr)) {
            atomic_error("不能在只读讨论区发表文章");
        }
    }
    if (isset($_GET["ftype"])) {
        $atomic_ftype = @intval($_GET["ftype"]);
        switch ($atomic_ftype) {
            case $dir_modes["DIGEST"]:
            case $dir_modes["MARK"]:
            case $dir_modes["NORMAL"]:
                break;
            default:
                atomic_error("错误的模式");
        }
    } else {
        $atomic_ftype = $dir_modes["NORMAL"];
    }
}