Esempio n. 1
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">
<!--
var c = new docWriter('<?php 
echo addslashes($board);
?>
',<?php 
echo $brdarr["BID"];
?>
,0,0,-2,0,0,'<?php 
Esempio n. 2
0
function atomic_board()
{
    global $currentuser, $atomic_board, $atomic_brdarr, $atomic_brdnum, $dir_modes, $atomic_ftype;
    atomic_get_board();
    $isnormalboard = bbs_normalboard($atomic_board);
    if ($isnormalboard && (isset($_GET["page"]) || $atomic_ftype)) {
        $dotdirname = bbs_get_board_index($atomic_board, $atomic_ftype);
        if (cache_header("public", @filemtime($dotdirname), $atomic_ftype ? 300 : 10)) {
            return;
        }
    }
    atomic_header();
    atomic_show_boardjump();
    $total = bbs_countarticles($atomic_brdnum, $atomic_ftype);
    if ($total <= 0) {
        atomic_error("本讨论区目前没有文章");
    }
    $page = isset($_GET["page"]) ? @intval($_GET["page"]) : 0;
    if (isset($_GET["start"])) {
        $page = (@intval($_GET["start"]) + ARTCNT - 1) / ARTCNT;
    }
    settype($page, "integer");
    $start = $page > 0 ? ($page - 1) * ARTCNT + 1 : 0;
    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($atomic_board, $start, ARTCNT, $atomic_ftype);
    if ($articles == FALSE) {
        atomic_error("读取文章列表失败");
    }
    $html = '<form action="?" method="get"><input type="hidden" name="act" value="board"/>';
    if ($atomic_ftype) {
        $html .= '<input type="hidden" name="ftype" value="' . $atomic_ftype . '"/>';
    }
    $html .= '<input type="hidden" name="board" value="' . $atomic_board . '"/>';
    $html .= '<a href="?act=post&board=' . $atomic_board . '">发表</a> ';
    if (atomic_uploadable()) {
        $html .= '<a href="?act=post&board=' . $atomic_board . '&upload=1">带附件发表</a> ';
    }
    $bl = '?act=board&board=' . $atomic_board;
    if ($atomic_ftype) {
        $bl .= '&ftype=' . $atomic_ftype;
    }
    if ($page > 1) {
        $html .= '<a href="' . $bl . '&page=1">第一页</a> ';
        $html .= '<a href="' . $bl . '&page=' . ($page - 1) . '">上页</a> ';
    } else {
        $html .= '第一页 上页 ';
    }
    if ($start <= $total - 20) {
        $html .= '<a href="' . $bl . '&page=' . ($page + 1) . '">下页</a> ';
        $html .= '<a href="' . $bl . '">最后一页</a> ';
    } else {
        $html .= '下页 最后一页 ';
    }
    $html .= '<input type="submit" value="跳转到"/> 第 <input type="text" name="start" size="3" /> 篇 ';
    if ($atomic_ftype != $dir_modes["NORMAL"]) {
        $html .= "<a href='?act=board&board=" . $atomic_board . "'>版面</a> ";
    } else {
        $html .= "<b>版面</b> ";
    }
    if ($atomic_ftype != $dir_modes["DIGEST"]) {
        $html .= "<a href='?act=board&board=" . $atomic_board . "&ftype=" . $dir_modes["DIGEST"] . "'>文摘</a> ";
    } else {
        $html .= "<b>文摘</b> ";
    }
    if ($atomic_ftype != $dir_modes["MARK"]) {
        $html .= "<a href='?act=board&board=" . $atomic_board . "&ftype=" . $dir_modes["MARK"] . "'>保留</a> ";
    } else {
        $html .= "<b>保留</b> ";
    }
    $ann_path = bbs_getannpath($atomic_board);
    if ($ann_path != FALSE) {
        if (!strncmp($ann_path, "0Announce/", 10)) {
            $ann_path = substr($ann_path, 9);
        }
    }
    $html .= "<a href='?act=ann&path=" . $ann_path . "'>精华</a> ";
    $html .= "</form>";
    $html .= "<pre> 编号   刊 登 者     日  期  文章标题<br/>";
    $i = 0;
    foreach ($articles as $article) {
        $title = $article["TITLE"];
        if (strncmp($title, "Re: ", 4) != 0) {
            $title = "● " . $title;
        }
        $flags = $article["FLAGS"];
        if (!strncmp($flags, "D", 1) || !strncmp($flags, "d", 1)) {
            $html .= " [提示] ";
        } else {
            $html .= sprintf("%5d ", $start + $i);
            if ($flags[0] == 'N' || $flags[0] == '*') {
                $html .= " ";
                //$flags[0];  //不要未读标记 windinsn
            } else {
                $html .= $flags[0];
            }
            $html .= " ";
        }
        $html .= sprintf("%-12.12s ", $article["OWNER"]);
        $html .= strftime("%b %e ", $article["POSTTIME"]);
        $html .= $flags[3];
        $articleurl = "?act=article&board=" . $atomic_board . "&id=" . $article["ID"];
        if ($atomic_ftype) {
            $articleurl .= "&ftype=" . $atomic_ftype . "&num=" . ($start + $i);
        }
        $html .= "<a href='" . $articleurl . "'>" . htmlspecialchars($title) . " </a><br/>";
        $i++;
    }
    $html .= "</pre>";
    echo $html;
    atomic_footer();
}
Esempio n. 3
0
function display_articles($brdarr, $articles, $start, $ftype, $managemode, $page, $total, $showHot, $isnormalboard)
{
    global $brdnum, $usernum, $dir_modes, $show_none, $isclub;
    $board = $brdarr["NAME"];
    $ann_path = bbs_getannpath($board);
    if ($ann_path != FALSE) {
        if (!strncmp($ann_path, "0Announce/", 10)) {
            $ann_path = substr($ann_path, 9);
        }
    }
    if ($ftype == $dir_modes["DELETED"]) {
        $mancode = "2";
    } else {
        $mancode = $managemode ? "1" : "0";
    }
    ?>
<script type="text/javascript"><!--
var c = new docWriter('<?php 
    echo addslashes($board);
    ?>
',<?php 
    echo $brdarr["BID"];
    ?>
,<?php 
    echo $start;
    ?>
,<?php 
    echo $mancode;
    ?>
,<?php 
    echo $ftype;
    ?>
,<?php 
    echo $page;
    ?>
,<?php 
    echo $total;
    ?>
,'<?php 
    echo addslashes($ann_path);
    ?>
',<?php 
    echo $showHot ? "1" : "0";
    ?>
,<?php 
    echo $isnormalboard ? "1" : "0";
    ?>
);
<?php 
    if ($show_none) {
        ?>
document.write('<tr><td align="center" colspan="<?php 
        echo $managemode ? 6 : 5;
        ?>
">本区没有文章。</td></tr>');
<?php 
    } else {
        foreach ($articles as $article) {
            ?>
c.o(<?php 
            echo $article["ID"];
            ?>
,<?php 
            echo $article["GROUPID"];
            ?>
,'<?php 
            echo $article["OWNER"];
            ?>
',<?php 
            $flags = $article["FLAGS"];
            echo "'" . $flags[0] . $flags[3] . "'";
            ?>
,<?php 
            echo $article["POSTTIME"];
            ?>
,'<?php 
            echo addslashes(htmlspecialchars($article["TITLE"], ENT_QUOTES));
            ?>
 ',<?php 
            echo $article["EFFSIZE"];
            ?>
,<?php 
            echo $flags[1] == "y" ? "1" : "0";
            ?>
,<?php 
            echo $article["IS_TEX"] ? "1" : "0";
            ?>
);
<?php 
        }
    }
    ?>
c.t();c.f('<?php 
    echo $isnormalboard ? bbs_rss_link(urlencode($board), $ftype) : "";
    ?>
',<?php 
    $s = TRUE;
    if (defined("SITE_SMTH")) {
        $relatefile = $_SERVER["DOCUMENT_ROOT"] . "/brelated/" . $brdarr["NAME"] . ".js";
        if (file_exists($relatefile)) {
            if (@readfile($relatefile)) {
                $s = FALSE;
            }
        }
    }
    if ($s) {
        echo "0";
    }
    ?>
,<?php 
    echo $isclub;
    ?>
);
//-->
</script>
<?php 
}
Esempio n. 4
0
 /**
  * function getElitePath
  *
  * @return string
  * @access public
  */
 public function getElitePath()
 {
     $ret = bbs_getannpath($this->NAME);
     if ($ret === false) {
         return "";
     }
     $ret = preg_replace("/^0Announce\\//", "", $ret);
     return $ret;
 }