Source for file view_topic_inc.php
Documentation is available at view_topic_inc.php
require_once( '../kernel/setup_inc.php' );
require_once( BOARDS_PKG_PATH. 'BitBoard.php' );
require_once( BOARDS_PKG_PATH. 'BitBoardTopic.php' );
require_once( BOARDS_PKG_PATH. 'BitBoardPost.php' );
// if we're getting a migrate id then lets move on right away
if( @BitBase::verifyId( $_REQUEST['migrate_topic_id'] ) ) {
bit_redirect( BOARDS_PKG_URL. 'index.php?t='. $_REQUEST['t'] );
} elseif( @BitBase::verifyId( $_REQUEST['migrate_post_id'] ) ) {
bit_redirect( BOARDS_PKG_URL. 'index.php?t='. $_REQUEST['t'] );
// @TODO move this to edit_post
if (!empty($_REQUEST['action'])) {
// Now check permissions to access this page
// @TODO load up the parent board and call verifyUpdatePermission
if (!$comment->isValid()) {
$gBitSystem->fatalError( tra("Invalid Comment"), NULL, NULL, HttpStatusCodes::HTTP_GONE );
switch ($_REQUEST['action']) {
$comment->loadMetaData();
$comment->modWarn($_REQUEST['warning_message']);
// Finally - load up our topic
if( !$thread->isValid() ) {
$gBitSystem->fatalError( tra("Unknown discussion"), NULL, NULL, HttpStatusCodes::HTTP_GONE );
$thread->verifyViewPermission();
// load up the root board we need it
$gBoard = new BitBoard(null,$thread->mInfo['board_content_id']);
$gBitSmarty->assign_by_ref( 'board', $gBoard );
// force root board to be gContent
$gBitSmarty->assign_by_ref('gContent', $gContent);
// if you know what this is please comment it
if (empty($thread->mInfo['th_root_id'])) {
if ($_REQUEST['action']== 3) {
//Invalid as a result of rejecting the post, redirect to the board
$gBitSystem->fatalError(tra( "Invalid topic selection." ), NULL, NULL, HttpStatusCodes::HTTP_GONE );
$displayHash = array( 'perm_name' => 'p_boards_read' );
$thread->invokeServices( 'content_display_function', $displayHash );
$gBitSmarty->assign_by_ref( 'thread', $thread );
$gBitSmarty->assign('topic_locked',$thread->isLocked());
// Get the thread of comments
$commentsParentId= $thread->mInfo['content_id'];
$comments_return_url= BOARDS_PKG_URL. "index.php?t={$thread->mRootId}";
$gBitSystem->setCanonicalLink( BOARDS_PKG_URL. 'index.php?t='. $thread->mRootId );
$gBitSmarty->assign('comment_template','bitpackage:boards/post_display.tpl');
// set default comment display style
if( empty( $_REQUEST["comments_style"] ) ) {
$_REQUEST["comments_style"] = "flat";
require_once( BOARDS_PKG_PATH. 'boards_comments_inc.php' );
if( $gBitUser->isRegistered() ) {
$postComment['registration_date']= $gBitUser->mInfo['registration_date'];
$postComment['user_avatar_url']= $gBitUser->mInfo['avatar_url'];
// display warnings - might be for edit processes - if you know please comment
if (!empty($_REQUEST['warning'])) {
foreach ($_REQUEST['warning'] as $id => $state) {
$gBitSmarty->assign_by_ref('warnings',$warnings);
$gBitThemes->loadAjax( 'mochikit' );
$gBitSystem->display('bitpackage:boards/list_posts.tpl', "Show Thread: " . $thread->getField('title') , array( 'display_mode' => 'display' ));
|