コード例 #1
0
ファイル: comments_inc.php プロジェクト: kailIII/liberty
    $gBitSmarty->assign_by_ref('comments', $commentsTree);
    $gBitSmarty->assign('maxComments', $maxComments);
    $numCommentPages = ceil($numComments / $maxComments);
    $comments_return_url = $comments_return_url . (!strpos($comments_return_url, '?') ? '?' : '');
    // libertypagination smarty function setup
    $commentsPgnHash = array('numPages' => $numCommentPages, 'pgnName' => 'comment_page', 'page' => $currentPage, 'comment_page' => $currentPage, 'url' => $comments_return_url, 'comments_page' => empty($comments_on_separate_page) ? FALSE : $comments_on_separate_page, 'ianchor' => 'editcomments');
    $gBitSmarty->assign_by_ref('commentsPgnHash', $commentsPgnHash);
    $gBitSmarty->assign_by_ref('postComment', $postComment);
    $gBitSmarty->assign_by_ref('gComment', $gComment);
    $gBitSmarty->assign('currentTimestamp', time());
    $gBitSmarty->assign('comments_return_url', $comments_return_url);
    $gBitSmarty->assign('comments_at_top_of_page', isset($comments_at_top_of_page) && $gBitSystem->getConfig('comments_reorganise_page_layout', 'n') == 'y' ? $comments_at_top_of_page : NULL);
    $gBitSmarty->assign('comments_style', $comments_display_style);
    $gBitSmarty->assign('comments_sort_mode', $comments_sort_mode);
    $gBitSmarty->assign('textarea_id', 'commentpost');
    $gBitSmarty->assign('comments_count', $numComments);
    // @TODO get this shit out of here - boards and any other package ridding on comments should make use of services
    if ($gBitSystem->isPackageActive('boards')) {
        require_once BOARDS_PKG_PATH . 'BitBoardTopic.php';
    }
    // @TODO get this shit out of here - boards and any other package ridding on comments should make use of services
    // this clearly can go in an edit service, but need to be careful since comments currently does not call edit service - have to check what doing so might trigger.
    if (!empty($_REQUEST['post_comment_request'])) {
        if ($gBitSystem->isPackageActive('boards') && BitBoardTopic::isLockedMsg(@BitBase::verifyId($storeComment->mInfo['parent_id']) ? $storeComment->mInfo['parent_id'] : (!@BitBase::verifyId($_REQUEST['post_comment_reply_id']) ? $commentsParentId : $_REQUEST['post_comment_reply_id']))) {
            unset($_REQUEST['post_comment_request']);
            unset($_GET['post_comment_request']);
            unset($_POST['post_comment_request']);
            $formfeedback['warning'] = "The selected Topic is Locked posting is disabled";
        }
    }
}
コード例 #2
0
ファイル: BitBoard.php プロジェクト: bitweaver/boards
function boards_content_verify(&$pObject, &$pParamHash)
{
    // board posts ( e.g. liberty comments ) service
    global $gBitSystem, $gBitUser;
    // use is_a instead of isContentType( BITCOMMENT_CONTENT_TYPE_GUID ) as isContentType() checks isValid(), and this service method will not properly handle new object stores
    if ($gBitSystem->isPackageActive('boards') && is_a($pObject, 'LibertyComment')) {
        if (BitBoardTopic::isLockedMsg($pParamHash['parent_id'])) {
            $pObject->mErrors['warning'] = tra("The selected Topic is Locked posting is disabled");
        }
    }
}