Example #1
0
 public static function getInstance($num, $board)
 {
     $res = array();
     $retnum = bbs_get_tmpl_from_num($board->NAME, $num, $res);
     if ($retnum <= 0 || $res[0]["CONT_NUM"] == 0) {
         throw new TemplateNullException();
     }
     $info = array_shift($res);
     return new Template($info, $num, $board, $res);
 }
Example #2
0
} else {
    html_error_quit("参数错误2");
}
if ($num <= 0) {
    html_error_quit("参数错误3");
}
$brdarr = array();
$brdnum = bbs_getboard($board, $brdarr);
if ($brdnum == 0) {
    html_error_quit("错误的讨论区");
}
if (bbs_checkreadperm($currentuser["index"], $brdnum) == 0) {
    html_error_quit("您没有权限");
}
$votearr = array();
$retnum = bbs_get_tmpl_from_num($board, $num, $votearr);
if ($retnum <= 0) {
    html_error_quit("错误");
}
if ($votearr[0]["CONT_NUM"] <= 0) {
    html_error_quit("本模板暂不可使用");
}
if (isset($_GET["reid"])) {
    $restr = "&reid=" . $_GET["reid"];
    $reid = intval($_GET["reid"]);
    $articles = array();
    if ($reid > 0) {
        $anum = bbs_get_records_from_id($board, $reid, $dir_modes["NORMAL"], $articles);
        if ($anum == 0) {
            html_error_quit("错误的 Re 文编号");
        }