예제 #1
0
파일: showmessage.php 프로젝트: kawf/kawf
$_domain = $tpl->get_var("DOMAIN");
unset($tpl->varkeys["DOMAIN"]);
unset($tpl->varvals["DOMAIN"]);
$tpl->set_var("DOMAIN", $_domain);
if (isset($pmsg)) {
    $tpl->set_var(array("PMSG_MID" => $pmsg['mid'], "PMSG_SUBJECT" => $pmsg['subject'], "PMSG_NAME" => $pmsg['name'], "PMSG_DATE" => $pmsg['date']));
} else {
    $tpl->set_var("parent", "");
}
render_message($tpl, $msg, $user, $uuser);
/* viewer, message owner */
$vmid = $msg['mid'];
list($messages, $tree, $path) = get_thread_messages($thread, $vmid);
$threadmsg = "<ul class=\"thread\">\n";
if (isset($messages)) {
    $threadmsg .= list_thread(print_subject, $messages, $tree, reset($tree), $thread, $path);
} else {
    $threadmsg .= "Missing. Message does not belong to a thread.";
}
$threadmsg .= "</ul>\n";
$threadlinks = gen_threadlinks($thread);
if ($thread['flag']['Sticky']) {
    $tpl->set_var("CLASS", "srow0");
} else {
    if (is_thread_bumped($thread)) {
        $tpl->set_var("CLASS", "trow0");
    } else {
        $tpl->set_var("CLASS", "row0");
    }
}
$tpl->set_var("THREAD", $threadmsg);
예제 #2
0
파일: showthread.php 프로젝트: kawf/kawf
    global $template_dir, $user, $forum;
    global $tpl;
    /* hack to get current page */
    $mtpl = new Template($template_dir, "comment");
    $mtpl->set_file("message", "message.tpl");
    message_set_block($mtpl);
    $iid = mid_to_iid($msg['mid']);
    if (isset($iid)) {
        $sql = "update f_messages{$iid} set views = views + 1 where mid = ?";
        db_exec($sql, array($msg['mid']));
    }
    $uuser = new ForumUser($msg['aid']);
    $mtpl->set_var("parent", "");
    render_message($mtpl, $msg, $user, $uuser);
    /* in threaded mode, subject is a link. override MSG_SUBJECT set above. */
    $mtpl->set_var("MSG_SUBJECT", "<a href=\"../msgs/" . $msg['mid'] . ".phtml\" name=\"" . $msg['mid'] . "\">" . $msg['subject'] . "</a>");
    $mtpl->set_var("FORUM_SHORTNAME", $forum['shortname']);
    $mtpl->set_var("PAGE", $tpl->get_var('PAGE'));
    $mtpl->parse("MESSAGE", "message");
    return $mtpl->get_var("MESSAGE");
}
$messagestr = list_thread(print_message, $messages, $tree, reset($tree), $thread);
$tpl->set_var("MESSAGES", $messagestr);
$meta_robots = false;
if ($robots_meta_tag) {
    $meta_robots = 'noindex';
    if (isset($forum['option']['ExternallySearchable'])) {
        $meta_robots = 'follow,index';
    }
}
print generate_page($forum['name'], $tpl->parse("CONTENT", "showthread"), false, $meta_robots);