Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief Converter XenForo Resource Manager Class
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @package Invision Community
* @subpackage Converter
* @since 21 Jan 2015
*/
@@ -101,6 +101,19 @@ class _Xenforo extends \IPS\convert\Software
'convertDownloadsReviews'
);
}
/**
* Finish
*
* @return array Messages to display
*/
public function finish()
{
\IPS\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'class' => 'IPS\downloads\File', 'link' => 'downloads_files' ), 2, array( 'app', 'link', 'class' ) );
\IPS\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'class' => 'IPS\downloads\File\Review', 'link' => 'downloads_reviews' ), 2, array( 'app', 'link', 'class' ) );
return array( );
}
/**
* Get More Information
@@ -330,7 +343,7 @@ class _Xenforo extends \IPS\convert\Software
$featured = 1;
}
catch( \UnderflowExceptioN $e ) {}
catch( \UnderflowException $e ) {}
$info = array(
'file_id' => $row['resource_id'],
@@ -363,30 +376,48 @@ class _Xenforo extends \IPS\convert\Software
}
else
{
$file_data = $this->db->select( '*', 'xf_attachment', array( "xf_attachment.content_type=? AND xf_attachment.content_id=?", 'resource_version', $record['resource_version_id'] ) )->join( 'xf_attachment_data', "xf_attachment.data_id = xf_attachment_data.data_id" )->first();
$group = floor( $row['user_id'] / 1000 );
try
{
$file_data = $this->db->select( '*', 'xf_attachment', array( "xf_attachment.content_type=? AND xf_attachment.content_id=?", 'resource_version', $record['resource_version_id'] ) )->join( 'xf_attachment_data', "xf_attachment.data_id = xf_attachment_data.data_id" )->first();
}
catch( \UnderflowException $e )
{
$this->app->log( 'xenforo_resource_missing_record', __METHOD__, \IPS\convert\App::LOG_WARNING, $record['resource_update_id'] );
continue;
}
$group = floor( $file_data['data_id'] / 1000 );
$records[] = array(
'record_id' => $record['resource_update_id'],
'record_type' => 'upload',
'file_path' => rtrim( $this->app->_session['more_info']['convertDownloadsFiles']['file_location'], '/' ) . '/' . $group . '/' . $file_data['data_id'] . '-' . $file_data['file_hash'] . '.data',
'record_time' => $record['release_date']
'record_time' => $record['release_date'],
'record_realname' => $file_data['filename']
);
}
/* And now screenshots */
foreach( $this->db->select( '*', 'xf_attachment', array( "xf_attachment.content_type=? AND xf_attachment.content_id=?", 'resource_update', $record['resource_update_id'] ) )->join( 'xf_attachment_data', "xf_attachment.data_id = xf_attachment_data.data_id" ) AS $screen )
try
{
$group = floor( $row['user_id'] / 1000 );
$records[] = array(
'record_type' => 'ssupload',
'file_path' => rtrim( $this->app->_session['more_info']['convertDownloadsFiles']['file_location'], '/' ) . '/' . $group . '/' . $screen['data_id'] . '-' . $screen['file_hash'] . '.data',
'record_time' => $record['release_date']
);
foreach( $this->db->select( '*', 'xf_attachment', array( "xf_attachment.content_type=? AND xf_attachment.content_id=?", 'resource_update', $record['resource_update_id'] ) )->join( 'xf_attachment_data', "xf_attachment.data_id = xf_attachment_data.data_id" ) AS $screen )
{
$group = floor( $file_data['data_id'] / 1000 );
$records[] = array(
'record_type' => 'ssupload',
'file_path' => rtrim( $this->app->_session['more_info']['convertDownloadsFiles']['file_location'], '/' ) . '/' . $group . '/' . $screen['data_id'] . '-' . $screen['file_hash'] . '.data',
'record_time' => $record['release_date'],
'record_realname' => $screen['filename']
);
}
}
catch( \UnderflowException $e )
{
$this->app->log( 'xenforo_resource_missing_screenshot', __METHOD__, \IPS\convert\App::LOG_WARNING, $record['resource_update_id'] );
}
}
$cfields = array();
foreach( $this->db->select( 'field_id, field_value', 'xf_resource_field_value', array( "resource_id=?", $row['resource_id'] ) )->setKeyField( 'field_id' )->setValueField( 'field_value' ) AS $key => $value )
{
Whitespace-only changes.