Version 4.0.13.1

This commit is contained in:
Neo committed 2025-12-19 04:57:54 -08:00
1 parent f9e857d255
commit c6a86f0d9b
7517 files changed
+597400 -668041

No files matched your search

Whitespace-only changes.
@@ -0,0 +1,15 @@
<?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');";
@@ -0,0 +1,127 @@
<?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_23000;
/* 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', 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()
{
$members = array();
foreach( \IPS\Db::i()->select( '*', 'downloads_favorites' ) as $favorite )
{
$members[ $favorite['ffid'] ][ $favorite['fmid'] ] = array(
'follow_rel_id' => $favorite['ffid'],
'follow_member_id' => $favorite['fmid'],
'follow_notify_do' => 0,
);
}
foreach( \IPS\Db::i()->select( 'file_id, file_sub_mems', 'downloads_files', "file_sub_mems != '' AND file_sub_mems IS NOT NULL" ) as $file )
{
$_subscriptions = explode( ',', trim( $r['file_sub_mems'], ',' ) );
if( count( $_subscriptions ) )
{
foreach( $_subscriptions as $mid )
{
if( isset( $members[ $file['file_id'] ][ $mid ]) )
{
$members[ $file['file_id'] ][ $mid ]['follow_notify_do'] = 1;
}
else
{
$members[ $file['file_id'] ][ $mid ] = array(
'follow_rel_id' => $file['file_id'],
'follow_member_id' => $mid,
'follow_notify_do' => 1,
);
}
}
}
}
if( count( $members ) )
{
foreach( $members as $file => $_members )
{
foreach( $_members as $member )
{
if( !$member['follow_member_id'] )
{
continue;
}
\IPS\Db::i()->insert( 'core_follow', array(
'follow_app' => 'downloads',
'follow_area' => 'files',
'follow_rel_id' => $member['follow_rel_id'],
'follow_member_id' => $member['follow_member_id'],
'follow_is_anon' => 0,
'follow_added' => time(),
'follow_notify_do' => $member['follow_notify_do'],
'follow_notify_freq' => 'immediate',
'follow_visible' => 1,
) );
}
}
}
return TRUE;
}
/**
* Clean up
*
* @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()
{
if( \IPS\Db::i()->checkForColumn( 'downloads_files', 'file_meta' ) )
{
\IPS\Db::i()->dropColumn( 'downloads_files', 'file_meta' );
}
\IPS\Db::i()->dropTable( 'downloads_favorites' );
\IPS\Db::i()->dropColumn( 'downloads_files', 'file_sub_mems' );
return true;
}
}