Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

@@ -74,21 +74,6 @@
}
]
},
"6": {
"method": "addColumn",
"params": [
"core_groups",
{
"name": "g_delete_own_albums",
"type": "TINYINT",
"length": 1,
"null": false,
"default": 0,
"comment": "Can delete own albums?",
"unsigned": true
}
]
},
"7": {
"method": "addColumn",
"params": [
@@ -0,0 +1,12 @@
{
"1": {
"method": "delete",
"params": [
"core_sys_lang_words",
[
"word_key=?",
"gallery_use_square_thumbnails_desc"
]
]
}
}
@@ -0,0 +1,26 @@
{
"1": {
"method": "update",
"params": [
"gallery_categories",
{
"category_sort_options": "album_last_img_date"
},
[
"category_sort_options IS NULL"
]
]
},
"2": {
"method": "update",
"params": [
"gallery_categories",
{
"category_sort_options_img": "updated"
},
[
"category_sort_options_img IS NULL"
]
]
}
}
@@ -0,0 +1,96 @@
<?php
/**
* @brief 4.3.4 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Gallery
* @since 24 May 2018
*/
namespace IPS\gallery\setup\upg_103021;
/* 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.3.4 Upgrade Code
*/
class _Upgrade
{
/**
* Get rid of the duplicate setting
*
* @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()
{
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_groups' ), 'IPS\Member\Group' ) as $group )
{
if( $group->g_delete_own_albums AND $group->g_delete_own_posts != 1 )
{
$classes = explode( ',', $group->g_delete_own_posts );
if( !in_array( 'IPS\gallery\Album\Item', $classes ) )
{
$classes[] = 'IPS\gallery\Album\Item';
\IPS\Db::i()->update( 'core_groups', array( 'g_delete_own_posts' => implode( ',', $classes ) ), array( 'g_id=?', $group->g_id ) );
}
}
elseif( !$group->g_delete_own_albums AND $group->g_delete_own_posts == 1 )
{
$contentClasses = array( 'IPS\core\Messenger\Conversation' );
foreach ( \IPS\Application::allExtensions( 'core', 'ContentRouter', $group, NULL, NULL, FALSE ) as $extension )
{
/* It's possible when upgrading from 3.x that the modules table isn't populated, some extensions (clubs)
* Will throw an exception in this situation
*/
try
{
$class = new $extension;
}
catch( \OutOfRangeException $e )
{
continue;
}
foreach ( $class->classes as $class )
{
if ( isset( $class::$databaseColumnMap['author'] ) AND $class != 'IPS\gallery\Album\Item' )
{
$contentClasses[] = $class;
}
}
}
\IPS\Db::i()->update( 'core_groups', array( 'g_delete_own_posts' => implode( ',', $contentClasses ) ), array( 'g_id=?', $group->g_id ) );
}
elseif( !$group->g_delete_own_albums AND $group->g_delete_own_posts != 1 AND in_array( 'IPS\gallery\Album\Item', explode( ',', $group->g_delete_own_posts ) ) )
{
$classes = array_filter( explode( ',', $group->g_delete_own_posts ), function( $className ) {
return $className != 'IPS\gallery\Album\Item';
} );
\IPS\Db::i()->update( 'core_groups', array( 'g_delete_own_posts' => implode( ',', $classes ) ), array( 'g_id=?', $group->g_id ) );
}
}
\IPS\Db::i()->dropColumn( 'core_groups', 'g_delete_own_albums' );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Removing duplicate setting";
}
}
@@ -0,0 +1,23 @@
{
"1": {
"method": "changeColumn",
"params": [
"gallery_images",
"image_description",
{
"name": "image_description",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,14 @@
{
"1": {
"method": "update",
"params": [
"gallery_albums",
{
"album_sort_options": "updated"
},
[
"album_sort_options IS NULL"
]
]
}
}
@@ -0,0 +1,13 @@
{
"1": {
"method": "update",
"params": [
"gallery_images",
"image_last_comment=image_date",
[
"image_last_comment=?",
0
]
]
}
}