Exemple #1
0
if (isset($_GET["board"])) {
    $board = $_GET["board"];
} else {
    $board = $_POST["board"];
}
$brdarr = array();
$brdnum = bbs_getboard($board, $brdarr);
if ($brdnum == 0) {
    html_error_quit("错误的讨论区");
}
$usernum = $currentuser["index"];
if (bbs_checkreadperm($usernum, $brdnum) == 0) {
    html_error_quit("错误的讨论区");
}
$board = $brdarr["NAME"];
$isnormalboard = bbs_normalboard($board);
if ($isnormalboard) {
    $dotdirname = bbs_get_board_index($board, $dir_modes["NORMAL"]);
    if (cache_header("public", @filemtime($dotdirname), 300)) {
        return;
    }
}
bbs_board_header($brdarr, -2, 0);
$ann_path = bbs_getannpath($board);
if ($ann_path != FALSE) {
    if (!strncmp($ann_path, "0Announce/", 10)) {
        $ann_path = substr($ann_path, 9);
    }
}
?>
<script type="text/javascript">
Exemple #2
0
function atomic_article()
{
    global $currentuser, $atomic_board, $atomic_brdarr, $atomic_brdnum, $dir_modes, $atomic_ftype;
    atomic_get_board();
    $id = @intval($_GET["id"]);
    if ($id <= 0) {
        atomic_error("错误的文章号");
    }
    $url = "?act=article&board=" . $atomic_board . "&id=";
    @($ptr = $_GET["p"]);
    // 同主题的指示在这里处理
    if ($ptr == "tn" || $ptr == "tp") {
        $articles = bbs_get_threads_from_id($atomic_brdnum, $id, $dir_modes["NORMAL"], $ptr == "tp" ? -1 : 1);
        if ($articles == FALSE) {
            $redirt_id = $id;
        } else {
            $redirt_id = $articles[0]["ID"];
        }
        header("Location: atomic.php" . $url . $redirt_id);
        exit;
    }
    $total = bbs_countarticles($atomic_brdnum, $atomic_ftype);
    if ($total <= 0) {
        atomic_error("错误的文章号,原文可能已经被删除");
    }
    if (!$atomic_ftype) {
        $articles = array();
        $num = bbs_get_records_from_id($atomic_board, $id, $atomic_ftype, $articles);
        if ($num <= 0) {
            atomic_error("错误的文章号,原文可能已经被删除");
        }
        $article = $articles[1];
    } else {
        $num = @intval($_GET["num"]);
        if ($num <= 0 || $num > $total) {
            atomic_error("错误的文章号,原文可能已经被删除");
        }
        if (($articles = bbs_getarticles($atomic_board, $num, 1, $atomic_ftype)) === false) {
            atomic_error("错误的文章号,原文可能已经被删除");
        }
        if ($id != $articles[0]["ID"]) {
            atomic_error("错误的文章号,原文可能已经被删除");
        }
        $article = $articles[0];
    }
    $filename = bbs_get_board_filename($atomic_board, $article["FILENAME"]);
    $isnormalboard = bbs_normalboard($atomic_board);
    if ($isnormalboard) {
        if (cache_header("public", @filemtime($filename), 300)) {
            return;
        }
    }
    if (!$atomic_ftype) {
        $idx = $ptr == 'p' ? 0 : ($ptr == 'n' ? 2 : -1);
        if ($idx != -1 && $articles[$idx]["ID"] != 0) {
            header("Location: atomic.php" . $url . $articles[$idx]["ID"]);
            exit;
        }
        bbs_brcaddread($atomic_board, $article["ID"]);
    }
    atomic_header();
    $html = '<p>';
    if (!$atomic_ftype) {
        $html .= '<a href="' . $url . $article["ID"] . '&p=tn">主题下篇</a> ';
        $html .= '<a href="' . $url . $article["GROUPID"] . '">楼主</a> ';
        $html .= '<a href="?act=post&board=' . $atomic_board . '">发表</a> <a href="?act=post&board=' . $atomic_board . '&reid=' . $id . '">回复</a> ';
        if (atomic_uploadable()) {
            $html .= '<a href="?act=post&board=' . $atomic_board . '&reid=' . $id . '&upload=1">带附件回复</a> ';
        }
        $html .= '<a href="' . $url . $article["ID"] . '&p=p">上篇</a> ';
        $html .= '<a href="' . $url . $article["ID"] . '&p=n">下篇</a> ';
        $html .= '<a href="' . $url . $article["ID"] . '&p=tp">主题上篇</a> ';
        $html .= '<a href="' . $url . $article["REID"] . '">溯源</a> ';
    }
    $html .= '<a href="?act=board&board=' . $atomic_board . '&page=' . intval(($num + ARTCNT - 1) / ARTCNT) . ($atomic_ftype ? "&ftype=" . $atomic_ftype : "") . '">回版面</a> ';
    $ourl = 'bbscon.php?bid=' . $atomic_brdnum . '&id=' . $article["ID"];
    if ($atomic_ftype) {
        $ourl .= "&ftype=" . $atomic_ftype . "&num=" . $num;
    }
    $html .= '<a href="' . $ourl . '">原文</a> ';
    $html .= '</p>';
    echo $html;
    echo bbs2_readfile_text($filename, MAXCHAR, 2);
    if ($article["ATTACHPOS"]) {
        echo '<p>本文含有附件: <a href="' . $ourl . '">原文链接</a></p>';
    }
    atomic_footer();
}
Exemple #3
0
} else {
    html_error_quit('错误的讨论区');
}
$brdarr = array();
$bid = bbs_getboard($board, $brdarr);
if (!$bid) {
    html_error_quit('错误的讨论区');
}
$board = $brdarr['NAME'];
$brd_encode = urlencode($board);
if (isset($_GET['id'])) {
    $id = intval($_GET['id']);
} else {
    html_error_quit('错误的文章ID');
}
if (!bbs_normalboard($board)) {
    if (bbs_checkreadperm($currentuser["index"], $bid) == 0) {
        html_error_quit("错误的讨论区");
    }
}
$ftype = $dir_modes["NORMAL"];
$articles = array();
$num = bbs_get_records_from_id($board, $id, $ftype, $articles);
if ($num == 0) {
    html_error_quit("错误的文章号,原文可能已经被删除");
}
$id = $articles[1]["ID"];
bbs_board_nav_header($brdarr, "文章推荐");
$confirmed = isset($_GET['do']) ? 1 : 0;
switch (bbs_docommend($board, $id, $confirmed)) {
    case 0:
Exemple #4
0
 public function isNormal()
 {
     return bbs_normalboard($this->NAME) == 1;
 }