Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -54,7 +54,7 @@
|
||||
"length": 10,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "IP.Downloads Speed Throttling kb",
|
||||
"comment": "Downloads Speed Throttling kb",
|
||||
"unsigned": true
|
||||
}
|
||||
]
|
||||
@@ -83,7 +83,7 @@
|
||||
"type": "TEXT",
|
||||
"null": false,
|
||||
"default": "{}",
|
||||
"comment": "IP.Downloads Restrictions"
|
||||
"comment": "Downloads Restrictions"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -127,7 +127,7 @@
|
||||
"length": 1,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Blocked from submitting IP.Downloads files?",
|
||||
"comment": "Blocked from submitting Downloads files?",
|
||||
"unsigned": 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 Downloads
|
||||
* @since 30 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
/**
|
||||
* @brief 4.0.0 Alpha 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 Downloads
|
||||
* @since 25 Mar 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 RC 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 Downloads
|
||||
* @since 3 Feb 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 RC 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 Downloads
|
||||
* @since 5 Feb 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 RC 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 Downloads
|
||||
* @since 9 Feb 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
/**
|
||||
* @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 Downloads
|
||||
* @since 15 Jan 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 Downloads
|
||||
* @since 5 May 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 Downloads
|
||||
* @since 5 May 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 Downloads
|
||||
* @since 19 Jun 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
/**
|
||||
* @brief 4.0.13 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 Downloads
|
||||
* @since 31 Jul 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -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 Downloads
|
||||
* @since 23 Sep 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -30,8 +31,22 @@ class _Upgrade
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'downloads_reviews', 'review_date is null' ) as $review )
|
||||
$perCycle = 1000;
|
||||
$did = 0;
|
||||
$limit = intval( \IPS\Request::i()->extra );
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'downloads_reviews', 'review_date is null', 'review_id ASC', array( $limit, $perCycle ) ) as $review )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
try
|
||||
{
|
||||
$member = \IPS\Member::load( $review['review_mid'] );
|
||||
@@ -40,9 +55,17 @@ class _Upgrade
|
||||
}
|
||||
catch( \Exception $e ){}
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
|
||||
if ( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $_SESSION['_step1Count'] );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +75,14 @@ class _Upgrade
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Adjusting empty download reviews";
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if( !isset( $_SESSION['_step1Count'] ) )
|
||||
{
|
||||
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'downloads_reviews', 'review_date is null' )->first();
|
||||
}
|
||||
|
||||
return "Adjusting empty download reviews (Upgraded so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,9 +92,12 @@ class _Upgrade
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
$prefix = \IPS\Db::i()->prefix;
|
||||
|
||||
\IPS\Db::i()->update( 'downloads_categories', array( 'cforum_id' => 0 ), 'cforum_id NOT IN( SELECT id FROM ' . $prefix . 'forums_forums )' );
|
||||
if ( \IPS\Application::appIsEnabled( 'forums' ) )
|
||||
{
|
||||
$prefix = \IPS\Db::i()->prefix;
|
||||
|
||||
\IPS\Db::i()->update( 'downloads_categories', array( 'cforum_id' => 0 ), 'cforum_id NOT IN( SELECT id FROM ' . $prefix . 'forums_forums )' );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_size",
|
||||
{
|
||||
"name": "file_size",
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_downloads",
|
||||
"dua",
|
||||
{
|
||||
"name": "dua",
|
||||
"type": "TEXT",
|
||||
"length": 0,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+14
-9
@@ -1,16 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @brief 4.1.8 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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @package IPS Community Suite
|
||||
* @since 11 Jan 2016
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_23001;
|
||||
namespace IPS\downloads\setup\upg_101024;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
@@ -20,18 +19,24 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
* 4.1.8 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
* Download category sort options are stored with database prefix incorrectly.
|
||||
*
|
||||
* @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( 'downloads', 23001 );
|
||||
foreach( \IPS\Db::i()->select( '*', 'downloads_categories' ) as $cat )
|
||||
{
|
||||
if ( mb_substr( $cat['csortorder'], 0, 5 ) === 'file_' )
|
||||
{
|
||||
\IPS\Db::i()->update( 'downloads_categories', array( 'csortorder' => mb_substr( $cat['csortorder'], 5 ) ), array( 'cid=?', $cat['cid'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"downloads_categories",
|
||||
{
|
||||
"csortorder": "date"
|
||||
},
|
||||
[
|
||||
"csortorder=?",
|
||||
"submitted"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_attachments_map",
|
||||
{
|
||||
"id3": "desc"
|
||||
},
|
||||
[
|
||||
"location_key=?",
|
||||
"downloads_Downloads"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files_records",
|
||||
"record_size",
|
||||
{
|
||||
"name": "record_size",
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_rating",
|
||||
{
|
||||
"name": "file_rating",
|
||||
"type": "DECIMAL",
|
||||
"length": 10,
|
||||
"decimals": 1,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+20
-8
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @brief 4.1.17 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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @since 15 Nov 2016
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_21001;
|
||||
namespace IPS\downloads\setup\upg_101071;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
@@ -20,19 +20,31 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
* 4.1.17 Beta 1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
* Remove duplicate strings which are now located in the core application
|
||||
*
|
||||
* @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( 'downloads', 21001 );
|
||||
|
||||
$stringsToRemove = array(
|
||||
'ctags_predefined_desc',
|
||||
'ctags_predefined_unlimited',
|
||||
'ctags_predefined',
|
||||
'ctags_noprefixes',
|
||||
'ctags_disabled'
|
||||
);
|
||||
|
||||
\IPS\Db::i()->delete( 'core_sys_lang_words', \IPS\Db::i()->in( 'word_key', $stringsToRemove ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// You can create as many additional methods (step2, step3, etc.) as is necessary.
|
||||
// Each step will be executed in a new HTTP request
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Upgrader: Custom Post Upgrade Message
|
||||
* @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
|
||||
* @since 28 Nov 2016
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
$path = \IPS\ROOT_PATH . '/applications/downloads/extensions/core/ContentRouter/downloads.php';
|
||||
|
||||
/* Windows is case-insensitive, so we don't need to check in that case (no pun intended) */
|
||||
if( \file_exists( $path ) AND !\unlink( $path ) )
|
||||
{
|
||||
$message = \IPS\Theme::i()->getTemplate( 'global' )->block( NULL, "The following file could not be deleted automatically and should be manually removed:<br><pre>{$path}</pre>" );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"file_cost": ""
|
||||
},
|
||||
[
|
||||
"file_cost=?",
|
||||
"0"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.18.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 Downloads
|
||||
* @since 20 Jan 2017
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_101088;
|
||||
|
||||
/* 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.18.1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Convert custom file field database schemas if needed
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$queries = array();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'downloads_cfields', array( "cf_type IN( 'Editor','Codemirror','TextArea','Upload','Address','Select' )" ) ) as $field )
|
||||
{
|
||||
\IPS\Db::i()->returnQuery = TRUE;
|
||||
|
||||
if( \IPS\Db::i()->checkForIndex( 'downloads_ccontent', 'field_' . $field['f_id'] ) )
|
||||
{
|
||||
$queries[] = array( 'table' => 'downloads_ccontent', 'query' => \IPS\Db::i()->dropIndex( 'downloads_ccontent', 'field_' . $field['f_id'] ) );
|
||||
}
|
||||
|
||||
$queries[] = array( 'table' => 'downloads_ccontent', 'query' => \IPS\Db::i()->changeColumn( 'downloads_ccontent', 'field_' . $field['cf_id'], array( 'name' => 'field_' . $field['cf_id'], 'type' => 'MEDIUMTEXT' ) ) );
|
||||
$queries[] = array( 'table' => 'downloads_ccontent', 'query' => \IPS\Db::i()->addIndex( 'downloads_ccontent', array( 'type' => 'fulltext', 'name' => 'field_' . $field['f_id'], 'columns' => array( 'field_' . $field['f_id'] ) ) ) );
|
||||
\IPS\Db::i()->returnQuery = FALSE;
|
||||
}
|
||||
|
||||
if( count( $queries ) )
|
||||
{
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'downloads', '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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Adjusting custom field definitions";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "dropIndex",
|
||||
"params": [
|
||||
"downloads_categories",
|
||||
"cposition"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"downloads_categories",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "position_order",
|
||||
"columns": [
|
||||
"cparent",
|
||||
"cposition"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"downloads_downloads",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "dmid",
|
||||
"columns": [
|
||||
"dmid"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_comments",
|
||||
"comment_date",
|
||||
{
|
||||
"name": "comment_date",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_comments",
|
||||
"comment_edit_time",
|
||||
{
|
||||
"name": "comment_edit_time",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"downloads_favorites",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "fmid",
|
||||
"columns": [
|
||||
"fmid"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_favorites",
|
||||
"fupdated",
|
||||
{
|
||||
"name": "fupdated",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_filebackup",
|
||||
"b_backup",
|
||||
{
|
||||
"name": "b_backup",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_filebackup",
|
||||
"b_updated",
|
||||
{
|
||||
"name": "b_updated",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_submitted",
|
||||
{
|
||||
"name": "file_submitted",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"11": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_updated",
|
||||
{
|
||||
"name": "file_updated",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"12": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_approvedon",
|
||||
{
|
||||
"name": "file_approvedon",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"13": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"downloads_sessions",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "dsess_start",
|
||||
"columns": [
|
||||
"dsess_start"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"14": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_sessions",
|
||||
"dsess_start",
|
||||
{
|
||||
"name": "dsess_start",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"15": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_sessions",
|
||||
"dsess_end",
|
||||
{
|
||||
"name": "dsess_end",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"16": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_temp_records",
|
||||
"record_added",
|
||||
{
|
||||
"name": "record_added",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"17": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"downloads_urls",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "url_expires",
|
||||
"columns": [
|
||||
"url_expires"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"18": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_urls",
|
||||
"url_created",
|
||||
{
|
||||
"name": "url_created",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"19": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_urls",
|
||||
"url_expires",
|
||||
{
|
||||
"name": "url_expires",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"20": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key='idm_guest_report'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_categories DROP INDEX cposition, ADD INDEX position_order ( cparent , cposition );";
|
||||
$SQL[] = "ALTER TABLE downloads_downloads ADD INDEX ( dmid );";
|
||||
$SQL[] = "ALTER TABLE downloads_comments CHANGE comment_date comment_date INT NOT NULL DEFAULT '0', CHANGE comment_edit_time comment_edit_time INT NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_favorites ADD INDEX ( fmid ), CHANGE fupdated fupdated INT NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_filebackup CHANGE b_backup b_backup INT NOT NULL DEFAULT '0', CHANGE b_updated b_updated INT NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_files CHANGE file_submitted file_submitted INT NOT NULL DEFAULT '0', file_updated file_updated INT NOT NULL DEFAULT '0', file_approvedon file_approvedon INT NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_sessions ADD INDEX ( dsess_start ), CHANGE dsess_start dsess_start INT NOT NULL DEFAULT '0', CHANGE dsess_end dsess_end INT NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_temp_records CHANGE record_added record_added INT NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_urls ADD INDEX ( url_expires ), CHANGE url_created url_created INT NOT NULL DEFAULT '0', CHANGE url_expires url_expires INT NOT NULL DEFAULT '0'";
|
||||
|
||||
$SQL[] = "delete FROM core_sys_conf_settings WHERE conf_key='idm_guest_report';";
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_cost",
|
||||
"type": "float",
|
||||
"length": null,
|
||||
"allow_null": false,
|
||||
"default": "0.00"
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "idm_bypass_paid",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "idm_add_paid",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key='idm_guest_report'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_files ADD file_cost FLOAT NOT NULL DEFAULT '0.00';";
|
||||
$SQL[] = "ALTER TABLE core_groups ADD idm_bypass_paid TINYINT( 1 ) NOT NULL DEFAULT 0, ADD idm_add_paid TINYINT( 1 ) NOT NULL DEFAULT 0;";
|
||||
$SQL[] = "delete FROM core_sys_conf_settings WHERE conf_key='idm_guest_report';";
|
||||
@@ -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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_22000;
|
||||
|
||||
/* 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( 'downloads', 22000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_nexus",
|
||||
"type": "text",
|
||||
"length": null,
|
||||
"allow_null": false,
|
||||
"default": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_files ADD file_nexus TEXT NOT NULL DEFAULT '';";
|
||||
@@ -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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_22006;
|
||||
|
||||
/* 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( 'downloads', 22006 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"downloads_ip2ext"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"downloads_downloads",
|
||||
"dcountry"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_cfields",
|
||||
{
|
||||
"name": "cf_format",
|
||||
"type": "text",
|
||||
"length": null,
|
||||
"allow_null": true,
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_comments",
|
||||
{
|
||||
"name": "comment_author",
|
||||
"type": "varchar",
|
||||
"length": 255,
|
||||
"allow_null": true,
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "idm_report_files",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "idm_view_downloads",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"idm_report_files": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_mods",
|
||||
{
|
||||
"name": "modchangeauthor",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_open",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "file_open",
|
||||
"columns": [
|
||||
"file_open",
|
||||
"file_cat",
|
||||
"file_submitted"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_version",
|
||||
"type": "varchar",
|
||||
"length": 32,
|
||||
"allow_null": true,
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"11": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_changelog",
|
||||
"type": "text",
|
||||
"length": null,
|
||||
"allow_null": true,
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"12": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_filebackup",
|
||||
{
|
||||
"name": "b_version",
|
||||
"type": "varchar",
|
||||
"length": 32,
|
||||
"allow_null": true,
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"13": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_filebackup",
|
||||
{
|
||||
"name": "b_changelog",
|
||||
"type": "text",
|
||||
"length": null,
|
||||
"allow_null": true,
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"14": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files_records",
|
||||
{
|
||||
"name": "record_default",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"15": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key IN('idm_allow_emaillinks', 'idm_comment_display', 'idm_guest_report')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "DROP TABLE downloads_ip2ext;";
|
||||
$SQL[] = "ALTER TABLE downloads_downloads DROP dcountry;";
|
||||
$SQL[] = "ALTER TABLE downloads_cfields ADD cf_format TEXT NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE downloads_comments ADD comment_author VARCHAR( 255 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE core_groups ADD idm_report_files TINYINT( 1 ) NOT NULL DEFAULT '0', ADD idm_view_downloads TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "UPDATE core_groups SET idm_report_files=1;";
|
||||
$SQL[] = "ALTER TABLE downloads_mods ADD modchangeauthor TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_files DROP INDEX file_open , ADD INDEX file_open ( file_open , file_cat , file_submitted ), ADD file_version VARCHAR( 32 ) NULL DEFAULT NULL , ADD file_changelog TEXT NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE downloads_filebackup ADD b_version VARCHAR( 32 ) NULL DEFAULT NULL , ADD b_changelog TEXT NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE downloads_files_records ADD record_default TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
|
||||
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN('idm_allow_emaillinks', 'idm_comment_display', 'idm_guest_report');";
|
||||
@@ -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 Downloads
|
||||
* @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( 'downloads', 23000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert follows
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$members = array();
|
||||
|
||||
@@ -112,7 +100,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()
|
||||
{
|
||||
if( \IPS\Db::i()->checkForColumn( 'downloads_files', 'file_meta' ) )
|
||||
{
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "idm_bypass_revision",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"downloads_temp_records",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "record_added",
|
||||
"columns": [
|
||||
"record_added"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"downloads_downloads",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "dtime",
|
||||
"columns": [
|
||||
"dtime"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE core_groups ADD idm_bypass_revision TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_temp_records ADD INDEX ( record_added );";
|
||||
$SQL[] = "ALTER TABLE downloads_downloads ADD INDEX ( dtime );";
|
||||
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_renewal_term",
|
||||
"type": "int",
|
||||
"length": 5,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_renewal_units",
|
||||
"type": "char",
|
||||
"length": 1,
|
||||
"allow_null": true,
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_renewal_price",
|
||||
"type": "float",
|
||||
"length": null,
|
||||
"allow_null": false,
|
||||
"default": "0.00"
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_mods",
|
||||
{
|
||||
"name": "modusefeature",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_featured",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "file_featured",
|
||||
"columns": [
|
||||
"file_featured"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_pinned",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_mods",
|
||||
{
|
||||
"name": "modcanpin",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
{
|
||||
"name": "file_comments",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_files ADD COLUMN file_renewal_term INT(5) NOT NULL DEFAULT 0;";
|
||||
$SQL[] = "ALTER TABLE downloads_files ADD COLUMN file_renewal_units CHAR(1) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE downloads_files ADD COLUMN file_renewal_price FLOAT NOT NULL DEFAULT '0.00';";
|
||||
$SQL[] = "ALTER TABLE downloads_mods ADD modusefeature TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_files ADD file_featured TINYINT( 1 ) NOT NULL DEFAULT '0', ADD INDEX ( file_featured );";
|
||||
$SQL[] = "ALTER TABLE downloads_files ADD file_pinned TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_mods ADD modcanpin TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_files ADD file_comments INT NOT NULL DEFAULT '0';";
|
||||
@@ -1,66 +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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_23003;
|
||||
|
||||
/* 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( 'downloads', 23003 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update comment count
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( 'COUNT(*) as comments, comment_fid', 'downloads_comments', NULL, NULL, NULL, 'comment_fid' ) as $file )
|
||||
{
|
||||
$comments[ $file['comment_fid'] ] = $file['comments'];
|
||||
}
|
||||
|
||||
if( count( $comments ) )
|
||||
{
|
||||
foreach( $comments as $fileId => $commentCount )
|
||||
{
|
||||
\IPS\Db::i()->update( 'downloads_files', array( 'file_comments' => $commentCount ), array( 'file_id=?', $fileId ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( \Exception $e ){}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_temp_records",
|
||||
{
|
||||
"name": "record_default",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_temp_records ADD record_default TINYINT( 1 ) 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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_23006;
|
||||
|
||||
/* 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( 'downloads', 23006 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key='idm_enablerandom'"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_comments",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_downloads",
|
||||
"dip",
|
||||
{
|
||||
"name": "dip",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": "0",
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_ipaddress",
|
||||
{
|
||||
"name": "file_ipaddress",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": "0",
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_submitter",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "file_submitter",
|
||||
"columns": [
|
||||
"file_submitter",
|
||||
"file_open",
|
||||
"file_updated"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_sessions",
|
||||
"dsess_ip",
|
||||
{
|
||||
"name": "dsess_ip",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_urls",
|
||||
"url_ip",
|
||||
{
|
||||
"name": "url_ip",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| IP.Board vVERSION_NUMBER
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2009 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* Downloads upgrade */
|
||||
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN( 'idm_enablerandom' );";
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_comments CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE downloads_downloads CHANGE dip dip VARCHAR( 46 ) NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_files CHANGE file_ipaddress file_ipaddress VARCHAR( 46 ) NOT NULL DEFAULT '0',
|
||||
DROP INDEX file_submitter,
|
||||
ADD INDEX file_submitter ( file_submitter, file_open, file_updated );";
|
||||
$SQL[] = "ALTER TABLE downloads_sessions CHANGE dsess_ip dsess_ip VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE downloads_urls CHANGE url_ip url_ip VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
|
||||
$SQL[] = "UPDATE core_applications SET app_title='Downloads' WHERE app_directory='downloads';";
|
||||
@@ -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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_24000;
|
||||
|
||||
/* 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( 'downloads', 24000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
{
|
||||
"conf_value": "disk"
|
||||
},
|
||||
"conf_key='idm_filestorage' AND conf_value IN ('web','nonweb')"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"downloads_files_records",
|
||||
{
|
||||
"record_storagetype": "disk"
|
||||
},
|
||||
"record_storagetype IN ('web','nonweb')"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files_records",
|
||||
"record_storagetype",
|
||||
{
|
||||
"name": "record_storagetype",
|
||||
"type": "varchar",
|
||||
"length": 24,
|
||||
"default": "disk",
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "idm_throttling",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "idm_wait_period",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_categories",
|
||||
{
|
||||
"name": "ctags_disabled",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_categories",
|
||||
{
|
||||
"name": "ctags_noprefixes",
|
||||
"type": "tinyint",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"downloads_categories",
|
||||
{
|
||||
"name": "ctags_predefined",
|
||||
"type": "text",
|
||||
"length": null,
|
||||
"allow_null": true,
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"downloads_comments",
|
||||
"comment_fid",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "comment_fid",
|
||||
"columns": [
|
||||
"comment_fid",
|
||||
"comment_date"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_cat",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "file_cat",
|
||||
"columns": [
|
||||
"file_cat",
|
||||
"file_updated"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| IP.Board vVERSION_NUMBER
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2009 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* Downloads upgrade */
|
||||
|
||||
$SQL[] = "UPDATE core_sys_conf_settings SET conf_value='disk' WHERE conf_key='idm_filestorage' AND conf_value IN ('web','nonweb');";
|
||||
$SQL[] = "UPDATE downloads_files_records SET record_storagetype='disk' WHERE record_storagetype IN ('web','nonweb');";
|
||||
$SQL[] = "ALTER TABLE downloads_files_records CHANGE record_storagetype record_storagetype varchar(24) NOT NULL default 'disk';";
|
||||
|
||||
$SQL[] = "ALTER TABLE core_groups ADD idm_throttling INT NOT NULL DEFAULT '0',
|
||||
ADD idm_wait_period INT NOT NULL DEFAULT '0';";
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_categories ADD ctags_disabled TINYINT NOT NULL DEFAULT '0',
|
||||
ADD ctags_noprefixes TINYINT NOT NULL DEFAULT '0',
|
||||
ADD ctags_predefined TEXT NULL DEFAULT NULL;";
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_comments DROP INDEX comment_fid,
|
||||
ADD INDEX comment_fid ( comment_fid , comment_date );";
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_files DROP INDEX file_cat,
|
||||
ADD INDEX file_cat ( file_cat , file_updated );";
|
||||
@@ -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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_25000;
|
||||
|
||||
/* 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( 'downloads', 25000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files",
|
||||
"file_size",
|
||||
{
|
||||
"name": "file_size",
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_files_records",
|
||||
"record_size",
|
||||
{
|
||||
"name": "record_size",
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| IP.Board vVERSION_NUMBER
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2009 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* Downloads upgrade */
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_files CHANGE file_size file_size BIGINT NOT NULL DEFAULT '0';";
|
||||
$SQL[] = "ALTER TABLE downloads_files_records CHANGE record_size record_size BIGINT 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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_25004;
|
||||
|
||||
/* 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( 'downloads', 25004 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"downloads_downloads",
|
||||
"dsize",
|
||||
{
|
||||
"name": "dsize",
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
/* Downloads upgrade */
|
||||
|
||||
$SQL[] = "ALTER TABLE downloads_downloads CHANGE dsize dsize BIGINT 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 Downloads
|
||||
* @since 24 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\downloads\setup\upg_25005;
|
||||
|
||||
/* 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( 'downloads', 25005 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1189,7 +1189,7 @@
|
||||
"length": 1,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Blocked from submitting IP.Downloads files?",
|
||||
"comment": "Blocked from submitting Downloads files?",
|
||||
"unsigned": 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 Downloads
|
||||
* @since 19 Nov 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -31,8 +31,22 @@ class _Upgrade
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'downloads_categories' )->join( 'core_permission_index', array( 'app=? and perm_type=? and perm_type_id=downloads_categories.cid', 'downloads', 'cat' ) ) as $category )
|
||||
$perCycle = 100;
|
||||
$did = 0;
|
||||
$limit = intval( \IPS\Request::i()->extra );
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'downloads_categories', null, 'downloads_categories.cid ASC', array( $limit, $perCycle ) )->join( 'core_permission_index', array( 'app=? and perm_type=? and perm_type_id=downloads_categories.cid', 'downloads', 'cat' ) ) as $category )
|
||||
{
|
||||
if ( $cutOff !== NULL AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
$options = unserialize( $category['coptions'] );
|
||||
/* We make a guess as to whether approval should be required since it is no longer per-permission mask */
|
||||
$approval = ( !$category['perm_7'] or $category['perm_7'] == ',4,' ) ? 1 : 0;
|
||||
@@ -84,11 +98,20 @@ class _Upgrade
|
||||
|
||||
$category->save();
|
||||
}
|
||||
|
||||
\IPS\Db::i()->update( 'core_permission_index', array( 'perm_type' => 'category' ), array( 'app=?', 'downloads' ) );
|
||||
\IPS\Db::i()->dropColumn( 'downloads_categories', array( 'coptions', 'cname' ) );
|
||||
|
||||
return true;
|
||||
|
||||
if ( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_permission_index', array( 'perm_type' => 'category' ), array( 'app=?', 'downloads' ) );
|
||||
\IPS\Db::i()->dropColumn( 'downloads_categories', array( 'coptions', 'cname' ) );
|
||||
|
||||
unset( $_SESSION['_step1Count_40000_downloads'] );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +121,14 @@ class _Upgrade
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Upgrading download manager categories";
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if ( !isset( $_SESSION['_step1Count_40000_downloads'] ) )
|
||||
{
|
||||
$_SESSION['_step1Count_40000_downloads'] = \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories' )->first();
|
||||
}
|
||||
|
||||
return "Upgrading download manager categories (Upgraded so far: " . ( ( $limit > $_SESSION['_step1Count_40000_downloads'] ) ? $_SESSION['_step1Count_40000_downloads'] : $limit ) . ' out of ' . $_SESSION['_step1Count_40000_downloads'] . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,7 +177,17 @@ class _Upgrade
|
||||
{
|
||||
$update['cf_type'] = 'TextArea';
|
||||
}
|
||||
|
||||
|
||||
/* Fix custom input format */
|
||||
if ( $field['cf_input_format'] )
|
||||
{
|
||||
$regex = '/' . preg_quote( $field['cf_input_format'] ) . '/';
|
||||
$regex = str_replace( 'n', '\d', $regex );
|
||||
$regex = str_replace( 'a', '\w', $regex );
|
||||
|
||||
$update['cf_input_format'] = $regex;
|
||||
}
|
||||
|
||||
/* Fix the options */
|
||||
if( $field['cf_content'] )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user