Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -4,20 +4,22 @@
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Converter
|
||||
* @subpackage convert
|
||||
* @since 21 Jan 2015
|
||||
* @version
|
||||
*/
|
||||
|
||||
namespace IPS\convert\Software\Core;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* SMF Core Converter
|
||||
*/
|
||||
class _Smf extends \IPS\convert\Software
|
||||
{
|
||||
/**
|
||||
@@ -132,6 +134,10 @@ class _Smf extends \IPS\convert\Software
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
throw new \IPS\convert\Exception( sprintf( \IPS\Member::loggedIn()->language()->get( 'could_not_count_rows' ), $table ) );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -276,7 +282,7 @@ class _Smf extends \IPS\convert\Software
|
||||
/**
|
||||
* Finish - Adds everything it needs to the queues and clears data store
|
||||
*
|
||||
* @return array Message to display
|
||||
* @return array Messages to display
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
@@ -306,8 +312,8 @@ class _Smf extends \IPS\convert\Software
|
||||
/**
|
||||
* Fix post data
|
||||
*
|
||||
* @param string raw post data
|
||||
* @return string parsed post data
|
||||
* @param string $post Raw post data
|
||||
* @return string Parsed post data
|
||||
*/
|
||||
public static function fixPostData( $post )
|
||||
{
|
||||
@@ -321,7 +327,7 @@ class _Smf extends \IPS\convert\Software
|
||||
$post = preg_replace("#\[img width=(\d+)(?: height=(\d+))?\]([a-zA-Z0-9.:\-/%\?&_=~\#\(\);:]+)\[\/img\]#i", "[img]$3[/img]", $post);
|
||||
|
||||
//Quotes
|
||||
$post = preg_replace("#\[quote author=(.+?) link=(.+?)=(\d+)\.msg(\d+)(.+?)date=(\d+)\](.+)\[\/quote\]#i", "[quote name=\"$1\" post=\"$4\" timestamp=\"$6\"]$7[/quote]", $post);
|
||||
$post = preg_replace("#\[quote author=(.+?) link=(.+?)=(\d+)\.msg(\d+)(.+?)date=(\d+)\](.+)\[\/quote\]#i", "[quote name=\"$1\" timestamp=\"$6\"]$7[/quote]", $post);
|
||||
|
||||
return $post;
|
||||
}
|
||||
@@ -524,15 +530,14 @@ class _Smf extends \IPS\convert\Software
|
||||
'pf_type' => $type,
|
||||
'pf_name' => $row['field_name'],
|
||||
'pf_desc' => $row['field_desc'],
|
||||
'pf_content' => ( in_array( $row['field_type'], array( 'select', 'radio' ) ) ) ? json_encode( explode( ',', $row['field_options'] ) ) : NULL,
|
||||
'pf_content' => ( \in_array( $row['field_type'], array( 'select', 'radio' ) ) ) ? json_encode( explode( ',', $row['field_options'] ) ) : NULL,
|
||||
'pf_not_null' => ( $row['show_reg'] == 2 ) ? 1 : 0,
|
||||
'pf_member_hide' => ( $row['private'] >= 3 ) ? 1 : 0,
|
||||
'pf_max_input' => ( !in_array( $row['field_type'], array( 'select', 'radio', 'check' ) ) ) ? $row['field_length'] : NULL,
|
||||
'pf_member_hide' => ( $row['private'] >= 3 ) ? 'hide' : 'all',
|
||||
'pf_max_input' => ( !\in_array( $row['field_type'], array( 'select', 'radio', 'check' ) ) ) ? $row['field_length'] : NULL,
|
||||
'pf_member_edit' => ( $row['private'] < 4 ) ? 1 : 0,
|
||||
'pf_position' => $row['placement'],
|
||||
'pf_show_on_reg' => ( $row['show_reg'] >= 1 ) ? 1 : 0,
|
||||
'pf_input_format' => ( mb_substr( $row['mask'], 0, 5 ) == 'regex' ) ? str_replace( 'regex', '', $row['mask'] ) : NULL,
|
||||
'pf_admin_only' => ( $row['private'] == 4 ) ? 1 : 0,
|
||||
);
|
||||
|
||||
$merge = ( $this->app->_session['more_info']['convertProfileFields']["map_pfield_{$row['id_field']}"] != 'none' ) ? $this->app->_session['more_info']['convertProfileFields']["map_pfield_{$row['id_field']}"] : NULL;
|
||||
@@ -581,7 +586,7 @@ class _Smf extends \IPS\convert\Software
|
||||
}
|
||||
|
||||
/* Now check for group promotions */
|
||||
if( count( $libraryClass->groupPromotions ) )
|
||||
if( \count( $libraryClass->groupPromotions ) )
|
||||
{
|
||||
foreach( $libraryClass->groupPromotions as $groupPromotion )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user