Version 5.0.0 beta 7
This commit is contained in:
1 parent
fa2a720105
commit
54d5dcd0a0
156 files changed
+4337
-2995
No files matched your search
@@ -17,7 +17,7 @@ use DomainException;
|
||||
use Exception;
|
||||
use IPS\Content;
|
||||
use IPS\convert\Software;
|
||||
use IPS\convert\Software\Core\Phpbb;
|
||||
use IPS\convert\Software\Core\Phpbb as PhpbbCore;
|
||||
use IPS\Db;
|
||||
use IPS\Http\Url;
|
||||
use IPS\Member;
|
||||
@@ -192,14 +192,14 @@ class Phpbb 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 Content 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 Phpbb::fixPostData( $post, $className, $contentId );
|
||||
return PhpbbCore::fixPostData( $post, $className, $contentId );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,7 +207,7 @@ class Phpbb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertForumsForums()
|
||||
public function convertForumsForums(): void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -219,8 +219,8 @@ class Phpbb extends Software
|
||||
'id' => $row['forum_id'],
|
||||
'name' => $row['forum_name'],
|
||||
'description' => $row['forum_desc'],
|
||||
'topics' => isset( $row['forum_topics_approved'] ) ? $row['forum_topics_approved'] : $row['forum_topics'],
|
||||
'posts' => isset( $row['forum_posts_approved'] ) ? $row['forum_posts_approved'] : $row['forum_posts'],
|
||||
'topics' => $row['forum_topics_approved'] ?? $row['forum_topics'],
|
||||
'posts' => $row['forum_posts_approved'] ?? $row['forum_posts'],
|
||||
'last_post' => $row['forum_last_post_time'],
|
||||
'last_poster_id' => $row['forum_last_poster_id'],
|
||||
'last_poster_name' => $row['forum_last_poster_name'],
|
||||
@@ -229,9 +229,9 @@ class Phpbb extends Software
|
||||
'position' => $row['left_id'],
|
||||
'password' => ( isset( $this->app->_session['more_info']['convertForumsForums']["forum_password_{$row['forum_id']}"] ) ) ? $this->app->_session['more_info']['convertForumsForums']["forum_password_{$row['forum_id']}"] : NULL,
|
||||
'last_title' => $row['forum_last_post_subject'],
|
||||
'queued_topics' => isset( $row['forum_topics_unapproved'] ) ? $row['forum_topics_unapproved'] : 0,
|
||||
'queued_topics' => $row['forum_topics_unapproved'] ?? 0,
|
||||
'queued_posts' => isset( $row['forum_posts_unapproved'] ) ? $row['forum_topics_unapproved'] : 0,
|
||||
'sub_can_post' => ( $row['forum_type'] == 1 ) ? TRUE : FALSE
|
||||
'sub_can_post' => $row['forum_type'] == 1
|
||||
);
|
||||
|
||||
$libraryClass->convertForumsForum( $info );
|
||||
@@ -264,7 +264,7 @@ class Phpbb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertForumsTopics()
|
||||
public function convertForumsTopics(): void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -327,15 +327,8 @@ class Phpbb extends Software
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $row['topic_visibility'] ) )
|
||||
{
|
||||
$visibility = $row['topic_visibility'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$visibility = $row['topic_approved'];
|
||||
}
|
||||
|
||||
$visibility = $row['topic_visibility'] ?? $row['topic_approved'];
|
||||
|
||||
/* Global Topics */
|
||||
if ( !$row['forum_id'] )
|
||||
@@ -361,7 +354,7 @@ class Phpbb extends Software
|
||||
'title' => $row['topic_title'],
|
||||
'forum_id' => $row['forum_id'],
|
||||
'state' => ( $row['topic_status'] == 0 ) ? 'open' : 'closed',
|
||||
'posts' => isset( $row['topic_posts_approved'] ) ? $row['topic_posts_approved'] : $row['topic_replies'],
|
||||
'posts' => $row['topic_posts_approved'] ?? $row['topic_replies'],
|
||||
'starter_id' => $row['topic_poster'],
|
||||
'start_date' => $row['topic_time'],
|
||||
'last_poster_id' => $row['topic_last_poster_id'],
|
||||
@@ -406,7 +399,7 @@ class Phpbb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertForumsPosts()
|
||||
public function convertForumsPosts(): void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -414,14 +407,7 @@ class Phpbb extends Software
|
||||
|
||||
foreach( $this->fetch( 'posts', 'post_id' ) AS $row )
|
||||
{
|
||||
if ( isset( $row['post_visibility'] ) )
|
||||
{
|
||||
$visibility = $row['post_visibility'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$visibility = $row['post_approved'];
|
||||
}
|
||||
$visibility = $row['post_visibility'] ?? $row['post_approved'];
|
||||
|
||||
$editName = null;
|
||||
if( $row['post_edit_time'] AND $row['post_edit_user'] )
|
||||
@@ -436,7 +422,7 @@ class Phpbb extends Software
|
||||
$info = array(
|
||||
'pid' => $row['post_id'],
|
||||
'topic_id' => $row['topic_id'],
|
||||
'post' => Phpbb::stripUid( $row['post_text'], $row['bbcode_uid'] ),
|
||||
'post' => PhpbbCore::stripUid( $row['post_text'], $row['bbcode_uid'] ),
|
||||
'append_edit' => ( $row['post_edit_user'] ) ? 1 : 0,
|
||||
'edit_time' => $row['post_edit_time'],
|
||||
'edit_name' => $editName,
|
||||
@@ -445,7 +431,7 @@ class Phpbb extends Software
|
||||
'ip_address' => $row['poster_ip'],
|
||||
'post_date' => $row['post_time'],
|
||||
'queued' => ( $visibility == 1 ) ? 0 : -1,
|
||||
'pdelete_time' => isset( $row['post_delete_time'] ) ? $row['post_delete_time'] : NULL,
|
||||
'pdelete_time' => $row['post_delete_time'] ?? NULL,
|
||||
);
|
||||
|
||||
$libraryClass->convertForumsPost( $info );
|
||||
@@ -470,7 +456,7 @@ class Phpbb extends Software
|
||||
'wl_moderator' => $log['user_id'],
|
||||
'wl_date' => $warning['warning_time'],
|
||||
'wl_points' => 1,
|
||||
'wl_note_member' => isset( $data[0] ) ? $data[0] : NULL,
|
||||
'wl_note_member' => $data[0] ?? NULL,
|
||||
) );
|
||||
|
||||
/* Add a member history record for this member */
|
||||
@@ -492,14 +478,14 @@ class Phpbb extends Software
|
||||
/**
|
||||
* @brief temporarily store post content
|
||||
*/
|
||||
protected $_postContent = array();
|
||||
protected array $_postContent = array();
|
||||
|
||||
/**
|
||||
* Convert attachments
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertAttachments()
|
||||
public function convertAttachments(): void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -559,8 +545,7 @@ class Phpbb extends Software
|
||||
$this->_postContent[ $pid ] .= '<br>' . $replacement;
|
||||
}
|
||||
}
|
||||
catch( UnderflowException $e ) {}
|
||||
catch( OutOfRangeException $e ) {}
|
||||
catch( UnderflowException|OutOfRangeException $e ) {}
|
||||
}
|
||||
|
||||
$libraryClass->setLastKeyValue( $row['attach_id'] );
|
||||
|
||||
Reference in new issue
Block a user