示例#1
0
function show_forum($topicid, $subject, $open = 1, $openids = false)
{
    static $setup = 0;
    if (!$setup) {
        print "<script src='attachments.js'></script>\n";
        print "<script src='forum.js'></script>\n";
        $setup = 1;
    }
    list($rc, $posts) = ff_getposts($topicid, false, 2);
    if ($rc) {
        print "Forum Error: {$posts}";
        return;
    }
    if (substr($topicid, 0, 6) == 'reqmts') {
        list($rc, $proj) = ff_getprojectinfo(substr($topicid, 6));
        if ($rc) {
            print "Forum Error: {$rc} {$proj}";
            return;
        }
        print "<script>\n";
        print "{$topicid}_reqmts_seq = {$proj['reqmts_seq']};\n";
        print "{$topicid}_reqmts = '" . jsencode($proj["reqmts"]) . "';\n";
        print "</script>\n";
    }
    //'post a comment' link  must disappear when the post form is displayed
    print "<div id={$topicid}_commentdiv>\n";
    button("Post a Comment", "javascript:inlinepost('{$topicid}','','{$topicid}_fieldcomment','','{$GLOBALS['username']}')");
    if (sizeof($posts) == 0) {
        print "<p>There are currently no comments in this forum.</p>\n";
        print "</div>\n";
        print "<div id={$topicid}_fieldcomment></div>\n";
        return;
    }
    print "</div>\n";
    print "<div id={$topicid}_fieldcomment></div>\n";
    show_thread($topicid, $posts, $open, $openids);
}
示例#2
0
$openids = array();
$foundtop = 0;
$curpost = false;
foreach ($ancestors as $ancestor) {
    if ($ancestor == $topid) {
        $foundtop = 1;
    }
    if (!$foundtop) {
        continue;
    }
    if ($curpost === false) {
        $curpost =& $top;
    } else {
        $curpost =& $curpost["children"][$ancestor];
    }
    list($rc, $curpost["children"]) = ff_getposts(false, $curpost["id"], 1);
    $openids[$ancestor] = 1;
}
show_body($topicid, $top, $openids);
$html = ob_get_contents();
ob_end_clean();
?>
parent.document.getElementById('postbody<?php 
echo $topid;
?>
').innerHTML='<?php 
echo jsencode($html);
?>
';
parent.document.getElementById('arrow<?php 
echo $topid;