Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -12,16 +12,23 @@
|
||||
namespace IPS\convert\Software\Forums;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\convert\Software;
|
||||
use IPS\Task;
|
||||
use UnderflowException;
|
||||
use function defined;
|
||||
use function strtotime;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* BBPress Forums Converter
|
||||
*/
|
||||
class _Bbpress extends \IPS\convert\Software
|
||||
class Bbpress extends Software
|
||||
{
|
||||
/**
|
||||
* Software Name
|
||||
@@ -96,11 +103,11 @@ class _Bbpress extends \IPS\convert\Software
|
||||
public function finish()
|
||||
{
|
||||
/* Content Rebuilds */
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 4, array( 'class' ) );
|
||||
\IPS\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'forums_posts', 'class' => 'IPS\forums\Topic\Post' ), 2, array( 'app', 'link', 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\forums\Topic' ), 3, array( 'class' ) );
|
||||
\IPS\Task::queue( 'convert', 'RebuildFirstPostIds', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
|
||||
\IPS\Task::queue( 'convert', 'DeleteEmptyTopics', array( 'app' => $this->app->app_id ), 5, array( 'app' ) );
|
||||
Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\forums\Forum', 'count' => 0 ), 4, array( 'class' ) );
|
||||
Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'forums_posts', 'class' => 'IPS\forums\Topic\Post' ), 2, array( 'app', 'link', 'class' ) );
|
||||
Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\forums\Topic' ), 3, array( 'class' ) );
|
||||
Task::queue( 'convert', 'RebuildFirstPostIds', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
|
||||
Task::queue( 'convert', 'DeleteEmptyTopics', array( 'app' => $this->app->app_id ), 5, array( 'app' ) );
|
||||
|
||||
return array( "f_forum_last_post_data", "f_rebuild_posts", "f_recounting_forums", "f_recounting_topics" );
|
||||
}
|
||||
@@ -157,7 +164,7 @@ class _Bbpress extends \IPS\convert\Software
|
||||
{
|
||||
static::$userCache[ $row['post_author'] ] = $this->db->select( $userName, 'users', array( 'ID=?', $row['post_author'] ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
catch( UnderflowException $e )
|
||||
{
|
||||
static::$userCache[ $row['post_author'] ] = 'Guest';
|
||||
}
|
||||
@@ -169,7 +176,7 @@ class _Bbpress extends \IPS\convert\Software
|
||||
'forum_id' => $row['post_parent'],
|
||||
'state' => ( $row['post_status'] == 'publish' ) ? 'open' : 'closed',
|
||||
'starter_id' => $row['post_author'],
|
||||
'start_date' => \strtotime( $row['post_date'] ),
|
||||
'start_date' => strtotime( $row['post_date'] ),
|
||||
'starter_name' => static::$userCache[ $row['post_author'] ],
|
||||
);
|
||||
|
||||
@@ -199,7 +206,7 @@ class _Bbpress extends \IPS\convert\Software
|
||||
{
|
||||
static::$userCache[ $row['post_author'] ] = $this->db->select( $userName, 'users', array( 'ID=?', $row['post_author'] ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
catch( UnderflowException $e )
|
||||
{
|
||||
static::$userCache[ $row['post_author'] ] = 'Guest';
|
||||
}
|
||||
@@ -211,7 +218,7 @@ class _Bbpress extends \IPS\convert\Software
|
||||
'post' => $row['post_content'],
|
||||
'author_id' => $row['post_author'],
|
||||
'author_name' => static::$userCache[ $row['post_author'] ],
|
||||
'post_date' => \strtotime( $row['post_date'] )
|
||||
'post_date' => strtotime( $row['post_date'] )
|
||||
);
|
||||
|
||||
$libraryClass->convertForumsPost( $info );
|
||||
|
||||
Reference in new issue
Block a user