Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -44,28 +44,44 @@ class _Screenshots
|
||||
*/
|
||||
public function move( $offset, $storageConfiguration, $oldConfiguration=NULL )
|
||||
{
|
||||
$record = \IPS\Db::i()->select( '*', 'downloads_files_records', array( 'record_type=?', 'ssupload' ), 'record_id', array( $offset, 1 ) )->first();
|
||||
|
||||
$record = \IPS\Db::i()->select( '*', 'downloads_files_records', array( 'record_type=?', 'ssupload' ), 'record_id', array( $offset, 1 ) )->first();
|
||||
$updates = array();
|
||||
|
||||
try
|
||||
{
|
||||
$file = \IPS\File::get( $oldConfiguration ?: 'downloads_Screenshots', $record['record_location'] )->move( $storageConfiguration );
|
||||
|
||||
if ( (string) $file != $record['record_location'] )
|
||||
{
|
||||
\IPS\Db::i()->update( 'downloads_files_records', array( 'record_location' => (string) $file ), array( 'record_id=?', $record['record_id'] ) );
|
||||
$updates['record_location'] = (string) $file;
|
||||
}
|
||||
|
||||
$file = \IPS\File::get( $oldConfiguration ?: 'downloads_Screenshots', $record['record_thumb'] )->move( $storageConfiguration );
|
||||
|
||||
if ( (string) $file != $record['record_thumb'] )
|
||||
{
|
||||
\IPS\Db::i()->update( 'downloads_files_records', array( 'record_thumb' => (string) $file ), array( 'record_id=?', $record['record_id'] ) );
|
||||
$updates['record_thumb'] = (string) $file;
|
||||
}
|
||||
|
||||
if( $record['record_no_watermark'] )
|
||||
{
|
||||
$file = \IPS\File::get( $oldConfiguration ?: 'downloads_Screenshots', $record['record_no_watermark'] )->move( $storageConfiguration );
|
||||
|
||||
if ( (string) $file != $record['record_no_watermark'] )
|
||||
{
|
||||
$updates['record_no_watermark'] = (string) $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
/* Any issues are logged */
|
||||
}
|
||||
|
||||
if( \count( $updates ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'downloads_files_records', $updates, array( 'record_id=?', $record['record_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,6 +103,11 @@ class _Screenshots
|
||||
{
|
||||
\IPS\Db::i()->update( 'downloads_files_records', array( 'record_thumb' => $new ), array( 'record_id=?', $record['record_id'] ) );
|
||||
}
|
||||
|
||||
if ( $record['record_no_watermark'] and $new = \IPS\File::repairUrl( $record['record_no_watermark'] ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'downloads_files_records', array( 'record_no_watermark' => $new ), array( 'record_id=?', $record['record_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +120,8 @@ class _Screenshots
|
||||
{
|
||||
try
|
||||
{
|
||||
$record = \IPS\Db::i()->select( '*', 'downloads_files_records', array( '( record_location=? OR record_thumb=? ) AND record_type=?', (string) $file, (string) $file, 'ssupload' ) )->first();
|
||||
$fileName = (string) $file;
|
||||
$record = \IPS\Db::i()->select( '*', 'downloads_files_records', array( '( record_location=? OR record_thumb=? OR record_no_watermark=? ) AND record_type=?', $fileName, $fileName, $fileName, 'ssupload' ) )->first();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user