include "funcs.php"; $bid = $_GET["bid"]; if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page = 0; } $bname = bbs_getbname($bid); if ($bname == "") { ie("board not found."); } if (!bbs_checkreadperm($uid, $bid)) { ie("permission denied."); } bbs_checkorigin($bname); $total = bbs_countarticles($bid, $dir_modes["ORIGIN"]); $pagecount = ceil($total / PAGE_SIZE); if ($page < 0) { $page = 0; } if ($page > $pagecount) { $page = $pagecount; } if ($page == 0) { $page = $pagecount; } $start = ($page - 1) * PAGE_SIZE + 1; $count = PAGE_SIZE; if ($page == $pagecount) { cache_header("nocache"); } else {
} $dotdirname = bbs_get_board_index($board, $ftype); $modifytime = @filemtime($dotdirname); if (cache_header("public", $modifytime, 1800)) { return; } $channel = array(); $htmlboardDesc = BBS_FULL_NAME . " " . $board . "/" . htmlspecialchars($brdarr["DESC"], ENT_QUOTES) . " "; $channel["title"] = $htmlboardDesc . $title; $channel["description"] = $htmlboardDesc . " 版面" . $desc . "索引"; $channel["link"] = SiteURL . "frames.html?mainurl=" . urlencode("bbsdoc.php?board=" . $board); /* TODO: ftype? */ $channel["language"] = "zh-cn"; $channel["generator"] = "KBS RSS Generator"; $channel["lastBuildDate"] = gmt_date_format($modifytime); $total = bbs_countarticles($brdnum, $ftype); $items = array(); if ($total > 0) { $artcnt = ARTICLE_PER_RSS; if ($total <= $artcnt) { $start = 1; $artcnt = $total; } else { $start = $total - $artcnt + 1; } $articles = bbs_getarticles($board, $start, $artcnt, $ftype) or die; $cc = count($articles); for ($i = $cc - 1; $i >= 0; $i--) { $origin = $articles[$i]; $item = array(); $item["title"] = htmlspecialchars($origin['TITLE'], ENT_QUOTES) . " ";
<a href="bbscon.php?bid=<?php echo $article[1]["O_BID"]; ?> &id=<?php echo $article[1]["O_ID"]; ?> ">ÔʼÎÄÕÂ</a> <?php } $board = "Recommend"; $brdarr = array(); $brdnum = bbs_getboard($board, $brdarr); if ($brdnum == 0) { html_error_quit("´íÎóµÄÌÖÂÛÇø"); } $total = bbs_countarticles($brdnum, $dir_modes["DIGEST"]); if ($total <= 0) { html_error_quit("ĿǰûÓÐÎÄÕÂ"); } if (!isset($_GET["id"])) { html_error_quit("´íÎóµÄÎÄÕºÅ"); } $id = $_GET["id"]; settype($id, "integer"); if ($id == 0) { html_error_quit("´íÎóµÄÎÄÕºÅ."); } $articles = array(); $ftype = $dir_modes["NORMAL"]; $num = bbs_get_records_from_id($brdarr["NAME"], $id, $ftype, $articles); if ($num == 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(); }
/** * function getTypeNum get the article number of $type * * @param int $type * @return int * @access public */ public function getTypeNum($type = null) { if (is_null($type)) { $type = self::$NORMAL; } return bbs_countarticles($this->BID, $type); }