Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -5,19 +5,22 @@
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @package Invision Community
* @subpackage Converter
* @subpackage convert
* @since 21 Jan 2015
*/
namespace IPS\convert\Software\Cms;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Wordpress Pages Converter
*/
class _Wordpress extends \IPS\convert\Software
{
/**
@@ -178,15 +181,22 @@ class _Wordpress extends \IPS\convert\Software
*/
public function finish()
{
$database = $this->app->getLink( 1, 'cms_databases' );
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\cms\Categories' . $database, 'count' => 0 ), 5, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\cms\Records'. $database ), 3, array( 'class' ) );
try
{
$database = $this->app->getLink( 1, 'cms_databases' );
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\cms\Categories' . $database, 'count' => 0 ), 5, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\cms\Records' . $database ), 3, array( 'class' ) );
\IPS\Task::queue( 'convert', 'RebuildTagCache', array( 'app' => $this->app->app_id, 'link' => 'cms_records', 'class' => 'IPS\cms\Records' . $database ), 3, array( 'app', 'link', 'class' ) );
\IPS\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'cms_custom_database_' . $database, 'class' => 'IPS\cms\Records' . $database ), 2, array( 'app', 'link', 'class' ) );
\IPS\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'cms_database_comments', 'class' => 'IPS\cms\Records\Comment' . $database ), 2, array( 'app', 'link', 'class' ) );
\IPS\Task::queue( 'convert', 'RebuildTagCache', array( 'app' => $this->app->app_id, 'link' => 'cms_records', 'class' => 'IPS\cms\Records' . $database ), 3, array( 'app', 'link', 'class' ) );
\IPS\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'cms_custom_database_' . $database, 'class' => 'IPS\cms\Records' . $database ), 2, array( 'app', 'link', 'class' ) );
\IPS\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'cms_database_comments', 'class' => 'IPS\cms\Records\Comment' . $database ), 2, array( 'app', 'link', 'class' ) );
return array( "f_recount_cms_categories", "f_rebuild_cms_tags" );
return array( "f_recount_cms_categories", "f_rebuild_cms_tags" );
}
catch( \OutOfRangeException $e )
{
return array();
}
}
/**
@@ -334,13 +344,14 @@ class _Wordpress extends \IPS\convert\Software
}
/* Record Image */
$image = NULL;
$imagePath = $filename = NULL;
if ( isset( $meta['_thumbnail_id'] ) )
{
try
{
$location = $this->db->select( 'meta_value', 'postmeta', array( "post_id=? AND meta_key=?", $meta['_thumbnail_id'], '_wp_attached_file' ) )->first();
$image = rtrim( $this->app->_session['more_info']['convertCmsDatabaseRecords']['file_location'], '/' ) . '/' . $location;
$imagePath = rtrim( $this->app->_session['more_info']['convertCmsDatabaseRecords']['file_location'], '/' ) . '/' . $location;
$filename = basename( $imagePath );
}
catch( \UnderflowException $e ) {}
}
@@ -353,13 +364,13 @@ class _Wordpress extends \IPS\convert\Software
'record_comments' => $row['comment_count'],
'record_allow_comments' => 1,
'record_saved' => new \IPS\DateTime( $row['post_date'] ),
'record_updated' => new \IPS\DateTime( $row['post_modified'] ),
'record_updated' => $row['post_modified'] !== '0000-00-00 00:00:00' ? new \IPS\DateTime( $row['post_modified'] ) : NULL, # Older WordPress installs may be missing a modified date
'category_id' => $category,
'record_approved' => $approved,
'record_dynamic_furl' => $row['post_name'],
'record_static_furl' => $row['post_name'],
'record_publish_date' => new \IPS\DateTime( $row['post_date'] ),
'record_image' => $image,
'record_image' => $filename,
);
$fields = array(
@@ -367,7 +378,7 @@ class _Wordpress extends \IPS\convert\Software
2 => $row['post_content']
);
$libraryClass->convertCmsDatabaseRecord( $info, $fields );
$libraryClass->convertCmsDatabaseRecord( $info, $fields, $imagePath );
/* Tags */
$tags = array();