Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

@@ -54,13 +54,26 @@ class _Upgrade
{
foreach( $votes as $member => $rating )
{
\IPS\Db::i()->insert( 'downloads_reviews', array(
'review_fid' => $file['file_id'],
'review_mid' => $member,
'review_rating' => $rating,
) );
$voteCount++;
try
{
$member = \IPS\Member::load( $member );
\IPS\Db::i()->insert( 'downloads_reviews', array(
'review_fid' => $file['file_id'],
'review_mid' => $member->member_id,
'review_author_name' => $member->name,
'review_rating' => $rating,
/* The review_ip column does not accept NULL values */
'review_ip' => '',
'review_date' => time(),
'review_approved' => 1,
/* The search index does not allow blank text */
'review_text' => '',
) );
$voteCount++;
}
catch( \Exception $e ){}
}
}
@@ -0,0 +1,71 @@
<?php
/**
* @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.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 23 Sep 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\setup\upg_101000;
/* 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.0 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Fix broken downloads reviews from 100044
*
* @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( \IPS\Db::i()->select( '*', 'downloads_reviews', 'review_date is null' ) as $review )
{
try
{
$member = \IPS\Member::load( $review['review_mid'] );
\IPS\Db::i()->update( 'downloads_reviews', array( 'review_date' => time(), 'review_text' => '', 'review_author_name' => $member->name ), array( 'review_id=?', $review['review_id'] ) );
}
catch( \Exception $e ){}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Adjusting empty download reviews";
}
/**
* Reset the forum ID to post to if the forum ID does not exist
*
* @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 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 )' );
return TRUE;
}
}