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

@@ -2,9 +2,9 @@
/**
* @brief Converter MyBB Class
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @package Invision Community
* @subpackage Converter
* @since 21 Jan 2015
*/
@@ -97,7 +97,8 @@ class _Mybb extends \IPS\convert\Software
public static function checkConf()
{
return array(
'convertAttachments'
'convertAttachments',
'convertForumsPosts'
);
}
@@ -113,6 +114,36 @@ class _Mybb extends \IPS\convert\Software
switch( $method )
{
case 'convertForumsPosts':
/* Get our reactions to let the admin map them */
$options = array();
$descriptions = array();
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_reactions' ), 'IPS\Content\Reaction' ) AS $reaction )
{
$options[ $reaction->id ] = $reaction->_icon->url;;
$descriptions[ $reaction->id ] = \IPS\Member::loggedIn()->language()->addToStack('reaction_title_' . $reaction->id ) . '<br>' . $reaction->_description;
}
$return['convertForumsPosts'] = array(
'rep_positive' => array(
'field_class' => 'IPS\\Helpers\\Form\\Radio',
'field_default' => NULL,
'field_required' => TRUE,
'field_extra' => array( 'parse' => 'image', 'options' => $options, 'descriptions' => $descriptions ),
'field_hint' => NULL,
'field_validation' => NULL,
),
'rep_negative' => array(
'field_class' => 'IPS\\Helpers\\Form\\Radio',
'field_default' => NULL,
'field_required' => TRUE,
'field_extra' => array( 'parse' => 'image', 'options' => $options, 'descriptions' => $descriptions ),
'field_hint' => NULL,
'field_validation' => NULL,
),
);
break;
case 'convertAttachments':
$return['convertAttachments'] = array(
'attach_location' => array(
@@ -144,6 +175,10 @@ class _Mybb extends \IPS\convert\Software
\IPS\Task::queue( 'convert', 'RebuildFirstPostIds', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
\IPS\Task::queue( 'convert', 'DeleteEmptyTopics', array( 'app' => $this->app->app_id ), 4, array( 'app' ) );
/* Rebuild Leaderboard */
\IPS\Task::queue( 'core', 'RebuildReputationLeaderboard', array(), 4 );
\IPS\Db::i()->delete('core_reputation_leaderboard_history');
/* Caches */
\IPS\Task::queue( 'convert', 'RebuildTagCache', array( 'app' => $this->app->app_id, 'link' => 'forums_topics', 'class' => 'IPS\forums\Topic' ), 3, array( 'app', 'link', 'class' ) );
@@ -446,6 +481,8 @@ class _Mybb extends \IPS\convert\Software
/* Reputation */
foreach( $this->db->select( '*', 'reputation', array( "pid=?", $row['pid'] ) ) AS $rep )
{
$reaction = ( $rep['reputation'] > 0 ) ? $this->app->_session['more_info']['convertForumsPosts']['rep_positive'] : $this->app->_session['more_info']['convertForumsPosts']['rep_negative'];
$libraryClass->convertReputation( array(
'id' => $rep['rid'],
'app' => 'forums',
@@ -454,7 +491,7 @@ class _Mybb extends \IPS\convert\Software
'member_id' => $rep['adduid'],
'member_received' => $rep['uid'],
'rep_date' => $rep['dateline'],
'rep_rating' => $rep['reputation']
'reaction' => $reaction
) );
}
@@ -559,7 +596,7 @@ class _Mybb extends \IPS\convert\Software
}
$item = $class::load( $data );
if( $item instanceof \IPS\Content\Item )
if( $item instanceof \IPS\Content )
{
if( $item->canView() )
{