Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 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
* @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 Downloads
* @since 30 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100002;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Alpha 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
* @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 Downloads
* @since 25 Mar 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100005;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 RC 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
* @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 Downloads
* @since 3 Feb 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100011;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 RC 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
* @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 Downloads
* @since 5 Feb 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100012;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 RC 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
* @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 Downloads
* @since 9 Feb 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100013;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 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
* @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 Downloads
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100015;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 RC 5 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
* @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 Downloads
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100018;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.5 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
* @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 Downloads
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100028;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.9 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
* @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 Downloads
* @since 19 Jun 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100035;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.13 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
* @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 Downloads
* @since 31 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_100044;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.0 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
* @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 Downloads
* @since 23 Sep 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_101000;
@@ -1,12 +1,11 @@
<?php
/**
* @brief 4.1.8 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
* @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
* @since 11 Jan 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_101024;
@@ -20,7 +20,7 @@
}
]
},
{
"2": {
"method": "changeColumn",
"params": [
"downloads_files",
@@ -1,13 +1,12 @@
<?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
* @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 Downloads
* @since 15 Nov 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_101071;
@@ -1,12 +1,11 @@
<?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
* @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
* @since 28 Nov 2016
* @version SVN_VERSION_NUMBER
*/
$path = \IPS\ROOT_PATH . '/applications/downloads/extensions/core/ContentRouter/downloads.php';
@@ -1,13 +1,12 @@
<?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
* @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 Downloads
* @since 20 Jan 2017
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_101088;
@@ -0,0 +1,69 @@
{
"1": {
"method": "addColumn",
"params": [
"downloads_categories",
{
"name": "cclub_id",
"type": "BIGINT",
"length": 20,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "The club ID if this category belongs to a club, or NULL",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"downloads_files",
{
"name": "file_meta_data",
"type": "BIT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "update",
"params": [
"downloads_files_records",
"record_location=TRIM(LEADING '\/' FROM record_location), record_thumb=TRIM(LEADING '\/' FROM record_thumb), record_no_watermark=TRIM(LEADING '\/' FROM record_no_watermark)"
]
},
"4": {
"method": "addColumn",
"params": [
"downloads_cfields",
{
"name": "cf_allow_attachments",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "1",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 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
* @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 Downloads
* @since 24 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_23000;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 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
* @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 Downloads
* @since 19 Nov 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_40000;
@@ -320,6 +319,81 @@ class _Upgrade
{
return "Fixing watermark configuration";
}
/**
* Set a default primary screenshot for each file
*
* @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 step5()
{
$perCycle = 500;
$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_files', null, 'file_id ASC', array( $limit, $perCycle ) ) as $file )
{
if ( $cutOff !== NULL AND time() >= $cutOff )
{
return ( $limit + $did );
}
$did++;
/* Try to get the default screenshot if one is set */
try
{
$defaultScreenshot = \IPS\Db::i()->select( 'record_id', 'downloads_files_records', array( "record_file_id=? AND record_type IN('sslink','ssupload') AND record_default=?", $file['file_id'], 1 ) )->first();
\IPS\Db::i()->update( 'downloads_files', array( 'file_primary_screenshot' => $defaultScreenshot ), array( 'file_id=?', $file['file_id'] ) );
}
catch( \UnderflowException $e )
{
/* Get the first screenshot for the file and set the primary screenshot flag */
try
{
$firstScreenshot = \IPS\Db::i()->select( 'record_id', 'downloads_files_records', array( "record_file_id=? AND record_type IN('sslink','ssupload')", $file['file_id'] ), 'record_id ASC', array( 0, 1 ) )->first();
\IPS\Db::i()->update( 'downloads_files', array( 'file_primary_screenshot' => $firstScreenshot ), array( 'file_id=?', $file['file_id'] ) );
}
catch( \UnderflowException $e )
{
continue;
}
}
}
if ( $did )
{
return ( $limit + $did );
}
else
{
unset( $_SESSION['_step5Count_40000_downloads'] );
return true;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step5CustomTitle()
{
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if ( !isset( $_SESSION['_step5Count_40000_downloads'] ) )
{
$_SESSION['_step5Count_40000_downloads'] = \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files' )->first();
}
return "Updating default screenshots (Updated so far: " . ( ( $limit > $_SESSION['_step5Count_40000_downloads'] ) ? $_SESSION['_step5Count_40000_downloads'] : $limit ) . ' out of ' . $_SESSION['_step5Count_40000_downloads'] . ")";
}
/**
* Finish - This is run after all apps have been upgraded