Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -82,10 +82,6 @@ class _Woltlab extends \IPS\convert\Software
|
||||
'table' => 'wcf' . static::$installId . '_user',
|
||||
'where' => NULL
|
||||
),
|
||||
'convertRanks' => array(
|
||||
'table' => 'wcf' . static::$installId . '_user_rank',
|
||||
'where' => array( 'requiredPoints>0' )
|
||||
),
|
||||
'convertPrivateMessages' => array(
|
||||
'table' => 'wcf' . static::$installId . '_conversation',
|
||||
'where' => NULL
|
||||
@@ -285,6 +281,25 @@ class _Woltlab extends \IPS\convert\Software
|
||||
'field_hint' => NULL,
|
||||
'field_validation' => function( $value ) { if ( !@is_dir( $value ) ) { throw new \DomainException( 'path_invalid' ); } },
|
||||
);
|
||||
|
||||
foreach( [ 'usertitle' ] AS $field )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words["field_{$field}"] = \IPS\Member::loggedIn()->language()->addToStack( 'pseudo_field', FALSE, [ 'sprintf' => $field ] );
|
||||
\IPS\Member::loggedIn()->language()->words["field_{$field}_desc"] = \IPS\Member::loggedIn()->language()->addToStack( 'pseudo_field_desc' );
|
||||
$return['convertMembers']["field_{$field}"] = [
|
||||
'field_class' => 'IPS\\Helpers\\Form\\Radio',
|
||||
'field_default' => 'no_convert',
|
||||
'field_required' => TRUE,
|
||||
'field_extra' => [
|
||||
'options' => [
|
||||
'no_convert' => \IPS\Member::loggedIn()->language()->addToStack( 'no_convert' ),
|
||||
'create_field' => \IPS\Member::loggedIn()->language()->addToStack( 'create_field' ),
|
||||
],
|
||||
'userSuppliedInput' => 'create_field'
|
||||
],
|
||||
'field_hint' => NULL
|
||||
];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -572,7 +587,6 @@ class _Woltlab extends \IPS\convert\Software
|
||||
'password' => $row['password'],
|
||||
'member_group_id' => $row['userOnlineGroupID'],
|
||||
'joined' => $row['registrationDate'],
|
||||
'member_title' => \in_array( $row['userTitle'], $userTitles ) OR empty( $row['userTitle'] ) ? NULL : $row['userTitle'],
|
||||
'bday_day' => $birthdayDay,
|
||||
'bday_month' => $birthdayMonth,
|
||||
'bday_year' => $birthdayYear,
|
||||
@@ -615,6 +629,47 @@ class _Woltlab extends \IPS\convert\Software
|
||||
$profileFields[ $k ] = $userFields[ $v ];
|
||||
}
|
||||
|
||||
/* Pseudo field(s) */
|
||||
foreach( [ 'usertitle' ] AS $pseudo )
|
||||
{
|
||||
/* Are we retaining? */
|
||||
if ( $this->app->_session['more_info']['convertMembers']["field_{$pseudo}"] == 'no_convert' )
|
||||
{
|
||||
/* No, skip */
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
/* We don't actually need this, but we need to make sure the field was created */
|
||||
$fieldId = $this->app->getLink( $pseudo, 'core_pfields_data' );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
$libraryClass->convertProfileField( [
|
||||
'pf_id' => $pseudo,
|
||||
'pf_name' => $this->app->_session['more_info']['convertMembers']["field_{$pseudo}"],
|
||||
'pf_desc' => '',
|
||||
'pf_type' => 'Text',
|
||||
'pf_content' => '[]',
|
||||
'pf_member_hide' => 0,
|
||||
'pf_max_input' => 255,
|
||||
'pf_member_edit' => 1,
|
||||
'pf_show_on_reg' => 0,
|
||||
'pf_admin_only' => 0,
|
||||
] );
|
||||
}
|
||||
|
||||
if( $pseudo == 'usertitle' )
|
||||
{
|
||||
$profileFields[ $pseudo ] = \in_array( $row['userTitle'], $userTitles ) OR empty( $row['userTitle'] ) ? NULL : $row['userTitle'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$profileFields[ $pseudo ] = $row[ $pseudo ];
|
||||
}
|
||||
}
|
||||
|
||||
$libraryClass->convertMember( $info, $profileFields, $filename, $filepath, NULL, $coverFileName, $coverFilePath );
|
||||
|
||||
/* Any friends need converting to followers? */
|
||||
@@ -659,28 +714,6 @@ class _Woltlab extends \IPS\convert\Software
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert ranks
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertRanks()
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'rankID' );
|
||||
|
||||
foreach( $this->fetch( 'wcf' . static::$installId . '_user_rank', 'rankID', array( 'requiredPoints>0' ) ) AS $row )
|
||||
{
|
||||
$libraryClass->convertRank( array(
|
||||
'id' => $row['rankID'],
|
||||
'title' => $row['rankTitle'],
|
||||
'posts' => $row['requiredPoints']
|
||||
) );
|
||||
|
||||
$libraryClass->setLastKeyValue( $row['rankID'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert PMs
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user