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,12 +1,11 @@
<?php
/**
* @brief Converter Vanilla Class
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2015 Invision Power Services, Inc.
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @package IPS Social Suite
* @subpackage Converter
* @since 21 Jan 2015
* @version
*/
namespace IPS\convert\Software\Core;
@@ -53,25 +52,68 @@ class _Vanilla extends \IPS\convert\Software
* @param \IPS\convert\App The application to reference for database and other information.
* @throws \InvalidArgumentException
*/
public function __construct( \IPS\convert\App $app )
public function __construct( \IPS\convert\App $app, $needDB=TRUE )
{
$return = parent::__construct( $app );
$return = parent::__construct( $app, $needDB );
/* What is the activity type ID for status updates? */
if ( static::$activityStatusType === NULL )
if ( $needDB )
{
try
/* What is the activity type ID for status updates? */
if ( static::$activityStatusType === NULL )
{
static::$activityStatusType = $this->db->select( 'ActivityTypeID', 'ActivityType',
array( 'Name=?', 'Status' ), NULL, 1
)->first();
try
{
static::$activityStatusType = $this->db->select( 'ActivityTypeID', 'ActivityType',
array( 'Name=?', 'Status' ), NULL, 1
)->first();
}
catch ( \Exception $e ) {}
}
catch ( \Exception $e ) {}
}
return $return;
}
/**
* Can we convert settings?
*
* @return boolean
*/
public static function canConvertSettings()
{
return TRUE;
}
/**
* Settings Map Listing
*
* @return array
*/
public function settingsMapList()
{
$settings = array(
'fluid' => array( 'title' => \IPS\Member::loggedIn()->language()->addToStack( 'use_fluid_view_convert' ), 'value' => true, 'our_key' => 'use_fluid_view_convert', 'our_title' => \IPS\Member::loggedIn()->language()->addToStack( 'use_fluid_view_convert' ) )
);
return $settings;
}
/**
* Convert one or more settings
*
* @param array $settings Settings to convert
* @return void
*/
public function convertSettings( $settings=array() )
{
if ( !isset( $settings['use_fluid_view_convert'] ) OR $settings['use_fluid_view_convert'] == FALSE )
{
return;
}
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => 'fluid' ), array( "conf_key=?", 'forums_default_view' ) );
}
/**
* Resolve the filesystem location of a file from a path stored in the database
* There are several different ways Vanilla may store these, including as remote URL's
@@ -154,10 +196,6 @@ class _Vanilla extends \IPS\convert\Software
'table' => 'User',
'where' => NULL,
),
'convertRemoteAvatars' => array(
'table' => NULL,
'where' => NULL,
),
'convertStatuses' => array(
'table' => 'Activity',
'where' => array( 'ActivityTypeId=?', (int) static::$activityStatusType )
@@ -331,6 +369,15 @@ class _Vanilla extends \IPS\convert\Software
$libraryClass->convertGroup( $info, $merge );
$libraryClass->setLastKeyValue( $row['RoleID'] );
}
/* Now check for group promotions */
if( count( $libraryClass->groupPromotions ) )
{
foreach( $libraryClass->groupPromotions as $groupPromotion )
{
$libraryClass->convertGroupPromotion( $groupPromotion );
}
}
}
/**
@@ -470,7 +517,7 @@ class _Vanilla extends \IPS\convert\Software
'mt_date' => static::mysqlToDateTime( $row['DateInserted'] ),
'mt_starter_id' => $row['InsertUserID'],
'mt_last_post_time' => static::mysqlToDateTime( $row['DateUpdated'] ),
'mt_to_count' => $row['CountParticipants'],
'mt_to_count' => ( isset( $row['CountParticipants'] ) ) ? $row['CountParticipants'] : count( \unserialize( $row['Contributors'] ) ),
'mt_replies' => $row['CountMessages'],
);
@@ -490,7 +537,7 @@ class _Vanilla extends \IPS\convert\Software
}
$libraryClass->convertPrivateMessage( $topicInfo, $maps );
$libraryClass->setLastKeyValue( $row['MessageID'] );
$libraryClass->setLastKeyValue( $row['ConversationID'] );
}
}