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 30 Oct 2014
* @version SVN_VERSION_NUMBER
Whitespace-only changes.
@@ -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 18 Feb 2015
* @version SVN_VERSION_NUMBER
@@ -2,10 +2,10 @@
/**
* @brief 4.0.0 RC 5 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
* @subpackage Blog
* @package IPS Community Suite
* @subpackage Gallery
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
@@ -35,16 +35,5 @@
"binary": false
}
]
},
"3": {
"method": "update",
"params": [
"gallery_images",
"image_medium_file_name=NULL, image_small_file_name=NULL",
[
"image_media=?",
1
]
]
}
}
@@ -2,9 +2,9 @@
/**
* @brief 4.0.2 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 14 Apr 2015
* @version SVN_VERSION_NUMBER
@@ -2,10 +2,10 @@
/**
* @brief 4.0.5 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
* @subpackage Blog
* @package IPS Community Suite
* @subpackage Gallery
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
@@ -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 18 Feb 2015
* @version SVN_VERSION_NUMBER
@@ -2,9 +2,10 @@
/**
* @brief 4.0.9 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 19 Jun 2015
* @version SVN_VERSION_NUMBER
*/
@@ -2,9 +2,10 @@
/**
* @brief 4.0.12 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 27 Jul 2015
* @version SVN_VERSION_NUMBER
*/
@@ -258,8 +258,7 @@
]
}
},
"collation": "utf8mb4_unicode_ci",
"engine": "MyISAM"
"collation": "utf8mb4_unicode_ci"
}
]
},
@@ -2,9 +2,10 @@
/**
* @brief 4.1.0 Beta 1 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 25 Sep 2015
* @version SVN_VERSION_NUMBER
*/
@@ -57,10 +58,10 @@ class _Upgrade
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 'extra' => array( '_upgradeStep' => 2 ) ) );
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
return TRUE;
@@ -2,9 +2,9 @@
/**
* @brief 4.1.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 3 Feb 2015
* @version SVN_VERSION_NUMBER
@@ -0,0 +1,23 @@
{
"1": {
"method": "changeColumn",
"params": [
"gallery_images_uploads",
"upload_session",
{
"name": "upload_session",
"type": "VARCHAR",
"length": 128,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,23 @@
{
"1": {
"method": "addColumn",
"params": [
"gallery_images_uploads",
{
"allow_null": false,
"auto_increment": true,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 20,
"name": "upload_unique_id",
"type": "BIGINT",
"unsigned": true,
"values": [],
"zerofill": false,
"primary": true
}
]
}
}
@@ -0,0 +1,44 @@
{
"1": {
"method": "changeColumn",
"params": [
"gallery_albums",
"album_rating_aggregate",
{
"name": "album_rating_aggregate",
"type": "DECIMAL",
"length": 11,
"decimals": 1,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "changeColumn",
"params": [
"gallery_images",
"image_rating",
{
"name": "image_rating",
"type": "DECIMAL",
"length": 10,
"decimals": 1,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,133 @@
<?php
/**
* @brief 4.1.17 Beta 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @subpackage Gallery
* @since 24 Oct 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\gallery\setup\upg_101071;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.17 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Remove old columns if they exist
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$columns = array();
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_key' ) )
{
$columns[] = 'upload_key';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_album_id' ) )
{
$columns[] = 'upload_album_id';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_category_id' ) )
{
$columns[] = 'upload_category_id';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_file_directory' ) )
{
$columns[] = 'upload_file_directory';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_file_name_original' ) )
{
$columns[] = 'upload_file_name_original';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_file_size' ) )
{
$columns[] = 'upload_file_size';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_file_type' ) )
{
$columns[] = 'upload_file_type';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_medium_name' ) )
{
$columns[] = 'upload_medium_name';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_title' ) )
{
$columns[] = 'upload_title';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_description' ) )
{
$columns[] = 'upload_description';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_copyright' ) )
{
$columns[] = 'upload_copyright';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_exif' ) )
{
$columns[] = 'upload_exif';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_feature_flag' ) )
{
$columns[] = 'upload_feature_flag';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_geodata' ) )
{
$columns[] = 'upload_geodata';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_media_data' ) )
{
$columns[] = 'upload_media_data';
}
if( \IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_thumbnail' ) )
{
$columns[] = 'upload_thumbnail';
}
if( count( $columns ) )
{
\IPS\Db::i()->dropColumn( 'gallery_images_uploads', $columns );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Removing unused database columns";
}
}
@@ -0,0 +1,30 @@
{
"1": {
"method": "changeColumn",
"params": [
"gallery_albums",
"name_seo",
{
"name": "name_seo",
"type": "varchar",
"length": 255,
"allow_null": false,
"default": ""
}
]
},
"2": {
"method": "changeColumn",
"params": [
"gallery_categories",
"name_seo",
{
"name": "name_seo",
"type": "varchar",
"length": 255,
"allow_null": false,
"default": ""
}
]
}
}
@@ -1,5 +0,0 @@
<?php
$SQL = array();
$SQL[] = "ALTER TABLE gallery_albums CHANGE name_seo name_seo VARCHAR( 255 ) NOT NULL;";
$SQL[] = "ALTER TABLE gallery_categories CHANGE name_seo name_seo VARCHAR( 255 ) NOT NULL;";
@@ -1,38 +0,0 @@
<?php
/**
* @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.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Gallery
* @since 24 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\gallery\setup\upg_31003;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Upgrade Code
*/
class _Upgrade
{
/**
* Conversion from 3.0
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'gallery', 31003 );
return TRUE;
}
}
File diff suppressed because it is too large. Load diff
@@ -1,241 +0,0 @@
<?php
$SQL = array();
$DEAD_GROUP_FIELDS = "g_max_notes,g_gallery_cat_cover,g_can_search_gallery,g_ecard,g_rate,g_favorites,g_slideshows,g_move_own,g_zip_upload,g_multi_file_limit";
$DEAD_SETTINGS = "gallery_display_category,
gallery_display_album,
gallery_full_image,
gallery_display_block_row,
gallery_display_photostrip,
gallery_last_updated,
gallery_show_lastpic,
gallery_display_subcats,
gallery_images_per_row,
gallery_dir_images,
gallery_stats_where,
gallery_images_per_block,
gallery_last5_images,
gallery_random_images,
gallery_stats,
gallery_create_thumbnails,
gallery_thumbnail_link,
gallery_thumb_width,
gallery_thumb_height,
gallery_bandwidth_thumbs,
gallery_use_rate,
gallery_rate_display,
gallery_comment_order,
gallery_guests_ecards,
display_hotlinking,
gallery_use_ecards,
gallery_allow_usercopyright,
gallery_copyright_default,
gallery_notices_img,
gallery_notices_album,
gallery_notices_cat,
gallery_exif_sections,
gallery_iptc,
gallery_exif,
gallery_antileech_image,
gallery_allowed_domains";
$SQL[] = "CREATE TABLE gallery_albums_main (
album_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
album_parent_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
album_owner_id INT(8) UNSIGNED NOT NULL DEFAULT 0,
album_name VARCHAR(255) NOT NULL DEFAULT '',
album_name_seo VARCHAR(255) NOT NULL DEFAULT '',
album_description TEXT,
album_is_public INT(1) NOT NULL DEFAULT 0,
album_is_global INT(1) NOT NULL DEFAULT 0,
album_is_profile INT(1) NOT NULL DEFAULT 0,
album_count_imgs INT(10) UNSIGNED NOT NULL DEFAULT 0,
album_count_comments INT(10) UNSIGNED NOT NULL DEFAULT 0,
album_count_imgs_hidden INT(10) UNSIGNED NOT NULL DEFAULT 0,
album_count_comments_hidden INT(10) UNSIGNED NOT NULL DEFAULT 0,
album_cover_img_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
album_last_img_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
album_last_img_date INT(10) UNSIGNED NOT NULL DEFAULT 0,
album_sort_options TEXT,
album_allow_comments INT(1) UNSIGNED NOT NULL DEFAULT 0,
album_allow_rating INT(1) UNSIGNED NOT NULL DEFAULT 0,
album_cache MEDIUMTEXT,
album_node_level BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
album_node_left BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
album_node_right BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
album_g_approve_img INT(1) UNSIGNED NOT NULL DEFAULT 0,
album_g_approve_com INT(1) UNSIGNED NOT NULL DEFAULT 0,
album_g_bitwise INT(10) UNSIGNED NOT NULL DEFAULT 0,
album_g_rules MEDIUMTEXT,
album_g_container_only INT(1) UNSIGNED NOT NULL DEFAULT 0,
album_g_perms_thumbs TEXT,
album_g_perms_view TEXT,
album_g_perms_images TEXT,
album_g_perms_comments TEXT,
album_g_perms_moderate TEXT,
album_g_latest_imgs TEXT,
album_rating_aggregate INT(2) NOT NULL DEFAULT 0,
album_rating_total INT(10) UNSIGNED NOT NULL DEFAULT 0,
album_rating_count INT(10) NOT NULL DEFAULT 0,
album_after_forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
album_position INT(10) NOT NULL DEFAULT 0,
album_child_tree TEXT,
album_parent_tree TEXT,
album_can_tag INT(1) NOT NULL DEFAULT 1,
album_preset_tags TEXT,
PRIMARY KEY (album_id),
KEY album_parent_id (album_parent_id),
KEY album_owner_id (album_owner_id),
KEY album_last_img_date (album_last_img_date),
KEY album_has_a_perm (album_is_global, album_is_public),
KEY album_nodes (album_node_left, album_node_level, album_node_right ),
KEY album_count_imgs ( album_count_imgs ),
KEY album_child_lup (album_is_global, album_parent_id, album_node_level, album_node_left, album_cover_img_id, album_last_img_date)
);";
$SQL[] = "CREATE TABLE gallery_images_uploads (
upload_key CHAR(32) NOT NULL,
upload_session CHAR(32) NOT NULL,
upload_member_id INT(10) UNSIGNED NOT NULL default 0,
upload_album_id INT(10) UNSIGNED NOT NULL default 0,
upload_date INT(10) UNSIGNED NOT NULL default 0,
upload_file_directory VARCHAR(255) NOT NULL default '',
upload_file_orig_name VARCHAR(255) NOT NULL default '',
upload_file_name VARCHAR(255) NOT NULL default '',
upload_file_size INT(10) UNSIGNED NOT NULL default 0,
upload_file_type VARCHAR(50) NOT NULL default '',
upload_thumb_name VARCHAR(255) NOT NULL default '',
upload_medium_name VARCHAR(255) NOT NULL default '',
upload_title TEXT,
upload_description TEXT,
upload_copyright TEXT,
upload_exif TEXT,
upload_data TEXT,
upload_feature_flag INT(1) NOT NULL DEFAULT '0',
upload_geodata TEXT,
upload_media_data TEXT,
PRIMARY KEY (upload_key),
KEY upload_member_id (upload_member_id, upload_album_id),
KEY upload_date (upload_date),
KEY upload_session (upload_session)
);";
# CREATE NEW TABLES
if ( ! \IPS\Db::i()->checkForTable( 'core_geolocation_cache' ) )
{
$SQL[] = "CREATE TABLE core_geolocation_cache (
geocache_key VARCHAR(32) NOT NULL,
geocache_lat VARCHAR(100) NOT NULL,
geocache_lon VARCHAR(100) NOT NULL,
geocache_raw TEXT,
geocache_country VARCHAR(255) NOT NULL DEFAULT '',
geocache_district VARCHAR(255) NOT NULL DEFAULT '',
geocache_district2 VARCHAR(255) NOT NULL DEFAULT '',
geocache_locality VARCHAR(255) NOT NULL DEFAULT '',
geocache_type VARCHAR(255) NOT NULL DEFAULT '',
geocache_engine VARCHAR(255) NOT NULL DEFAULT '',
geocache_added INT(10) NOT NULL DEFAULT '0',
geocache_short TEXT,
PRIMARY KEY geocache_key (geocache_key),
KEY geo_lat_lon (geocache_lat, geocache_lon)
);";
}
if ( ! \IPS\Db::i()->checkForTable( 'gallery_albums_temp' ) )
{
$SQL[] = "CREATE TABLE gallery_albums_temp (
album_id INT(10),
album_g_perms_view TEXT
);";
}
$SQL[] = "ALTER TABLE gallery_images ADD image_media_data TEXT;";
$SQL[] = "alter table gallery_images CHANGE album_id img_album_id INT(10) UNSIGNED NOT NULL DEFAULT 0;";
$SQL[] = "alter table gallery_images CHANGE directory directory VARCHAR(255) NOT NULL DEFAULT '';";
$SQL[] = "ALTER TABLE gallery_images ADD image_data TEXT NOT NULL;";
$SQL[] = "ALTER TABLE gallery_images ADD image_privacy INT(1) NOT NULL DEFAULT 0;";
$SQL[] = "ALTER TABLE gallery_images ADD image_parent_permission VARCHAR(255) NOT NULL DEFAULT '';";
$SQL[] = "ALTER TABLE gallery_images ADD image_feature_flag INT(1) NOT NULL DEFAULT '0';";
$SQL[] = "ALTER TABLE gallery_images ADD image_gps_raw TEXT;";
$SQL[] = "ALTER TABLE gallery_images ADD image_gps_lat VARCHAR(255);";
$SQL[] = "ALTER TABLE gallery_images ADD image_gps_lon VARCHAR(255);";
$SQL[] = "ALTER TABLE gallery_images ADD image_gps_show INT(1) NOT NULL DEFAULT '0';";
$SQL[] = "ALTER TABLE gallery_images ADD image_loc_short TEXT;";
$SQL[] = "ALTER TABLE gallery_image_views ADD INDEX ( views_img );";
$SQL[] = "ALTER TABLE gallery_images ADD KEY im_select (approved, image_privacy, member_id, idate );";
$SQL[] = "ALTER TABLE gallery_images ADD KEY gb_select (approved, image_parent_permission);";
$SQL[] = "ALTER TABLE gallery_images ADD KEY image_feature_flag (image_feature_flag );";
$SQL[] = "ALTER TABLE gallery_images ADD KEY idate (idate);";
$SQL[] = "ALTER TABLE gallery_images ADD KEY lastcomment (lastcomment);";
$SQL[] = "ALTER TABLE gallery_images ADD KEY cmt_lookup (image_privacy, member_id, image_parent_permission, img_album_id, approved, lastcomment);";
$SQL[] = "ALTER TABLE gallery_images ADD KEY rnd_lookup (image_privacy, member_id, image_parent_permission, approved, idate );";
$SQL[] = "ALTER TABLE core_groups CHANGE g_max_diskspace g_max_diskspace INT(10) DEFAULT '0';";
$SQL[] = "ALTER TABLE core_groups CHANGE g_max_upload g_max_upload INT(10) DEFAULT '0';";
$SQL[] = "ALTER TABLE core_groups CHANGE g_max_transfer g_max_transfer INT(10) DEFAULT '0';";
$SQL[] = "ALTER TABLE core_groups CHANGE g_max_views g_max_views INT(10) DEFAULT '0';";
$SQL[] = "ALTER TABLE core_groups CHANGE g_album_limit g_album_limit INT(10) DEFAULT '0';";
$SQL[] = "ALTER TABLE core_groups CHANGE g_img_album_limit g_img_album_limit INT(10) DEFAULT '0';";
$SQL[] = "ALTER TABLE core_groups CHANGE g_movie_size g_movie_size INT(10) DEFAULT '0';";
$SQL[] = "UPDATE core_groups SET g_max_diskspace= -1 WHERE g_max_diskspace = 0;";
$SQL[] = "UPDATE core_groups SET g_max_upload= -1 WHERE g_max_upload = 0;";
$SQL[] = "UPDATE core_groups SET g_max_transfer= -1 WHERE g_max_transfer = 0;";
$SQL[] = "UPDATE core_groups SET g_max_views= -1 WHERE g_max_views = 0;";
$SQL[] = "UPDATE core_groups SET g_album_limit= -1 WHERE g_album_limit = 0;";
$SQL[] = "UPDATE core_groups SET g_img_album_limit= -1 WHERE g_img_album_limit = 0;";
$SQL[] = "UPDATE core_groups SET g_movie_size= -1 WHERE g_movie_size = 0;";
$SQL[] = "ALTER TABLE gallery_ratings CHANGE img_id rating_foreign_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0;";
$SQL[] = "ALTER TABLE gallery_ratings ADD rating_where VARCHAR(10) NOT NULL DEFAULT 'image';";
$SQL[] = "ALTER TABLE gallery_ratings DROP KEY member_id;";
$SQL[] = "ALTER TABLE gallery_ratings DROP KEY img_id;";
$SQL[] = "ALTER TABLE gallery_ratings ADD KEY rating_find_me (member_id, rating_foreign_id, rating_where);";
/* Delete settings */
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN ('" . implode( "','", explode( ",", str_replace( array("\n", "\r", " "), "", $DEAD_SETTINGS ) ) ) . "');";
/* Delete member group fields */
foreach( explode( ',', $DEAD_GROUP_FIELDS ) as $field )
{
$field = trim( $field );
if ( \IPS\Db::i()->checkForColumn( 'core_groups', $field ) )
{
$SQL[] = "ALTER TABLE core_groups DROP " . $field . ";";
}
}
$SQL[] = "INSERT INTO gallery_albums_main
(album_id, album_parent_id, album_owner_id, album_name, album_name_seo, album_description, album_is_public,
album_is_global, album_is_profile, album_count_imgs, album_count_comments, album_count_imgs_hidden,
album_count_comments_hidden, album_cover_img_id, album_last_img_id, album_last_img_date, album_sort_options,
album_allow_comments, album_cache, album_node_level, album_node_left, album_node_right, album_g_approve_img, album_g_approve_com,
album_g_bitwise, album_g_rules, album_g_container_only, album_g_perms_thumbs, album_g_perms_view,
album_g_perms_images, album_g_perms_comments, album_g_perms_moderate, album_child_tree, album_parent_tree, album_preset_tags, album_g_latest_imgs )
( SELECT a.id, a.parent, a.member_id, a.name, a.name_seo, a.description,( CASE WHEN a.friend_only THEN 2 WHEN a.public_album THEN 1 ELSE 0 END ),
0, a.profile_album, a.images, a.comments, a.mod_images,
a.mod_comments, 0, 0, 0, '',
1, CONCAT( 'cat-', a.category_id ), 0, 0, 0, 0, 0,
0, '', 0, '*', '*',
'*', '*', '', '', '', '', '' FROM " . \IPS\Db::i()->prefix . "gallery_albums a)";
$SQL[] = "INSERT INTO gallery_albums_main
(album_parent_id, album_owner_id, album_name, album_name_seo, album_description, album_is_public,
album_is_global, album_is_profile, album_count_imgs, album_count_comments, album_count_imgs_hidden,
album_count_comments_hidden, album_cover_img_id, album_last_img_id, album_last_img_date, album_sort_options,
album_allow_comments, album_cache, album_node_level, album_node_left, album_node_right, album_g_approve_img, album_g_approve_com,
album_g_bitwise, album_g_rules, album_g_container_only, album_g_perms_thumbs, album_g_perms_view,
album_g_perms_images, album_g_perms_comments, album_g_perms_moderate, album_child_tree, album_parent_tree, album_preset_tags, album_g_latest_imgs )
( SELECT 0, 0, c.name, c.name_seo, c.description, 1,
1, 0, c.images, c.comments, c.mod_images,
0, 0, 0, 0, '',
c.allow_comments, CONCAT( 'catid-', c.id ), 0, 0, 0, c.mod_images, c.mod_comments,
0, CONCAT( 'parent-cat-', c.parent ), c.category_only, p.perm_view, p.perm_2,
p.perm_3, p.perm_4, p.perm_5, '', '', '', '' FROM `" . \IPS\Db::i()->prefix . "gallery_categories` c, `" . \IPS\Db::i()->prefix . "core_permission_index` p WHERE p.perm_type='cat' AND p.perm_type_id=c.id AND p.app='gallery' ORDER BY c.id ASC )";
@@ -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,33 @@ class _Upgrade
*/
public function step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'gallery', 40000 );
\IPS\Db::i()->query( "INSERT INTO " . \IPS\Db::i()->prefix . "gallery_albums_main
(album_id, album_parent_id, album_owner_id, album_name, album_name_seo, album_description, album_is_public,
album_is_global, album_is_profile, album_count_imgs, album_count_comments, album_count_imgs_hidden,
album_count_comments_hidden, album_cover_img_id, album_last_img_id, album_last_img_date, album_sort_options,
album_allow_comments, album_cache, album_node_level, album_node_left, album_node_right, album_g_approve_img, album_g_approve_com,
album_g_bitwise, album_g_rules, album_g_container_only, album_g_perms_thumbs, album_g_perms_view,
album_g_perms_images, album_g_perms_comments, album_g_perms_moderate, album_child_tree, album_parent_tree, album_preset_tags, album_g_latest_imgs )
( SELECT a.id, a.parent, a.member_id, a.name, a.name_seo, a.description,( CASE WHEN a.friend_only THEN 2 WHEN a.public_album THEN 1 ELSE 0 END ),
0, a.profile_album, a.images, a.comments, a.mod_images,
a.mod_comments, 0, 0, 0, '',
1, CONCAT( 'cat-', a.category_id ), 0, 0, 0, 0, 0,
0, '', 0, '*', '*',
'*', '*', '', '', '', '', '' FROM " . \IPS\Db::i()->prefix . "gallery_albums a)" );
\IPS\Db::i()->query( "INSERT INTO " . \IPS\Db::i()->prefix . "gallery_albums_main
(album_parent_id, album_owner_id, album_name, album_name_seo, album_description, album_is_public,
album_is_global, album_is_profile, album_count_imgs, album_count_comments, album_count_imgs_hidden,
album_count_comments_hidden, album_cover_img_id, album_last_img_id, album_last_img_date, album_sort_options,
album_allow_comments, album_cache, album_node_level, album_node_left, album_node_right, album_g_approve_img, album_g_approve_com,
album_g_bitwise, album_g_rules, album_g_container_only, album_g_perms_thumbs, album_g_perms_view,
album_g_perms_images, album_g_perms_comments, album_g_perms_moderate, album_child_tree, album_parent_tree, album_preset_tags, album_g_latest_imgs )
( SELECT 0, 0, c.name, c.name_seo, c.description, 1,
1, 0, c.images, c.comments, c.mod_images,
0, 0, 0, 0, '',
c.allow_comments, CONCAT( 'catid-', c.id ), 0, 0, 0, c.mod_images, c.mod_comments,
0, CONCAT( 'parent-cat-', c.parent ), c.category_only, p.perm_view, p.perm_2,
p.perm_3, p.perm_4, p.perm_5, '', '', '', '' FROM `" . \IPS\Db::i()->prefix . "gallery_categories` c, `" . \IPS\Db::i()->prefix . "core_permission_index` p WHERE p.perm_type='cat' AND p.perm_type_id=c.id AND p.app='gallery' ORDER BY c.id ASC )" );
return TRUE;
}
@@ -1,16 +0,0 @@
<?php
$SQL = array();
if ( !\IPS\Db::i()->checkForColumn( 'gallery_images', 'image_gps_latlon' ) )
{
$SQL[] = "ALTER TABLE gallery_images ADD image_gps_latlon VARCHAR(255) DEFAULT '';";
}
if ( !\IPS\Db::i()->checkForTable( 'gallery_albums_temp' ) )
{
$SQL[] = "CREATE TABLE gallery_albums_temp (
album_id INT(10),
album_g_perms_view TEXT
);";
}
@@ -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,33 @@ class _Upgrade
*/
public function step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'gallery', 40007 );
if ( !\IPS\Db::i()->checkForColumn( 'gallery_images', 'image_gps_latlon' ) )
{
\IPS\Db::i()->addColumn( 'gallery_images', array( 'name' => 'image_gps_latlon', 'type' => 'VARCHAR', 'length' => 255, 'allow_null' => false, 'default' => '' ) );
}
if ( !\IPS\Db::i()->checkForTable( 'gallery_albums_temp' ) )
{
\IPS\Db::i()->createTable( array(
'name' => 'gallery_albums_temp',
'columns' => array(
array(
'name' => 'album_id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => '0'
),
array(
'name' => 'album_g_perms_view',
'type' => 'text',
'length' => null,
'allow_null' => true,
'default' => null
)
)
) );
}
return TRUE;
}
@@ -0,0 +1,121 @@
{
"1": {
"method": "dropTable",
"params": [
"gallery_form_fields"
]
},
"2": {
"method": "dropTable",
"params": [
"gallery_media_types"
]
},
"3": {
"method": "dropColumn",
"params": [
"gallery_albums_main",
"album_g_password"
]
},
"4": {
"method": "dropTable",
"params": [
"gallery_categories"
]
},
"5": {
"method": "dropTable",
"params": [
"gallery_image_views"
]
},
"6": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_position",
"type": "int",
"length": 10,
"allow_null": false,
"default": 0
}
]
},
"7": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_detail_default",
"type": "int",
"length": 1,
"unsigned": true,
"allow_null": false,
"default": 0
}
]
},
"8": {
"method": "update",
"params": [
"gallery_images",
"rating=ROUND(ratings_total\/ratings_count)",
"ratings_total>0 AND ratings_count>0 AND rating=0"
]
},
"9": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_watermark",
"type": "int",
"length": 1,
"unsigned": true,
"allow_null": false,
"default": 0
}
]
},
"10": {
"method": "addColumn",
"params": [
"gallery_images",
{
"name": "original_file_name",
"type": "varchar",
"length": 255,
"allow_null": true,
"default": null
}
]
},
"11": {
"method": "addColumn",
"params": [
"gallery_images_uploads",
{
"name": "upload_file_name_original",
"type": "varchar",
"length": 255,
"allow_null": true,
"default": null
}
]
},
"12": {
"method": "addColumn",
"params": [
"core_groups",
{
"name": "g_gallery_use",
"type": "tinyint",
"length": 1,
"allow_null": false,
"default": 1
}
]
}
}
@@ -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
@@ -24,31 +24,19 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
*/
class _Upgrade
{
/**
* Conversion from 3.0
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'gallery', 40009 );
return TRUE;
}
/**
* Convert albums
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
public function step1()
{
if( \IPS\Db::i()->checkForTable( 'gallery_subscriptions' ) )
{
foreach( \IPS\Db::i()->select( '*', 'gallery_subscriptions', "sub_type='album'" ) as $subscription )
{
$followId = md5( 'gallery;albums;' . $subscription['sub_toid'] . ';' . $subscription['sub_mid'] );
\IPS\Db::i()->insert( 'core_follow', array(
\IPS\Db::i()->replace( 'core_follow', array(
'follow_id' => $followId,
'follow_app' => 'gallery',
'follow_area' => 'albums',
@@ -71,7 +59,7 @@ class _Upgrade
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
public function step2()
{
$perCycle = 500;
$did = 0;
@@ -84,7 +72,7 @@ class _Upgrade
$did++;
$followId = md5( 'gallery;images;' . $subscription['sub_toid'] . ';' . $subscription['sub_mid'] );
\IPS\Db::i()->insert( 'core_follow', array(
\IPS\Db::i()->replace( 'core_follow', array(
'follow_id' => $followId,
'follow_app' => 'gallery',
'follow_area' => 'images',
@@ -114,7 +102,7 @@ class _Upgrade
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step4()
public function step3()
{
$perCycle = 500;
$did = 0;
@@ -126,7 +114,7 @@ class _Upgrade
{
$did++;
\IPS\Db::i()->insert( 'core_follow', array(
\IPS\Db::i()->replace( 'core_follow', array(
'follow_app' => 'gallery',
'follow_area' => 'images',
'follow_rel_id' => $favorite['img_id'],
@@ -0,0 +1,69 @@
{
"1": {
"method": "delete",
"params": [
"custom_bbcode",
"bbcode_tag='gallery' AND bbcode_php_plugin='gallery.php'"
]
},
"2": {
"method": "delete",
"params": [
"core_sys_conf_settings",
"conf_key='gallery_create_thumbs'"
]
},
"3": {
"method": "changeColumn",
"params": [
"gallery_comments",
"ip_address",
{
"name": "ip_address",
"type": "varchar",
"length": 46,
"allow_null": false,
"default": ""
}
]
},
"4": {
"method": "changeColumn",
"params": [
"gallery_images",
"image_notes",
{
"name": "image_notes",
"type": "text",
"length": null,
"allow_null": true,
"default": null
}
]
},
"5": {
"method": "dropColumn",
"params": [
"gallery_comments",
[
"append_edit",
"use_sig",
"use_emo",
"edit_name"
]
]
},
"6": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_position",
"type": "int",
"length": 10,
"allow_null": false,
"default": 0
}
]
}
}
@@ -1,17 +0,0 @@
<?php
$SQL = array();
$SQL[] = "DELETE FROM custom_bbcode WHERE bbcode_tag='gallery' AND bbcode_php_plugin='gallery.php';";
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key='gallery_create_thumbs';";
$SQL[] = "ALTER TABLE gallery_comments CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL;";
$SQL[] = "ALTER TABLE gallery_images CHANGE image_notes image_notes TEXT NULL DEFAULT NULL;"; // Strict mode complains...
/* Drop unused fields */
$SQL[] = "ALTER TABLE gallery_comments DROP append_edit, DROP use_sig, DROP use_emo, DROP edit_name;";
/* Got a field to add? ;O */
if ( !\IPS\Db::i()->checkForColumn( 'gallery_albums_main', 'album_position' ) )
{
$SQL[] = "ALTER TABLE gallery_albums_main ADD album_position INT(10) NOT NULL DEFAULT 0;";
}
@@ -1,38 +0,0 @@
<?php
/**
* @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.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Gallery
* @since 24 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\gallery\setup\upg_41000;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Upgrade Code
*/
class _Upgrade
{
/**
* Conversion from 3.0
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'gallery', 41000 );
return TRUE;
}
}
@@ -2,9 +2,10 @@
/**
* @brief Upgrader: Custom Upgrade Options
* @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
*/
@@ -0,0 +1,77 @@
{
"1": {
"method": "update",
"params": [
"gallery_albums_main",
{
"album_position": 10000000
},
"album_is_global=0"
]
},
"2": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_g_latest_imgs",
"type": "text",
"length": null,
"allow_null": true,
"default": null
}
]
},
"3": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_child_tree",
"type": "text",
"length": null,
"allow_null": true,
"default": null
}
]
},
"4": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_parent_tree",
"type": "text",
"length": null,
"allow_null": true,
"default": null
}
]
},
"5": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_can_tag",
"type": "int",
"length": 1,
"allow_null": false,
"default": 1
}
]
},
"6": {
"method": "addColumn",
"params": [
"gallery_albums_main",
{
"name": "album_preset_tags",
"type": "text",
"length": null,
"allow_null": true,
"default": null
}
]
}
}
@@ -1,24 +0,0 @@
<?php
$SQL = array();
$SQL[] = "UPDATE gallery_albums_main SET album_position=10000000 WHERE album_is_global=0;";
if ( ! \IPS\Db::i()->checkForColumn( 'gallery_albums_main', 'album_g_latest_imgs' ) )
{
$SQL[] = "ALTER TABLE gallery_albums_main ADD album_g_latest_imgs TEXT AFTER album_g_perms_moderate;";
}
if ( ! \IPS\Db::i()->checkForColumn( 'gallery_albums_main', 'album_child_tree' ) )
{
$SQL[] = "ALTER TABLE gallery_albums_main ADD album_child_tree TEXT;";
}
if ( ! \IPS\Db::i()->checkForColumn( 'gallery_albums_main', 'album_parent_tree' ) )
{
$SQL[] = "ALTER TABLE gallery_albums_main ADD album_parent_tree TEXT;";
}
if ( ! \IPS\Db::i()->checkForColumn( 'gallery_albums_main', 'album_can_tag' ) )
{
$SQL[] = "ALTER TABLE gallery_albums_main ADD album_can_tag INT(1) NOT NULL DEFAULT 1, ADD album_preset_tags TEXT;";
}
@@ -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
@@ -24,24 +24,12 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
*/
class _Upgrade
{
/**
* Conversion from 3.0
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'gallery', 42000 );
return TRUE;
}
/**
* Reset member's album category
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
public function step1()
{
$membersAlbum = $_SESSION['upgrade_options']['gallery']['42000']['members_album'];
$newMembersAlbum = $_SESSION['upgrade_options']['gallery']['42000']['new_members_album'];
@@ -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
@@ -0,0 +1,929 @@
{
"1": {
"method": "dropTable",
"params": [
"gallery_albums_temp"
]
},
"2": {
"method": "dropTable",
"params": [
"gallery_categories"
]
},
"3": {
"method": "dropTable",
"params": [
"gallery_ecardlog"
]
},
"4": {
"method": "dropTable",
"params": [
"gallery_favorites"
]
},
"5": {
"method": "dropTable",
"params": [
"gallery_subscriptions"
]
},
"6": {
"method": "dropTable",
"params": [
"gallery_upgrade_history"
]
},
"7": {
"method": "dropColumn",
"params": [
"gallery_images",
"category_id"
]
},
"8": {
"method": "dropIndex",
"params": [
"gallery_bandwidth",
"date"
]
},
"9": {
"method": "delete",
"params": [
"core_sys_conf_settings",
"conf_key IN ( 'gallery_display_category', 'gallery_display_album', 'gallery_default_view', 'gallery_enable_both_views', 'gallery_full_image', 'gallery_display_block_row', 'gallery_web_accessible', 'gallery_display_photostrip', 'gallery_last_updated', 'gallery_show_lastpic', 'gallery_display_subcats', 'gallery_dir_images', 'gallery_cache_albums', 'gallery_stats_where', 'gallery_images_per_block', 'gallery_last5_images', 'gallery_random_images', 'gallery_stats', 'gallery_feature_image', 'gallery_thumbnail_link', 'gallery_thumb_width', 'gallery_thumb_height', 'gallery_allowed_domains', 'gallery_antileech_image', 'gallery_use_rate', 'gallery_rate_display', 'gallery_bandwidth_thumbs', 'gallery_use_ecards', 'display_hotlinking', 'gallery_guests_ecards', 'gallery_comment_order', 'gallery_allow_usercopyright', 'gallery_copyright_default', 'gallery_exif', 'gallery_iptc', 'gallery_exif_sections', 'gallery_notices_cat', 'gallery_notices_album', 'gallery_notices_img', 'gallery_idx_num_col', 'gallery_idx_num_row', 'gallery_stats_col', 'gallery_stats_row', 'gallery_stats_cols', 'gallery_stats_rows' )"
]
},
"10": {
"method": "dropColumn",
"params": [
"gallery_comments",
"use_sig"
]
},
"11": {
"method": "dropColumn",
"params": [
"gallery_comments",
"use_emo"
]
},
"12": {
"method": "dropColumn",
"params": [
"gallery_comments",
"edit_name"
]
},
"13": {
"method": "dropColumn",
"params": [
"gallery_comments",
"append_edit"
]
},
"14": {
"method": "dropIndex",
"params": [
"gallery_comments",
"img_id_2"
]
},
"15": {
"method": "addColumn",
"params": [
"gallery_images_uploads",
{
"name": "upload_category_id",
"type": "int",
"length": 10,
"allow_null": false,
"default": 0
}
]
},
"16": {
"method": "dropIndex",
"params": [
"gallery_images",
"album_id"
]
},
"17": {
"method": "dropIndex",
"params": [
"gallery_images",
"approved"
]
},
"18": {
"method": "dropIndex",
"params": [
"gallery_images",
"album_id_2"
]
},
"19": {
"method": "dropIndex",
"params": [
"gallery_images",
"gb_select"
]
},
"20": {
"method": "dropIndex",
"params": [
"gallery_images",
"image_feature_flag"
]
},
"21": {
"method": "dropIndex",
"params": [
"gallery_images",
"lastcomment"
]
},
"22": {
"method": "dropIndex",
"params": [
"gallery_images",
"rnd_lookup"
]
},
"23": {
"method": "dropColumn",
"params": [
"core_groups",
"g_ecard"
]
},
"24": {
"method": "dropColumn",
"params": [
"core_groups",
"g_rate"
]
},
"25": {
"method": "dropColumn",
"params": [
"core_groups",
"g_slideshows"
]
},
"26": {
"method": "dropColumn",
"params": [
"core_groups",
"g_favorites"
]
},
"27": {
"method": "dropColumn",
"params": [
"core_groups",
"g_comment"
]
},
"28": {
"method": "dropColumn",
"params": [
"core_groups",
"g_move_on"
]
},
"29": {
"method": "dropColumn",
"params": [
"core_groups",
"g_mod_albums"
]
},
"30": {
"method": "dropColumn",
"params": [
"core_groups",
"g_album_private"
]
},
"31": {
"method": "dropColumn",
"params": [
"core_groups",
"g_gal_avatar"
]
},
"32": {
"method": "dropColumn",
"params": [
"core_groups",
"g_max_notes"
]
},
"33": {
"method": "dropColumn",
"params": [
"core_groups",
"g_gallery_cat_cover"
]
},
"34": {
"method": "addColumn",
"params": [
"core_groups",
{
"name": "g_create_albums_private",
"type": "tinyint",
"length": 1,
"allow_null": false,
"default": 0,
"unsigned": true
}
]
},
"35": {
"method": "addColumn",
"params": [
"core_groups",
{
"name": "g_create_albums_fo",
"type": "tinyint",
"length": 1,
"allow_null": false,
"default": 0,
"unsigned": true
}
]
},
"36": {
"method": "addColumn",
"params": [
"core_groups",
{
"name": "g_delete_own_albums",
"type": "tinyint",
"length": 1,
"allow_null": false,
"default": 0
}
]
},
"37": {
"method": "createTable",
"params": [
{
"name": "gallery_categories",
"columns": {
"category_id": {
"name": "category_id",
"type": "INT",
"length": "11",
"unsigned": false,
"zerofill": false,
"binary": false,
"allow_null": false,
"default": null,
"auto_increment": true
},
"category_parent_id": {
"name": "category_parent_id",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_name": {
"name": "category_name",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_name_seo": {
"name": "category_name_seo",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_description": {
"name": "category_description",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_count_imgs": {
"name": "category_count_imgs",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_count_comments": {
"name": "category_count_comments",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_count_imgs_hidden": {
"name": "category_count_imgs_hidden",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_count_comments_hidden": {
"name": "category_count_comments_hidden",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_cover_img_id": {
"name": "category_cover_img_id",
"type": "BIGINT",
"length": 20,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_last_img_id": {
"name": "category_last_img_id",
"type": "BIGINT",
"length": 20,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_last_img_date": {
"name": "category_last_img_date",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_type": {
"name": "category_type",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_sort_options": {
"name": "category_sort_options",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_allow_comments": {
"name": "category_allow_comments",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_allow_rating": {
"name": "category_allow_rating",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_approve_img": {
"name": "category_approve_img",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_approve_com": {
"name": "category_approve_com",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_rules": {
"name": "category_rules",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_rating_aggregate": {
"name": "category_rating_aggregate",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_rating_count": {
"name": "category_rating_count",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_rating_total": {
"name": "category_rating_total",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_after_forum_id": {
"name": "category_after_forum_id",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_watermark": {
"name": "category_watermark",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_position": {
"name": "category_position",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_can_tag": {
"name": "category_can_tag",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_preset_tags": {
"name": "category_preset_tags",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_public_albums": {
"name": "category_public_albums",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"category_nonpublic_albums": {
"name": "category_nonpublic_albums",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"columns": [
"category_id"
],
"length": [
null
]
},
"category_last_img_id": {
"type": "key",
"name": "category_last_img_id",
"columns": [
"category_last_img_id"
]
}
}
}
]
},
"38": {
"method": "createTable",
"params": [
{
"name": "gallery_moderators",
"columns": {
"mod_id": {
"name": "mod_id",
"type": "INT",
"length": "11",
"unsigned": false,
"zerofill": false,
"binary": false,
"allow_null": false,
"default": null,
"auto_increment": true
},
"mod_type": {
"name": "mod_type",
"type": "VARCHAR",
"length": 32,
"decimals": null,
"values": [],
"allow_null": false,
"default": "group",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_type_id": {
"name": "mod_type_id",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_type_name": {
"name": "mod_type_name",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_categories": {
"name": "mod_categories",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_can_approve": {
"name": "mod_can_approve",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_can_edit": {
"name": "mod_can_edit",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_can_hide": {
"name": "mod_can_hide",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_can_delete": {
"name": "mod_can_delete",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_can_approve_comments": {
"name": "mod_can_approve_comments",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_can_edit_comments": {
"name": "mod_can_edit_comments",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_can_delete_comments": {
"name": "mod_can_delete_comments",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_can_move": {
"name": "mod_can_move",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"mod_set_cover_image": {
"name": "mod_set_cover_image",
"type": "tinyint",
"length": 4,
"decimals": null,
"values": [],
"allow_null": false,
"default": 0,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"columns": [
"mod_id"
],
"length": [
null
]
},
"mod_type": {
"type": "key",
"name": "mod_type",
"columns": [
"mod_type",
"mod_type_id"
]
}
}
}
]
}
}
@@ -1,324 +0,0 @@
<?php
$SQL = array();
/* Clean up from previous versions */
if ( \IPS\Db::i()->checkForTable( 'gallery_albums' ) AND \IPS\Db::i()->checkForTable( 'gallery_albums_main' ) )
{
$SQL[] = "DROP TABLE gallery_albums;";
}
if ( \IPS\Db::i()->checkForTable( 'gallery_albums_temp' ) )
{
$SQL[] = "DROP TABLE gallery_albums_temp;";
}
if ( \IPS\Db::i()->checkForTable( 'gallery_categories' ) )
{
$SQL[] = "DROP TABLE gallery_categories;";
}
if ( \IPS\Db::i()->checkForTable( 'gallery_ecardlog' ) )
{
$SQL[] = "DROP TABLE gallery_ecardlog;";
}
if ( \IPS\Db::i()->checkForTable( 'gallery_favorites' ) )
{
$SQL[] = "DROP TABLE gallery_favorites;";
}
if ( \IPS\Db::i()->checkForTable( 'gallery_subscriptions' ) )
{
$SQL[] = "DROP TABLE gallery_subscriptions;";
}
if ( \IPS\Db::i()->checkForTable( 'gallery_upgrade_history' ) )
{
$SQL[] = "DROP TABLE gallery_upgrade_history;";
}
if ( \IPS\Db::i()->checkForColumn( 'gallery_images', 'category_id' ) )
{
$SQL[] = "ALTER TABLE gallery_images DROP category_id;";
}
/* This old index laying around? */
if( \IPS\Db::i()->checkForIndex( 'gallery_bandwidth', 'date' ) )
{
$SQL[] = "ALTER TABLE gallery_bandwidth DROP INDEX `date`;";
}
/* Old settings potentially still around */
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN ( 'gallery_display_category', 'gallery_display_album', 'gallery_default_view', 'gallery_enable_both_views',
'gallery_full_image', 'gallery_display_block_row', 'gallery_web_accessible', 'gallery_display_photostrip', 'gallery_last_updated', 'gallery_show_lastpic',
'gallery_display_subcats', 'gallery_dir_images', 'gallery_cache_albums', 'gallery_stats_where', 'gallery_images_per_block', 'gallery_last5_images',
'gallery_random_images', 'gallery_stats', 'gallery_feature_image', 'gallery_thumbnail_link', 'gallery_thumb_width', 'gallery_thumb_height', 'gallery_allowed_domains',
'gallery_antileech_image', 'gallery_use_rate', 'gallery_rate_display', 'gallery_bandwidth_thumbs', 'gallery_use_ecards', 'display_hotlinking', 'gallery_guests_ecards',
'gallery_comment_order', 'gallery_allow_usercopyright', 'gallery_copyright_default', 'gallery_exif', 'gallery_iptc', 'gallery_exif_sections', 'gallery_notices_cat',
'gallery_notices_album', 'gallery_notices_img', 'gallery_idx_num_col', 'gallery_idx_num_row', 'gallery_stats_col', 'gallery_stats_row', 'gallery_stats_cols', 'gallery_stats_rows' );";
/* Convert ratings table (easy) */
if ( \IPS\Db::i()->checkForColumn( 'gallery_ratings', 'id' ) )
{
$SQL[] = "ALTER TABLE gallery_ratings CHANGE id rate_id BIGINT NOT NULL AUTO_INCREMENT,
CHANGE member_id rate_member_id INT NOT NULL DEFAULT 0,
CHANGE rating_where rate_type VARCHAR(32) NOT NULL DEFAULT 'image',
CHANGE rating_foreign_id rate_type_id BIGINT NOT NULL DEFAULT 0,
CHANGE rdate rate_date INT NOT NULL DEFAULT 0,
CHANGE rate rate_rate INT NOT NULL DEFAULT 0,
DROP INDEX rating_find_me,
ADD INDEX rating_find_me ( rate_member_id, rate_type, rate_type_id );";
}
/* Convert comments table (easy) - we used to use ignore keyword to prevent warnings about truncating the edit time, but now we need to do this
the long way since alter ignore table has been removed */
if ( \IPS\Db::i()->checkForColumn( 'gallery_comments', 'pid' ) )
{
/* Note that we have to manually set the prefix for some of these because the auto-replacement regex doesn't look for them */
$SQL[] = "CREATE TABLE gallery_comments_temp LIKE " . \IPS\Db::i()->prefix . "gallery_comments;";
$SQL[] = "ALTER TABLE gallery_comments_temp CHANGE pid comment_id INT NOT NULL AUTO_INCREMENT,
CHANGE edit_time comment_edit_time INT NOT NULL DEFAULT 0,
CHANGE author_id comment_author_id INT NOT NULL DEFAULT 0,
CHANGE author_name comment_author_name VARCHAR(255) NULL DEFAULT NULL,
CHANGE ip_address comment_ip_address VARCHAR(46) NULL DEFAULT NULL,
CHANGE post_date comment_post_date INT NOT NULL DEFAULT 0,
CHANGE comment comment_text TEXT NULL DEFAULT NULL,
CHANGE approved comment_approved TINYINT NOT NULL DEFAULT 0,
CHANGE img_id comment_img_id BIGINT NOT NULL DEFAULT 0,
ADD INDEX (comment_ip_address),
DROP INDEX img_id,
ADD INDEX img_id (comment_img_id,comment_post_date);";
$SQL[] = "INSERT IGNORE INTO " . \IPS\Db::i()->prefix . "gallery_comments_temp SELECT * FROM " . \IPS\Db::i()->prefix . "gallery_comments;";
$SQL[] = "DROP TABLE gallery_comments;";
$SQL[] = "RENAME TABLE gallery_comments_temp TO gallery_comments;";
}
if ( \IPS\Db::i()->checkForColumn( 'gallery_comments', 'use_sig' ) )
{
$SQL[] = "ALTER TABLE gallery_comments DROP use_sig;";
}
if ( \IPS\Db::i()->checkForColumn( 'gallery_comments', 'use_emo' ) )
{
$SQL[] = "ALTER TABLE gallery_comments DROP use_emo;";
}
if ( \IPS\Db::i()->checkForColumn( 'gallery_comments', 'edit_name' ) )
{
$SQL[] = "ALTER TABLE gallery_comments DROP edit_name;";
}
if ( \IPS\Db::i()->checkForColumn( 'gallery_comments', 'append_edit' ) )
{
$SQL[] = "ALTER TABLE gallery_comments DROP append_edit;";
}
if ( \IPS\Db::i()->checkForIndex( 'gallery_comments', 'img_id_2' ) )
{
$SQL[] = "ALTER TABLE gallery_comments DROP INDEX img_id_2;";
}
/* Add new column to temp uploads table (easy) */
if ( !\IPS\Db::i()->checkForColumn( 'gallery_images_uploads', 'upload_category_id' ) )
{
$SQL[] = "ALTER TABLE gallery_images_uploads ADD upload_category_id INT NOT NULL DEFAULT 0 AFTER upload_album_id;";
}
/* And then convert images - not too difficult */
if ( \IPS\Db::i()->checkForIndex( 'gallery_images', 'album_id' ) )
{
$SQL[] = "ALTER TABLE gallery_images DROP INDEX album_id;";
}
if ( \IPS\Db::i()->checkForIndex( 'gallery_images', 'approved' ) )
{
$SQL[] = "ALTER TABLE gallery_images DROP INDEX approved;";
}
if ( \IPS\Db::i()->checkForIndex( 'gallery_images', 'album_id_2' ) )
{
$SQL[] = "ALTER TABLE gallery_images DROP INDEX album_id_2;";
}
if ( \IPS\Db::i()->checkForIndex( 'gallery_images', 'gb_select' ) )
{
$SQL[] = "ALTER TABLE gallery_images DROP INDEX gb_select;";
}
if ( \IPS\Db::i()->checkForIndex( 'gallery_images', 'image_feature_flag' ) )
{
$SQL[] = "ALTER TABLE gallery_images DROP INDEX image_feature_flag;";
}
if ( \IPS\Db::i()->checkForIndex( 'gallery_images', 'lastcomment' ) )
{
$SQL[] = "ALTER TABLE gallery_images DROP INDEX lastcomment;";
}
if ( \IPS\Db::i()->checkForIndex( 'gallery_images', 'rnd_lookup' ) )
{
$SQL[] = "ALTER TABLE gallery_images DROP INDEX rnd_lookup;";
}
if ( \IPS\Db::i()->checkForColumn( 'gallery_images', 'id' ) )
{
$SQL[] = "ALTER TABLE gallery_images CHANGE id image_id BIGINT NOT NULL AUTO_INCREMENT,
CHANGE member_id image_member_id INT NOT NULL DEFAULT 0,
ADD image_category_id INT NOT NULL DEFAULT 0 AFTER image_member_id,
CHANGE img_album_id image_album_id BIGINT NOT NULL DEFAULT 0,
CHANGE caption image_caption VARCHAR(255) NOT NULL,
CHANGE description image_description TEXT NULL DEFAULT NULL,
CHANGE directory image_directory VARCHAR(255) NULL DEFAULT NULL,
CHANGE masked_file_name image_masked_file_name VARCHAR(255) NULL DEFAULT NULL,
CHANGE file_name image_file_name VARCHAR(255) NULL DEFAULT NULL,
CHANGE medium_file_name image_medium_file_name VARCHAR(255) NULL DEFAULT NULL,
CHANGE original_file_name image_original_file_name VARCHAR(255) NULL DEFAULT NULL,
CHANGE file_size image_file_size INT NOT NULL DEFAULT 0,
CHANGE file_type image_file_type VARCHAR(50) NULL DEFAULT NULL,
CHANGE approved image_approved TINYINT NOT NULL DEFAULT 0,
CHANGE thumbnail image_thumbnail TINYINT NOT NULL DEFAULT 0,
CHANGE views image_views INT NOT NULL DEFAULT 0,
CHANGE comments image_comments INT NOT NULL DEFAULT 0,
CHANGE comments_queued image_comments_queued INT NOT NULL DEFAULT 0,
CHANGE idate image_date INT NOT NULL DEFAULT 0,
CHANGE ratings_total image_ratings_total INT NOT NULL DEFAULT 0,
CHANGE ratings_count image_ratings_count INT NOT NULL DEFAULT 0,
CHANGE rating image_rating INT NOT NULL DEFAULT 0,
CHANGE lastcomment image_last_comment INT NOT NULL DEFAULT 0,
CHANGE pinned image_pinned TINYINT NOT NULL DEFAULT 0,
CHANGE media image_media TINYINT NOT NULL DEFAULT 0,
CHANGE credit_info image_credit_info TEXT NULL DEFAULT NULL,
CHANGE copyright image_copyright VARCHAR(255) NULL DEFAULT NULL,
CHANGE metadata image_metadata TEXT NULL DEFAULT NULL,
CHANGE media_thumb image_media_thumb VARCHAR(255) NULL DEFAULT NULL,
CHANGE caption_seo image_caption_seo VARCHAR(255) NOT NULL,
CHANGE image_feature_flag image_feature_flag TINYINT NOT NULL DEFAULT 0,
CHANGE image_gps_show image_gps_show TINYINT NOT NULL DEFAULT 0,
ADD INDEX album_id (image_album_id, image_approved, image_date),
ADD INDEX image_feature_flag (image_feature_flag, image_date),
ADD INDEX gb_select (image_approved, image_parent_permission, image_date),
ADD INDEX lastcomment (image_last_comment, image_date);";
}
/* Add our new tables */
$SQL[] = "CREATE TABLE gallery_categories (
category_id int(11) NOT NULL AUTO_INCREMENT,
category_parent_id int(11) NOT NULL DEFAULT '0',
category_name varchar(255) DEFAULT NULL,
category_name_seo varchar(255) DEFAULT NULL,
category_description text,
category_count_imgs int(11) NOT NULL DEFAULT '0',
category_count_comments int(11) NOT NULL DEFAULT '0',
category_count_imgs_hidden int(11) NOT NULL DEFAULT '0',
category_count_comments_hidden int(11) NOT NULL DEFAULT '0',
category_cover_img_id bigint(20) NOT NULL DEFAULT '0',
category_last_img_id bigint(20) NOT NULL DEFAULT '0',
category_last_img_date int(11) NOT NULL DEFAULT '0',
category_type int(11) NOT NULL DEFAULT '0',
category_sort_options text,
category_allow_comments tinyint(4) NOT NULL DEFAULT '0',
category_allow_rating tinyint(4) NOT NULL DEFAULT '0',
category_approve_img tinyint(4) NOT NULL DEFAULT '0',
category_approve_com tinyint(4) NOT NULL DEFAULT '0',
category_rules mediumtext,
category_rating_aggregate int(11) NOT NULL DEFAULT '0',
category_rating_count int(11) NOT NULL DEFAULT '0',
category_rating_total int(11) NOT NULL DEFAULT '0',
category_after_forum_id int(11) NOT NULL DEFAULT '0',
category_watermark tinyint(4) NOT NULL DEFAULT '0',
category_position int(11) NOT NULL DEFAULT '0',
category_can_tag tinyint(4) NOT NULL DEFAULT '0',
category_preset_tags text,
category_public_albums int(11) NOT NULL DEFAULT '0',
category_nonpublic_albums int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (category_id),
KEY category_last_img_id (category_last_img_id)
);";
if( !\IPS\Db::i()->checkForTable( 'gallery_moderators' ) )
{
$SQL[] = "CREATE TABLE gallery_moderators (
mod_id int(11) NOT NULL AUTO_INCREMENT,
mod_type varchar(32) NOT NULL DEFAULT 'group',
mod_type_id int(11) NOT NULL DEFAULT '0',
mod_type_name varchar(255) DEFAULT NULL,
mod_categories text,
mod_can_approve tinyint(4) NOT NULL DEFAULT '0',
mod_can_edit tinyint(4) NOT NULL DEFAULT '0',
mod_can_hide tinyint(4) NOT NULL DEFAULT '0',
mod_can_delete tinyint(4) NOT NULL DEFAULT '0',
mod_can_approve_comments tinyint(4) NOT NULL DEFAULT '0',
mod_can_edit_comments tinyint(4) NOT NULL DEFAULT '0',
mod_can_delete_comments tinyint(4) NOT NULL DEFAULT '0',
mod_can_move tinyint(4) NOT NULL DEFAULT '0',
mod_set_cover_image tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (mod_id),
KEY mod_type (mod_type,mod_type_id)
);";
}
/* Groups table changes? */
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_ecard' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_ecard;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_rate' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_rate;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_slideshows' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_slideshows;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_favorites' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_favorites;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_comment' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_comment;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_move_own' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_move_own;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_mod_albums' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_mod_albums;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_album_private' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_album_private;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_gal_avatar' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_gal_avatar;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_max_notes' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_max_notes;";
}
if ( \IPS\Db::i()->checkForColumn( 'core_groups', 'g_gallery_cat_cover' ) )
{
$SQL[] = "ALTER TABLE core_groups DROP g_gallery_cat_cover;";
}
if ( !\IPS\Db::i()->checkForColumn( 'core_groups', 'g_create_albums_private' ) )
{
$SQL[] = "ALTER TABLE core_groups ADD g_create_albums_private TINYINT( 1 ) UNSIGNED default '0' NOT NULL,
ADD g_create_albums_fo TINYINT( 1 ) UNSIGNED default '0' NOT NULL,
ADD g_delete_own_albums TINYINT( 1 ) NOT NULL DEFAULT '0';";
}
/* Albums handled by the upgrader script */
@@ -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;
}
@@ -0,0 +1,22 @@
{
"1": {
"method": "update",
"params": [
"core_reputation_index",
{
"type": "image_id"
},
"app='gallery' and type='id'"
]
},
"2": {
"method": "update",
"params": [
"core_reputation_index",
{
"type": "comment_id"
},
"app='gallery' and type='pid'"
]
}
}
@@ -1,5 +0,0 @@
<?php
$SQL = array();
$SQL[] = "UPDATE core_reputation_index SET type='image_id' where app='gallery' and type='id';";
$SQL[] = "UPDATE core_reputation_index SET type='comment_id' where app='gallery' and type='pid';";
@@ -1,38 +0,0 @@
<?php
/**
* @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.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Gallery
* @since 24 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\gallery\setup\upg_50001;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Upgrade Code
*/
class _Upgrade
{
/**
* Conversion from 3.0
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'gallery', 50001 );
return TRUE;
}
}
@@ -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 04 Mar 2014
* @version SVN_VERSION_NUMBER
@@ -107,12 +107,12 @@ class _Upgrade
*/
public function step2()
{
\IPS\Db::i()->insert( 'core_ratings',
\IPS\Db::i()->select( "NULL, 'IPS\\gallery\\Image', rate_type_id, rate_member_id, rate_rate, ''", 'gallery_ratings', array( 'rate_type=?', 'image' ), NULL, NULL, array( 'rate_type', 'rate_type_id', 'rate_member_id' ) )
\IPS\Db::i()->replace( 'core_ratings',
\IPS\Db::i()->select( "NULL, 'IPS\\gallery\\Image', rate_type_id, rate_member_id, rate_rate, ''", 'gallery_ratings', array( 'rate_type=?', 'image' ) )
);
\IPS\Db::i()->insert( 'core_ratings',
\IPS\Db::i()->select( "NULL, 'IPS\\gallery\\Album', rate_type_id, rate_member_id, rate_rate, ''", 'gallery_ratings', array( 'rate_type=?', 'album' ), NULL, NULL, array( 'rate_type', 'rate_type_id', 'rate_member_id' ) )
\IPS\Db::i()->replace( 'core_ratings',
\IPS\Db::i()->select( "NULL, 'IPS\\gallery\\Album', rate_type_id, rate_member_id, rate_rate, ''", 'gallery_ratings', array( 'rate_type=?', 'album' ) )
);
\IPS\Db::i()->dropTable( 'gallery_ratings', TRUE );
@@ -182,7 +182,7 @@ class _Upgrade
$config = \IPS\File::getClass( 'gallery_Images' );
$url = $config->configuration['url'];
$prefix = $row['image_directory'] . '/';
$prefix = $row['image_directory'] ? $row['image_directory'] . '/' : '';
$hasSmall = FALSE;
if( file_exists( $settings['gallery_images_path'] . '/' . $row['image_directory'] . '/' . 'sml_' . $row['image_masked_file_name'] ) )
@@ -236,7 +236,7 @@ class _Upgrade
if( $row['image_metadata'] )
{
$imageUpdate['image_metadata'] = json_encode( unserialize( $row['image_metadata'] ) );
$imageUpdate['image_metadata'] = json_encode( array_map( 'trim', unserialize( $row['image_metadata'] ) ) );
}
/* Simply rebuild the image size values */
@@ -278,7 +278,7 @@ class _Upgrade
}
}
$imageUpdate['image_metadata'] = json_encode( $notes );
$imageUpdate['image_notes'] = json_encode( $notes );
}
\IPS\Db::i()->update( 'gallery_images', $imageUpdate, array( 'image_id=?', $row['image_id'] ) );
@@ -449,10 +449,10 @@ class _Upgrade
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'gallery', 'extra' => array( '_upgradeStep' => 6 ) ) );
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'gallery', 'extra' => array( '_upgradeStep' => 6 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
return TRUE;