示例#1
0
    if (!empty($_REQUEST['comment_name'])) {
        $postComment['anon_name'] = $_REQUEST['comment_name'];
    }
    $postComment['data'] = $_REQUEST['comment_data'];
    $postComment['format_guid'] = empty($_REQUEST['format_guid']) ? $gBitSystem->getConfig('default_format') : $_REQUEST['format_guid'];
    $postComment['parsed_data'] = LibertyComment::parseData($postComment);
    $postComment['created'] = time();
    $postComment['last_modified'] = time();
    $gBitSmarty->assign('post_comment_preview', TRUE);
}
// $post_comment_reply_id is the content_id which a post is replying to
if (@BitBase::verifyId($_REQUEST['post_comment_reply_id'])) {
    $post_comment_reply_id = $_REQUEST['post_comment_reply_id'];
    $tmpComment = new LibertyComment(NULL, $post_comment_reply_id);
    if (!empty($_REQUEST['quote'])) {
        $postComment['data'] = $tmpComment->getQuoted();
    }
    if (preg_match('/^' . tra('Re:') . '/', $tmpComment->mInfo['title'])) {
        $comment_prefix = '';
    } else {
        $comment_prefix = tra('Re:') . " ";
    }
    //this always overrides the title with "Re: Parent Title" -- not sure what it really should do so I put in this conditional for previews
    if (!isset($_REQUEST['comment_title'])) {
        $postComment['title'] = $comment_prefix . $tmpComment->mInfo['title'];
    }
    $gBitSmarty->assign('post_comment_reply_id', $post_comment_reply_id);
}
if ($gContent->hasUserPermission('p_liberty_read_comments')) {
    if (!empty($_SESSION['liberty_comments_per_page'])) {
        $maxComments = $_SESSION['liberty_comments_per_page'];