Version 5.0.0 beta 7

This commit is contained in:
Neo committed 2025-12-19 17:18:38 -08:00
1 parent fa2a720105
commit 54d5dcd0a0
156 files changed
+4337 -2995

No files matched your search

@@ -18,7 +18,7 @@ use Exception;
use InvalidArgumentException;
use IPS\convert\App;
use IPS\convert\Software;
use IPS\convert\Software\Core\Vbulletin;
use IPS\convert\Software\Core\Vbulletin as VbulletinCore;
use IPS\Db;
use IPS\forums\Forum;
use IPS\forums\Topic;
@@ -49,12 +49,12 @@ class Vbulletin extends Software
/**
* @brief vBulletin 4 Stores all attachments under one table - this will store the content type for the forums app.
*/
protected static $postContentType = NULL;
protected static ?int $postContentType = NULL;
/**
* @brief The schematic for vB3 and vB4 is similar enough that we can make specific concessions in a single converter for either version.
*/
protected static $isLegacy = NULL;
protected static ?bool $isLegacy = NULL;
/**
* @brief Flag to indicate the post data has been fixed during conversion, and we only need to use Legacy Parser
@@ -69,9 +69,9 @@ class Vbulletin extends Software
* @return void
* @throws InvalidArgumentException
*/
public function __construct( App $app, $needDB=TRUE )
public function __construct( App $app, bool $needDB=TRUE )
{
$return = parent::__construct( $app, $needDB );
parent::__construct( $app, $needDB );
if ( $needDB )
{
@@ -101,8 +101,6 @@ class Vbulletin extends Software
}
catch( Exception $e ) {}
}
return $return;
}
/**
@@ -240,14 +238,14 @@ class Vbulletin extends Software
/**
* Pre-process content for the Invision Community text parser
*
* @param string The post
* @param string|null Content Classname passed by post-conversion rebuild
* @param int|null Content ID passed by post-conversion rebuild
* @param string $post The post
* @param string|null $className Content Classname passed by post-conversion rebuild
* @param int|null $contentId ID passed by post-conversion rebuild
* @return string The converted post
*/
public static function fixPostData( string $post, ?string $className=null, ?int $contentId=null ): string
{
return Vbulletin::fixPostData( $post, $className, $contentId );
return VbulletinCore::fixPostData( $post, $className, $contentId );
}
/**
@@ -340,7 +338,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertForumsForums()
public function convertForumsForums() : void
{
$libraryClass = $this->getLibrary();
@@ -357,7 +355,7 @@ class Vbulletin extends Software
$key = 'options';
}
if ( $forum[$key] & $self::$bitOptions[$name][$perm] )
if ( $forum[$key] & static::$bitOptions[$name][$perm] )
{
return TRUE;
}
@@ -432,7 +430,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertForumsTopics()
public function convertForumsTopics() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'threadid' );
@@ -469,7 +467,7 @@ class Vbulletin extends Software
$votes[$index] = $vote;
$index++;
$numvotes += $vote;
$numvotes += (int) $vote;
}
$poll = array();
@@ -552,7 +550,7 @@ class Vbulletin extends Software
'poll_state' => $poll,
'last_vote' => $lastVote,
'views' => $topic['views'],
'approved' => $approved,
'approved' => $approved ?? 1,
'pinned' => $topic['sticky'],
'topic_hiddenposts' => $topic['hiddencount'] + $topic['deletedcount']
);
@@ -627,7 +625,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertForumsTopicsFollowers()
public function convertForumsTopicsFollowers() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'subscribethreadid' );
@@ -677,7 +675,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertForumsPosts()
public function convertForumsPosts() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'postid' );
@@ -819,7 +817,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertAttachments()
public function convertAttachments() : void
{
$libraryClass = $this->getLibrary();
@@ -918,8 +916,7 @@ class Vbulletin extends Software
Db::i()->update( 'forums_posts', array( 'post' => $post ), array( "pid=?", $pid ) );
}
}
catch( UnderflowException $e ) {}
catch( OutOfRangeException $e ) {}
catch( UnderflowException|OutOfRangeException $e ) {}
}
$libraryClass->setLastKeyValue( $attachment['attachmentid'] );
@@ -931,7 +928,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertClubForums()
public function convertClubForums() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'groupid' );
@@ -954,7 +951,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertClubTopics()
public function convertClubTopics() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'discussionid' );
@@ -996,7 +993,7 @@ class Vbulletin extends Software
'last_post' => $row['lastpost'],
'starter_name' => $firstpost['postusername'],
'last_poster_name' => $row['lastposter'],
'approved' => $approved,
'approved' => $approved ?? 1,
) );
$libraryClass->setLastKeyValue( $row['discussionid'] );
@@ -1008,7 +1005,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertClubPosts()
public function convertClubPosts() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'gmid' );
@@ -1036,7 +1033,7 @@ class Vbulletin extends Software
'author_id' => $row['postuserid'],
'author_name' => $row['postusername'],
'post_date' => $row['dateline'],
'queued' => $queued,
'queued' => $queued ?? 0,
) );
$libraryClass->setLastKeyValue( $row['gmid'] );
}