Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @subpackage Gallery
* @since 24 Oct 2014
* @version SVN_VERSION_NUMBER
@@ -31,7 +31,446 @@ class _Upgrade
*/
public function step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'gallery', 50000 );
/* Clean up albums from previous versions */
if ( \IPS\Db::i()->checkForTable( 'gallery_albums' ) AND \IPS\Db::i()->checkForTable( 'gallery_albums_main' ) )
{
\IPS\Db::i()->dropTable( 'gallery_albums' );
}
/* Do we need to fix ratings table? */
if ( \IPS\Db::i()->checkForColumn( 'gallery_ratings', 'id' ) )
{
\IPS\Db::i()->changeColumn( 'gallery_ratings', 'id', array(
'name' => 'rate_id',
'type' => 'bigint',
'length' => 20,
'allow_null' => false,
'default' => 0,
'auto_increment' => true
) );
\IPS\Db::i()->changeColumn( 'gallery_ratings', 'member_id', array(
'name' => 'rate_member_id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_ratings', 'rating_where', array(
'name' => 'rate_type',
'type' => 'varchar',
'length' => 32,
'allow_null' => false,
'default' => 'image'
) );
\IPS\Db::i()->changeColumn( 'gallery_ratings', 'rating_foreign_id', array(
'name' => 'rate_type_id',
'type' => 'bigint',
'length' => 20,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_ratings', 'rdate', array(
'name' => 'rate_date',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_ratings', 'rate', array(
'name' => 'rate_rate',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeIndex( 'gallery_ratings', 'rating_find_me', array(
'name' => 'rating_find_me',
'type' => 'key',
'columns' => array( 'rate_member_id', 'rate_type', 'rate_type_id' )
) );
}
/* Do we need to fix comments? */
if ( \IPS\Db::i()->checkForColumn( 'gallery_comments', 'pid' ) )
{
\IPS\Db::i()->update( 'gallery_comments', array( 'edit_time' => 0 ), array( 'edit_time=? OR edit_time IS NULL', '' ) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'pid', array(
'name' => 'comment_id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0,
'auto_increment' => true
) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'edit_time', array(
'name' => 'comment_edit_time',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'author_id', array(
'name' => 'comment_author_id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'author_name', array(
'name' => 'comment_author_name',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'ip_address', array(
'name' => 'comment_ip_address',
'type' => 'varchar',
'length' => 46,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'post_date', array(
'name' => 'comment_post_date',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'comment', array(
'name' => 'comment_text',
'type' => 'text',
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'approved', array(
'name' => 'comment_approved',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_comments', 'img_id', array(
'name' => 'comment_img_id',
'type' => 'bigint',
'length' => 20,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addIndex( 'gallery_comments', array(
'name' => 'comment_ip_address',
'type' => 'key',
'columns' => array( 'comment_ip_address' )
) );
\IPS\Db::i()->changeIndex( 'gallery_comments', 'img_id', array(
'name' => 'img_id',
'type' => 'key',
'columns' => array( 'comment_img_id', 'comment_post_date' )
) );
}
/* Do we need to update the images table? This isn't hard, but there are a lot of changes. */
if ( \IPS\Db::i()->checkForColumn( 'gallery_images', 'id' ) )
{
\IPS\Db::i()->changeColumn( 'gallery_images', 'id', array(
'name' => 'image_id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0,
'auto_increment' => true
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'member_id', array(
'name' => 'image_member_id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'gallery_images', array(
'name' => 'image_category_id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'img_album_id', array(
'name' => 'image_album_id',
'type' => 'bigint',
'length' => 20,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'caption', array(
'name' => 'image_caption',
'type' => 'varchar',
'length' => 255,
'allow_null' => false,
'default' => ''
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'description', array(
'name' => 'image_description',
'type' => 'text',
'length' => null,
'allow_null' => TRUE,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'directory', array(
'name' => 'image_directory',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'masked_file_name', array(
'name' => 'image_masked_file_name',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'file_name', array(
'name' => 'image_file_name',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'medium_file_name', array(
'name' => 'image_medium_file_name',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'original_file_name', array(
'name' => 'image_original_file_name',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'file_size', array(
'name' => 'image_file_size',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'file_type', array(
'name' => 'image_file_type',
'type' => 'varchar',
'length' => 50,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'approved', array(
'name' => 'image_approved',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'thumbnail', array(
'name' => 'image_thumbnail',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'views', array(
'name' => 'image_views',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'comments', array(
'name' => 'image_comments',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'comments_queued', array(
'name' => 'image_comments_queued',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'idate', array(
'name' => 'image_date',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'ratings_total', array(
'name' => 'image_ratings_total',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'ratings_count', array(
'name' => 'image_ratings_count',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'rating', array(
'name' => 'image_rating',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'lastcomment', array(
'name' => 'image_last_comment',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'pinned', array(
'name' => 'image_pinned',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'media', array(
'name' => 'image_media',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'credit_info', array(
'name' => 'image_credit_info',
'type' => 'text',
'length' => null,
'allow_null' => TRUE,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'copyright', array(
'name' => 'image_copyright',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'metadata', array(
'name' => 'image_metadata',
'type' => 'text',
'length' => null,
'allow_null' => TRUE,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'media_thumb', array(
'name' => 'image_media_thumb',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'caption_seo', array(
'name' => 'image_caption_seo',
'type' => 'varchar',
'length' => 255,
'allow_null' => false,
'default' => ''
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'image_feature_flag', array(
'name' => 'image_feature_flag',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->changeColumn( 'gallery_images', 'image_gps_show', array(
'name' => 'image_gps_show',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addIndex( 'gallery_images', array(
'name' => 'album_id',
'type' => 'key',
'columns' => array( 'image_album_id', 'image_approved', 'image_date' )
) );
\IPS\Db::i()->addIndex( 'gallery_images', array(
'name' => 'image_feature_flag',
'type' => 'key',
'columns' => array( 'image_feature_flag', 'image_date' )
) );
\IPS\Db::i()->addIndex( 'gallery_images', array(
'name' => 'gb_select',
'type' => 'key',
'columns' => array( 'image_approved', 'image_parent_permission', 'image_date' ),
'length' => array( null, 100, null )
) );
\IPS\Db::i()->addIndex( 'gallery_images', array(
'name' => 'lastcomment',
'type' => 'key',
'columns' => array( 'image_last_comment', 'image_date' )
) );
}
return TRUE;
}