Version 4.0.13.1
This commit is contained in:
1 parent
f9e857d255
commit
c6a86f0d9b
7517 files changed
+597400
-668041
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* @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.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
|
||||
$options = array(
|
||||
);
|
||||
|
||||
if( \IPS\Db::i()->checkForTable( 'gallery_albums_main' ) )
|
||||
{
|
||||
$_options = iterator_to_array( \IPS\Db::i()->select( 'album_id, album_name', 'gallery_albums_main', 'album_is_global=1 AND album_node_level=0' )->setKeyField('album_id')->setValueField('album_name') );
|
||||
|
||||
$options[] = new \IPS\Helpers\Form\Select( '42000_members_album', 0, TRUE, array( 'options' => $_options ) );
|
||||
$options[] = new \IPS\Helpers\Form\Checkbox( '42000_new_members_album', 1, FALSE );
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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;";
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?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_42000;
|
||||
|
||||
/* 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', 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()
|
||||
{
|
||||
$membersAlbum = $_SESSION['upgrade_options']['gallery']['42000']['members_album'];
|
||||
$newMembersAlbum = $_SESSION['upgrade_options']['gallery']['42000']['new_members_album'];
|
||||
|
||||
/* making a new one? */
|
||||
if ( !$newMembersAlbum )
|
||||
{
|
||||
/* Update array */
|
||||
$save = array( 'album_name' => 'Temp global album for root member albums',
|
||||
'album_name_seo' => 'temp-global-album-for-root-member-albums',
|
||||
'album_description' => "This is a temporary global album that holds the member albums that didn't have the proper parent album set. This album has NO permissions and is not visible from the public side, please move the albums in the proper location.",
|
||||
'album_parent_id' => 0,
|
||||
'album_is_public' => 0,
|
||||
'album_is_global' => 1,
|
||||
'album_g_container_only' => 0,
|
||||
'album_allow_comments' => 0,
|
||||
'album_g_approve_com' => 0,
|
||||
'album_g_approve_img' => 0,
|
||||
'album_sort_options' => serialize( array( 'key' => 'ASC', 'dir' => 'idate' ) ),
|
||||
'album_detail_default' => 0,
|
||||
'album_after_forum_id' => 0,
|
||||
'album_watermark' => 0 );
|
||||
|
||||
$membersAlbum = \IPS\Db::i()->insert( 'gallery_albums_main', $save );
|
||||
}
|
||||
|
||||
/* Now move the stuffs */
|
||||
if ( $membersAlbum )
|
||||
{
|
||||
/* Tag this as member album for later update */
|
||||
\IPS\Db::i()->update( 'gallery_albums_main', array( 'album_g_perms_thumbs' => 'member' ), 'album_id=' . intval( $membersAlbum ) );
|
||||
|
||||
/* Update albums and reset permissions/node tree.. */
|
||||
\IPS\Db::i()->update( 'gallery_albums_main', array( 'album_parent_id' => $membersAlbum ), 'album_parent_id=0 AND album_is_global=0' );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user