diff options
| author | modela bitweaver <spiderr@bitweaver.org> | 2021-02-01 12:22:53 -0500 |
|---|---|---|
| committer | modela bitweaver <spiderr@bitweaver.org> | 2021-02-01 12:22:53 -0500 |
| commit | 6e4ff4522532da0af3daead83ed469081a01e18c (patch) | |
| tree | 5fe5fbfe5e3bc2ae18000379f12255693a260026 | |
| parent | 2175a98906031fff0d8932acaef2996dd09c42fe (diff) | |
| download | boards-6e4ff4522532da0af3daead83ed469081a01e18c.tar.gz boards-6e4ff4522532da0af3daead83ed469081a01e18c.tar.bz2 boards-6e4ff4522532da0af3daead83ed469081a01e18c.zip | |
PHP7 clean up dual static + object methods
| -rw-r--r-- | BitBoardTopic.php | 16 | ||||
| -rw-r--r-- | view_topic_inc.php | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/BitBoardTopic.php b/BitBoardTopic.php index cae8ac4..2000583 100644 --- a/BitBoardTopic.php +++ b/BitBoardTopic.php @@ -499,18 +499,21 @@ class BitBoardTopic extends LibertyMime { return $ret; } - function isLocked($pThreadId=false) { + public static function isLocked( $pThreadId ) { global $gBitSystem; +/* + // remove mixed static / dynamic function invocation if (!$pThreadId) { $pThreadId = $this->mCommentContentId; } else { $pThreadId=intval($pThreadId); } - $ret = $gBitSystem->mDb->getOne("SELECT `is_locked` FROM `".BIT_DB_PREFIX."boards_topics` WHERE `parent_id` = ?", array( $pThreadId ) ); +*/ + $ret = $gBitSystem->mDb->getOne("SELECT `is_locked` FROM `".BIT_DB_PREFIX."boards_topics` WHERE `parent_id` = ?", array( (int)$pThreadId ) ); return !empty($ret); } - function isLockedMsg($parent_id) { + public static function isLockedMsg( $parent_id ) { // $parentComment = new LibertyComment(NULL,$parent_id); // $topicId = $parentComment->mInfo['thread_forward_sequence']; if (!empty($parent_id)) { @@ -519,16 +522,19 @@ class BitBoardTopic extends LibertyMime { return false; } - function isNotificationOn($pThreadId=false) { + public static function isNotificationOn( $pThreadId ) { global $gBitSystem, $gBitUser; if ($gBitSystem->isPackageActive('boards') && $gBitSystem->isFeatureActive('boards_thread_track')) { +/* + // remove mixed static / dynamic function invocation if (!$pThreadId) { $pThreadId = $this->mRootId; } if (is_numeric($pThreadId)) { $topicId = sprintf("%09d.",$pThreadId); } - return $gBitSystem->mDb->getOne("SELECT SUM(`notify`) FROM `".BIT_DB_PREFIX."boards_tracking` WHERE topic_id='$topicId'"); +*/ + return $gBitSystem->mDb->getOne("SELECT SUM(`notify`) FROM `".BIT_DB_PREFIX."boards_tracking` WHERE topic_id=?", array( (int)$topicId ) ); } return false; } diff --git a/view_topic_inc.php b/view_topic_inc.php index 80bb38f..1368d94 100644 --- a/view_topic_inc.php +++ b/view_topic_inc.php @@ -91,7 +91,7 @@ $thread->invokeServices( 'content_display_function', $displayHash ); $thread->readTopic(); $gBitSmarty->assignByRef( 'thread', $thread ); -$gBitSmarty->assign('topic_locked',$thread->isLocked()); +$gBitSmarty->assign( 'topic_locked', BitBoardTopic::isLocked( $thread->mCommentContentId ) ); // Get the thread of comments |
