Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -33,7 +33,7 @@ class _CleanUpGalleryImages
|
||||
{
|
||||
try
|
||||
{
|
||||
$data['count'] = \IPS\Db::i()->select( 'COUNT(*)', 'gallery_images' )->first();
|
||||
$data['count'] = \IPS\Db::i()->select( 'COUNT(*)', 'gallery_images', array( 'image_media=?', 0 ) )->first();
|
||||
}
|
||||
catch( \Exception $ex )
|
||||
{
|
||||
@@ -66,7 +66,7 @@ class _CleanUpGalleryImages
|
||||
}
|
||||
|
||||
$last = NULL;
|
||||
foreach( \IPS\Db::i()->select( '*', 'gallery_images', NULL, 'image_id ASC', array( $offset, 100 ) ) as $image )
|
||||
foreach( \IPS\Db::i()->select( '*', 'gallery_images', array( 'image_media=?', 0 ), 'image_id ASC', array( $offset, 100 ) ) as $image )
|
||||
{
|
||||
$data['did']++;
|
||||
|
||||
@@ -85,8 +85,19 @@ class _CleanUpGalleryImages
|
||||
|
||||
$update = array( 'image_data' => json_encode( $sizes ) );
|
||||
|
||||
/* If we have a medium but no large image, or a thumb but no small image, adapt as appropriate */
|
||||
/* If we have a medium but no large image, or a thumb but no small image, adapt as appropriate. Also if one image is mapped for
|
||||
multiple columns be sure we don't remove it if we still need it. */
|
||||
$keepMedium = FALSE;
|
||||
if( $image['image_medium_file_name'] == $image['image_masked_file_name'] )
|
||||
{
|
||||
$keepMedium = TRUE;
|
||||
}
|
||||
$keepThumb = FALSE;
|
||||
if( $image['image_thumb_file_name'] == $image['image_masked_file_name'] )
|
||||
{
|
||||
$keepThumb = TRUE;
|
||||
}
|
||||
|
||||
if( !$image['image_masked_file_name'] AND $image['image_medium_file_name'] )
|
||||
{
|
||||
$image['image_masked_file_name'] = $image['image_medium_file_name'];
|
||||
@@ -94,7 +105,6 @@ class _CleanUpGalleryImages
|
||||
$keepMedium = TRUE;
|
||||
}
|
||||
|
||||
$keepThumb = FALSE;
|
||||
if( !$image['image_small_file_name'] AND $image['image_thumb_file_name'] )
|
||||
{
|
||||
$image['image_small_file_name'] = $image['image_thumb_file_name'];
|
||||
|
||||
Reference in new issue
Block a user