示例#1
0
文件: funcs.php 项目: bianle/www2
function int_article($article, $fname, $bid)
{
    global $domain;
    $arr = array();
    $ret = bbs_parse_article($fname, $arr, 0);
    if ($ret < 0) {
        ie("cannot parse article.");
    }
    $response->id = $article["ID"];
    $response->reid = $article["REID"];
    $response->groupid = $article["GROUPID"];
    $response->author->name = $arr["userid"];
    $response->author->nick_name = int_string(htmlspecialchars($arr["username"]));
    $response->title = int_string(htmlspecialchars($article["TITLE"]));
    $response->text = int_string(bbs_printansifile($fname, 1, "http://{$domain}/bbscon.php?bid={$bid}&amp;id={$article["ID"]}", 0, 0));
    $response->publish_time = $article["POSTTIME"];
    $response->publish_author = $article["OWNER"];
    return $response;
}
示例#2
0
文件: bbsvote.php 项目: bianle/www2
    $retnum = bbs_vote_num($board, $num, $votevalueint1, $votevalueint2, $msg);
    if ($retnum <= 0) {
        html_error_quit("投票错误" . $retnum);
    } else {
        html_success_quit("投票成功");
    }
}
if ($retnum <= 0) {
    html_error_quit("该投票不存在");
}
bbs_board_nav_header($brdarr, "投票");
$descdir = "vote/" . $board . "/desc." . $votearr[0]["DATE"];
?>
<div class="article">
<?php 
echo @bbs_printansifile($descdir);
?>
</div>
<table class="main wide adj">
<col class="right"/><col/>
<tbody>
<tr><td>序号</td><td><?php 
echo $num;
?>
</tr>
<tr><td>标题</td><td><?php 
echo $votearr[0]["TITLE"];
?>
</tr>
<tr><td>类型</td><td><?php 
echo $votearr[0]["TYPE"];
示例#3
0
bbs_board_nav_header($brdarr, "模板发文");
if (isset($_GET["do"])) {
    $tmpfile = "tmp/" . $currentuser["userid"] . ".tmpl.tmp";
    $title = bbs_make_tmpl_file($board, $num, @$_POST["text0"], @$_POST["text1"], @$_POST["text2"], @$_POST["text3"], @$_POST["text4"], @$_POST["text5"], @$_POST["text6"], @$_POST["text7"], @$_POST["text8"], @$_POST["text9"], @$_POST["text10"], @$_POST["text11"], @$_POST["text12"], @$_POST["text13"], @$_POST["text14"], @$_POST["text15"], @$_POST["text16"], @$_POST["text17"], @$_POST["text18"], @$_POST["text19"], @$_POST["text20"]);
    if ($title == "") {
        html_error_quit("请输入标题");
    }
    ?>
<h1>模板发文预览</h1>
<div class="large"><div class="article">
标题: <?php 
    echo $title;
    ?>
<br/><br/>
<?php 
    echo bbs_printansifile($tmpfile);
    ?>
</div></div>
<form method="post" action="bbssnd.php?board=<?php 
    echo $board;
    echo $restr;
    ?>
">
<input type="hidden" name="tmpl" value="1"/>
<input type="hidden" name="title" value="<?php 
    echo $title;
    ?>
"/>
<input type="submit" value="发表" />
</form>
<?php 
示例#4
0
文件: board.php 项目: tilitala/nForum
 /**
  * function getVote get vote of board via num
  * array(
  *     'USERID' => string
  *     'TITLE' => string
  *     'DATE' => int
  *     'TYPE' => string '是非' (length=4)
  *     'MAXDAY' => int
  *     'MAXTKT' => int 1
  *     'DESC' => int
  *     'TOTALITEMS' => int
  *     'ITEM1' => string
  *     'ITEM2' => string
  *     'ITEM3' => string
  *     'ITEM4' => string
  *     'ITEM5' => string
  *     'ITEM6' => string
  *     'ITEM7' => string
  *     'VOTED1' => int 1
  *     'VOTED2' => int 1
  *     'MSG1' => string
  *     'MSG2' => string
  *     'MSG3' => string
  * )
  *
  * @param int $num
  * @return mixed array|false
  * array(
  *     'owner' string
  *     'title' string
  *     'start' int
  *     'type' string
  *     'day' int
  *     'limit' int
  *     'desc' string
  *     'val' array
  * )
  * @access public
  */
 public function getVote($num)
 {
     $arr = array();
     $res = array();
     $num = bbs_get_vote_from_num($this->NAME, $arr, $num, $res);
     if ($num < 0) {
         return false;
     }
     $ret['owner'] = $arr[0]['USERID'];
     $ret['title'] = $arr[0]['TITLE'];
     $ret['start'] = $arr[0]['DATE'];
     $ret['type'] = $arr[0]['TYPE'];
     $ret['day'] = $arr[0]['MAXDAY'];
     $ret['limit'] = $arr[0]['MAXTKT'];
     $ret['desc'] = @bbs_printansifile("vote/" . $this->NAME . "/desc." . $arr[0]["DATE"]);
     $voted = isset($res[0]['VOTED1']);
     switch ($arr[0]['TYPE']) {
         case '数字':
             $ret['val'] = $voted ? $res[0]['VOTED1'] : "";
             break;
         case '问答':
             $ret['val'] = false;
             break;
         default:
             foreach (range(1, $arr[0]['TOTALITEMS']) as $i) {
                 $ret['val'][] = array($arr[0]['ITEM' . $i], $voted && ($res[0]['VOTED' . ($i <= 32 ? '1' : '2')] & 1 << ($i - 1) % 32) != 0);
             }
     }
     $ret['msg'] = $voted ? trim(join("\n", array($res[0]['MSG1'], $res[0]['MSG2'], $res[0]['MSG3']))) : "";
     return $ret;
 }