Example #1
0
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;
}
Example #2
0
$count = PAGE_SIZE;
if ($page == $pagecount) {
    cache_header("nocache");
} else {
    $origin_if = bbs_get_board_index($bname, $dir_modes["ORIGIN"]);
    if (cache_header("public", @filemtime($origin_if), 10)) {
        exit;
    }
}
$articles = bbs_getarticles($bname, $start, $count, $dir_modes["ORIGIN"]);
if ($articles == FALSE) {
    ie("cannot read index.");
}
$response->pagecount = $pagecount;
$arr = array();
$i = 0;
foreach ($articles as $article) {
    $response->topic[$i]->id = $article["ID"];
    $response->topic[$i]->title = int_string(htmlspecialchars($article["TITLE"]));
    $response->topic[$i]->author = $article["OWNER"];
    $response->topic[$i]->reply = $article["REPLYCOUNT"];
    $response->topic[$i]->last_reply_time = $article["LAST_POSTTIME"];
    $response->topic[$i]->last_reply_author = $article["LAST_OWNER"];
    $filename = bbs_get_board_filename($bname, $article["FILENAME"]);
    $ret = bbs_parse_article($filename, $arr, 1);
    if ($ret == 0) {
        $response->topic[$i]->brief = int_string(htmlspecialchars($arr["brief"]));
    }
    $i++;
}
int_finish($response);