<?php require "www2-funcs.php"; require "www2-board.php"; require "www2-bmp.php"; $sessionid = login_init(TRUE); 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("错误的文编号"); }
$clubnum = $boardparams["CLUBNUM"]; $bm = $boardparams["BM"]; $title = substr($boardparams["TITLE"], 13, 256); $secnum = substr($boardparams["TITLE"], 0, 1); $btype = substr($boardparams["TITLE"], 2, 4); $innflag = substr($boardparams["TITLE"], 7, 6); $des = $boardparams["DES"]; $flag = $boardparams["FLAG"]; $anony = $boardparams["FLAG"] & BBS_BOARD_ANNONY ? " checked" : ""; $notjunk = $boardparams["FLAG"] & BBS_BOARD_JUNK ? "" : " checked"; $notpoststat = $boardparams["FLAG"] & BBS_BOARD_POSTSTAT ? "" : " checked"; $group = $boardparams["FLAG"] & BBS_BOARD_GROUP ? " checked" : ""; $parentb = $boardparams["GROUP"]; if ($parentb != "") { $parentbarr = array(); $parentbstatus = is_null(bbs_safe_getboard(0, $parentb, $parentbarr)) ? "(异常)" : ""; } else { $parentb = ""; $parentbstatus = ""; } $outflag = $boardparams["FLAG"] & BBS_BOARD_OUTFLAG ? " checked" : ""; $attach = $boardparams["FLAG"] & BBS_BOARD_ATTACH ? " checked" : ""; $emailpost = $boardparams["FLAG"] & BBS_BOARD_EMAILPOST ? " checked" : ""; $noreply = $boardparams["FLAG"] & BBS_BOARD_NOREPLY ? " checked" : ""; $clubread = $boardparams["FLAG"] & BBS_BOARD_CLUB_READ ? " checked" : ""; $clubwrite = $boardparams["FLAG"] & BBS_BOARD_CLUB_WRITE ? " checked" : ""; $clubhide = $boardparams["FLAG"] & BBS_BOARD_CLUB_HIDE ? " checked" : ""; if ($clubread == "" && $clubwrite == "") { $clubhide .= " disabled"; } $annpath = $boardparams["ANNPATH"];
<?php require "www2-funcs.php"; require "www2-rss.php"; login_init(FALSE, TRUE); $query = $_SERVER["QUERY_STRING"]; settype($query, "string"); if (strlen($query) < 2) { die; } $type = substr($query, 0, 1); $board = substr($query, 1); // 检查用户能否阅读该版 $brdarr = array(); $isnormalboard = bbs_safe_getboard(0, $board, $brdarr); if (is_null($isnormalboard)) { die; } if (strcmp($board, $brdarr["NAME"])) { die; } //cache consideration $brdnum = $brdarr["BID"]; if ($brdarr["FLAG"] & BBS_BOARD_GROUP) { die; } /* * 内部版面不提供 rss 的理由: * 1. rss 软件或 rss 网站无法正确实现 session-based 登录,或者实现了也无意义 * 2. 内部版面内容流入 rss 软件或 rss 网站并被保存可能造成信息泄露 * 3. 内部版面 rss 无法在 squid 前端缓存,可能造成潜在负荷问题
$start = 0; } /* * 这里存在一个时间差的问题,可能会导致序号变乱。 * 原因在于两次调用 bbs_countarticles() 和 bbs_getarticles()。 */ if ($start == 0 || $start > $total - ARTCNT + 1) { if ($total <= ARTCNT) { $start = 1; $page = 1; } else { $start = $total - ARTCNT + 1; $page = ($start + ARTCNT - 1) / ARTCNT + 1; } } else { $page = ($start + ARTCNT - 1) / ARTCNT; } settype($page, "integer"); $articles = bbs_getarticles($brdarr["NAME"], $start, ARTCNT, $ftype); if ($articles == FALSE) { html_error_quit("读取文章列表失败"); } } else { $articles = 0; $start = 1; $page = 1; } bbs_safe_getboard($brdnum, $board, $brdarr); bbs_board_header($brdarr, $ftype, $managemode, $isnormalboard); display_articles($brdarr, $articles, $start, $ftype, $managemode, $page, $total, defined('BBS_NEWPOSTSTAT') && !$managemode && $isnormalboard && !$ftype, $isnormalboard); page_footer();