Esempio n. 1
0
function show_body($topicid, $post, $openids = false)
{
    $body = $post["body"];
    $diff = '';
    if (ereg("^(.*)\n/-/-/-/-/-begin-diff-/-/-/-/-/\n(.*)\$", $body, $args)) {
        $body = $args[1];
        $diff = $args[2];
    }
    $body = linkify(str_replace("\n", "<br />\n", trim(htmlentities($body))));
    //check if post has attachments
    if (sizeof($post['attachments']) > 0) {
        list($rc, $body) = ff_attachtobody($post['id'], $body);
    }
    print $body;
    if ($diff) {
        include_once "diff.php";
        print "<hr>\n";
        print formatDiff($diff);
    }
    if (sizeof($post['attachments']) > 0) {
        print "<br>\n";
        print "<b>attachments:</b><br>\n";
        list($rc, $err) = ff_listattachments($post['id']);
    }
    $subject = $post["subject"];
    $subject = ereg_replace("^[rR][eE]:? *", "", $subject);
    $subject = "Re: {$subject}";
    print "<br>\n";
    print "<div class=postfooter>";
    print "[ <a href=\"javascript:inlinepost('{$topicid}','{$post['id']}','{$topicid}_field{$post['id']}','" . htmlentities(jsencode("Re: " . ereg_replace("^[rR][eE]:? *", "", $post["subject"]))) . "','{$GLOBALS['username']}')\">Reply to This</a> ]";
    // If the post status is pending and the lead is viewing,
    // offer the Accept / Reject options.
    if ($post['status'] == 'pending') {
        $projectid = substr($post['topicid'], 6);
        list($rc, $projinfo) = ff_getprojectinfo($projectid);
        if ($GLOBALS['username'] == $projinfo['lead'] && $GLOBALS['username'] !== "") {
            // If a requirements change dispute is deliberating then
            // the lead can't accept this proposal.
            list($rc, $disputes) = ff_getprojectdisputes($projectid);
            if ($rc) {
                $disputes = array();
            }
            $canaccept = 1;
            foreach ($disputes as $dispute) {
                if ($dispute["type"] == 'badchange' && $dispute["status"] == 'deliberating') {
                    $canaccept = 0;
                    break;
                }
            }
            print "[ <a href=\"handlechange.php?project={$projectid}&accept=1&post={$post['id']}\"" . ($canaccept ? "" : " onClick=\"alert('You can\\'t accept requirements changes while a\\nchange dispute is in deliberation.  Please try again later.');return false\"") . "> Accept </a> ]";
            print "[ <a href=\"handlechange.php?project={$projectid}&accept=0&post={$post['id']}\"> Reject </a> ]";
        }
    }
    print "</div>";
    print "<div id={$topicid}_field{$post['id']}></div>";
    print "<div id={$topicid}_attachment{$post['id']} align='right'></div>";
    if (sizeof($post["children"])) {
        print "<div class=postindent>";
        show_thread($topicid, $post["children"], 0, $openids);
        print "</div>\n";
    }
}
Esempio n. 2
0
        return 'message not found.\\n';
    }
    $title_arr = array();
    $title_arr[] = 'Message: ' . $msg_id;
    echo html_build_list_table_top($title_arr);
    echo "<TR><TD BGCOLOR=\"E3E3E3\">\n";
    echo "BY: " . db_result($result, 0, "user_name") . "<BR>";
    echo "DATE: " . date($sys_datefmt, db_result($result, 0, "date")) . "<BR>";
    echo "SUBJECT: " . db_result($result, 0, "subject") . "<P>";
    // correct making links with anchor tag - helix 2003-11-19
    //	echo util_make_links(nl2br(db_result($result,0, 'body')));
    echo nl2br(util_make_links(db_result($result, 0, 'body')));
    echo "</TD></TR></TABLE>";
    /*
    	Show entire thread
    */
    echo '<BR>&nbsp;<P><H3>Thread View</H3>';
    //highlight the current message in the thread list
    $current_message = $msg_id;
    echo show_thread(db_result($result, 0, 'thread_id'));
    /*
    	Show post followup form
    */
    echo '<P>&nbsp;<P>';
    echo '<CENTER><h3>Post a followup to this message</h3></CENTER>';
    show_post_form(db_result($result, 0, 'group_forum_id'), db_result($result, 0, 'thread_id'), $msg_id, db_result($result, 0, 'subject'));
} else {
    forum_header(array('title' => 'Must choose a message first'));
    echo '<h1>You must choose a message first</H1>';
}
forum_footer(array());