summaryrefslogtreecommitdiff
path: root/includes/view_topic_inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/view_topic_inc.php')
-rwxr-xr-x[-rw-r--r--]includes/view_topic_inc.php37
1 files changed, 18 insertions, 19 deletions
diff --git a/includes/view_topic_inc.php b/includes/view_topic_inc.php
index efee35e..ceec213 100644..100755
--- a/includes/view_topic_inc.php
+++ b/includes/view_topic_inc.php
@@ -7,19 +7,19 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
-
-// we need all three
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoard.php' );
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php' );
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoardPost.php' );
+use Bitweaver\BitBase;
+use Bitweaver\HttpStatusCodes;
+use Bitweaver\Boards\BitBoard;
+use Bitweaver\Boards\BitBoardTopic;
+use Bitweaver\Boards\BitBoardPost;
+require_once '../kernel/includes/setup_inc.php';
// if we're getting a migrate id then lets move on right away
-if( @BitBase::verifyId( $_REQUEST['migrate_topic_id'] ) ) {
+if( BitBase::verifyId( $_REQUEST['migrate_topic_id'] ?? 0 ) ) {
if( $_REQUEST['t'] = BitBoardTopic::lookupByMigrateTopic( $_REQUEST['migrate_topic_id'] ) ) {
bit_redirect( BOARDS_PKG_URL.'index.php?t='. $_REQUEST['t'] );
}
-} elseif( @BitBase::verifyId( $_REQUEST['migrate_post_id'] ) ) {
+} elseif( BitBase::verifyId( $_REQUEST['migrate_post_id'] ?? 0 ) ) {
if( $_REQUEST['t'] = BitBoardTopic::lookupByMigratePost( $_REQUEST['migrate_post_id'] ) ) {
bit_redirect( BOARDS_PKG_URL.'index.php?t='. $_REQUEST['t'] );
}
@@ -34,7 +34,7 @@ if (!empty($_REQUEST['action'])) {
$comment = new BitBoardPost($_REQUEST['comment_id']);
$comment->loadComment();
if (!$comment->isValid()) {
- $gBitSystem->fatalError( tra("Invalid Comment"), NULL, NULL, HttpStatusCodes::HTTP_GONE );
+ $gBitSystem->fatalError( tra("Invalid Comment"), null, null, HttpStatusCodes::HTTP_GONE );
}
switch ($_REQUEST['action']) {
case 1:
@@ -59,7 +59,7 @@ $thread = new BitBoardTopic($_REQUEST['t']);
$thread->load();
if( !$thread->isValid() ) {
- $gBitSystem->fatalError( tra("Unknown discussion"), NULL, NULL, HttpStatusCodes::HTTP_GONE );
+ $gBitSystem->fatalError( tra("Unknown discussion"), null, null, HttpStatusCodes::HTTP_GONE );
}
$thread->verifyViewPermission();
@@ -67,10 +67,10 @@ $thread->verifyViewPermission();
// load up the root board we need it
$gBoard = new BitBoard(null,$thread->mInfo['board_content_id']);
$gBoard->load();
-$gBitSmarty->assignByRef( 'board', $gBoard );
+$gBitSmarty->assign( 'board', $gBoard );
// force root board to be gContent
$gContent = &$gBoard;
-$gBitSmarty->assignByRef('gContent', $gContent);
+$gBitSmarty->assign('gContent', $gContent);
// if you know what this is please comment it
@@ -79,7 +79,7 @@ if (empty($thread->mInfo['th_root_id'])) {
//Invalid as a result of rejecting the post, redirect to the board
bit_redirect( $gBoard->getDisplayUrl() );
} else {
- $gBitSystem->fatalError(tra( "Invalid topic selection." ), NULL, NULL, HttpStatusCodes::HTTP_GONE );
+ $gBitSystem->fatalError(tra( "Invalid topic selection." ), null, null, HttpStatusCodes::HTTP_GONE );
}
}
@@ -90,8 +90,8 @@ $thread->invokeServices( 'content_display_function', $displayHash );
$thread->readTopic();
-$gBitSmarty->assignByRef( 'thread', $thread );
-$gBitSmarty->assign( 'topic_locked', BitBoardTopic::isLocked( $thread->mCommentContentId ) );
+$gBitSmarty->assign( 'thread', $thread );
+$gBitSmarty->assign( 'topic_locked', BitBoardTopic::isThreadLocked( $thread->mCommentContentId ) );
// Get the thread of comments
@@ -106,7 +106,7 @@ if( empty( $_REQUEST["comments_style"] ) ) {
$_REQUEST["comments_style"] = "flat";
}
-require_once( BOARDS_PKG_INCLUDE_PATH.'boards_comments_inc.php' );
+require_once BOARDS_PKG_INCLUDE_PATH.'boards_comments_inc.php';
if( $gBitUser->isRegistered() ) {
$postComment['registration_date']=$gBitUser->mInfo['registration_date'];
@@ -116,7 +116,7 @@ if( $gBitUser->isRegistered() ) {
// display warnings - might be for edit processes - if you know please comment
-$warnings = array();
+$warnings = [];
if (!empty($_REQUEST['warning'])) {
foreach ($_REQUEST['warning'] as $id => $state) {
if (strcasecmp($state,'show')==0) {
@@ -124,11 +124,10 @@ if (!empty($_REQUEST['warning'])) {
}
}
}
-$gBitSmarty->assignByRef('warnings',$warnings);
+$gBitSmarty->assign('warnings',$warnings);
// ajax support
$gBitThemes->loadAjax( 'mochikit' );
$gBitSystem->display('bitpackage:boards/list_posts.tpl', "Show Thread: " . $thread->getField('title') , array( 'display_mode' => 'display' ));
-?>