Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -84,7 +84,7 @@ class _Expressionengine extends \IPS\convert\Software
|
||||
{
|
||||
$rows['convertOtherPosts'] = $rows['convertForumsPosts'];
|
||||
$rows['convertOtherPosts']['step_method'] = 'convertOtherPosts';
|
||||
$rows['convertOtherPosts']['source_rows'] = $this->countRows( static::canConvert()['convertOtherPosts']['table'], static::canConvert()['convertOtherPosts']['where'] );
|
||||
$rows['convertOtherPosts']['source_rows'] = array( 'table' => static::canConvert()['convertOtherPosts']['table'], 'where' => static::canConvert()['convertOtherPosts']['where'] );
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
@@ -250,8 +250,9 @@ class _Phpbb extends \IPS\convert\Software
|
||||
foreach( $this->fetch( 'topics', 'topic_id' ) AS $row )
|
||||
{
|
||||
$poll = NULL;
|
||||
|
||||
if ( $row['poll_title'] )
|
||||
$pollTitle = str_ireplace( array( '<t>', '</t>' ), '', $row['poll_title'] );
|
||||
|
||||
if ( $pollTitle )
|
||||
{
|
||||
$poll = array();
|
||||
|
||||
@@ -261,16 +262,16 @@ class _Phpbb extends \IPS\convert\Software
|
||||
$search = array(); # make sure we actually assign the vote correctly
|
||||
foreach( $this->db->select( '*', 'poll_options', array( "topic_id=?", $row['topic_id'] ) ) AS $choice )
|
||||
{
|
||||
$choices[$index] = $choice['poll_option_text'];
|
||||
$votes[$index] = $choice['poll_option_total'];
|
||||
$search[$index] = $choice['poll_option_id'];
|
||||
$choices[ $index ] = str_ireplace( array( '<t>', '</t>' ), '', $choice['poll_option_text'] );
|
||||
$votes[ $index ] = $choice['poll_option_total'];
|
||||
$search[ $index ] = $choice['poll_option_id'];
|
||||
$index++;
|
||||
}
|
||||
|
||||
$poll['poll_data'] = array(
|
||||
'pid' => $row['topic_id'],
|
||||
'choices' => array( 1 => array(
|
||||
'question' => $row['poll_title'],
|
||||
'question' => $pollTitle,
|
||||
'multi' => ( $row['poll_max_options'] > 1 ) ? 1 : 0,
|
||||
'choice' => $choices,
|
||||
'votes' => $votes,
|
||||
@@ -291,13 +292,13 @@ class _Phpbb extends \IPS\convert\Software
|
||||
$ourVotes[$vote['vote_user_id']] = array( 'votes' => array() );
|
||||
}
|
||||
|
||||
$ourVotes[$vote['vote_user_id']]['votes'][] = array_search( $vote['poll_option_id'], $search );
|
||||
$ourVotes[$vote['vote_user_id']]['member_id'] = $vote['vote_user_id'];
|
||||
$ourVotes[ $vote['vote_user_id'] ]['votes'][] = array_search( $vote['poll_option_id'], $search );
|
||||
$ourVotes[ $vote['vote_user_id'] ]['member_id'] = $vote['vote_user_id'];
|
||||
}
|
||||
|
||||
foreach( $ourVotes AS $member_id => $vote )
|
||||
{
|
||||
$poll['vote_data'][$member_id] = array(
|
||||
$poll['vote_data'][ $member_id ] = array(
|
||||
'member_id' => $vote['member_id'],
|
||||
'member_choices' => array( 1 => $vote['votes'] ),
|
||||
);
|
||||
@@ -552,6 +553,19 @@ class _Phpbb extends \IPS\convert\Software
|
||||
$types = array( 'forums', 'forums_forums' );
|
||||
$oldId = \IPS\Request::i()->f;
|
||||
}
|
||||
elseif( mb_strpos( $url->data[ \IPS\Http\Url::COMPONENT_PATH ], 'download/file.php' ) !== FALSE )
|
||||
{
|
||||
try
|
||||
{
|
||||
$data = (string) $this->app->getLink( \IPS\Request::i()->id, array( 'attachments', 'core_attachments' ) );
|
||||
|
||||
return \IPS\Http\Url::external( \IPS\Settings::i()->base_url . 'applications/core/interface/file/attachment.php' )->setQueryString( 'id', $data );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if( isset( $class ) )
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ class _Smf extends \IPS\convert\Software
|
||||
{
|
||||
$rows['convertForumsBoards'] = $rows['convertForumsForums'];
|
||||
$rows['convertForumsBoards']['step_method'] = 'convertForumsBoards';
|
||||
$rows['convertForumsBoards']['source_rows'] = $this->countRows( static::canConvert()['convertForumsBoards']['table'], static::canConvert()['convertForumsBoards']['where'] );
|
||||
$rows['convertForumsBoards']['source_rows'] = array( 'table' => static::canConvert()['convertForumsBoards']['table'], 'where' => static::canConvert()['convertForumsBoards']['where'] );
|
||||
|
||||
return $rows;
|
||||
}
|
||||
@@ -540,6 +540,13 @@ class _Smf extends \IPS\convert\Software
|
||||
*/
|
||||
public function checkRedirects()
|
||||
{
|
||||
/* Support SMF friendly URLs ( index.php/topic,1000.0.html ) */
|
||||
$url = \IPS\Request::i()->url();
|
||||
if( mb_strpos( $url->data[ \IPS\Http\Url::COMPONENT_PATH ], 'topic,' ) !== FALSE )
|
||||
{
|
||||
\IPS\Request::i()->topic = (int) explode( ',', $url->data[ \IPS\Http\Url::COMPONENT_PATH ] )[1];
|
||||
}
|
||||
|
||||
if( isset( \IPS\Request::i()->topic ) )
|
||||
{
|
||||
if( mb_strpos( \IPS\Request::i()->topic, '.msg' ) !== FALSE )
|
||||
|
||||
@@ -98,7 +98,7 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
$rows['convertForumsTopicsRatings'] = array(
|
||||
'step_method' => 'convertForumsTopicsRatings',
|
||||
'step_title' => 'convert_ratings',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_ratings' )->first(),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_ratings' ),
|
||||
'source_rows' => $count,
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertForumsTopics' ),
|
||||
@@ -113,7 +113,7 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
$rows['convertForumsTopicsFollowers'] = array(
|
||||
'step_method' => 'convertForumsTopicsFollowers',
|
||||
'step_title' => 'convert_follows',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_follow' )->first(),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_follow' ),
|
||||
'source_rows' => $count,
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertForumsTopics' ),
|
||||
|
||||
@@ -599,22 +599,38 @@ class _Vanilla extends \IPS\convert\Software
|
||||
$url = \IPS\Request::i()->url();
|
||||
|
||||
if( preg_match( '#/discussion/([0-9]+)/#i', $url->data[ \IPS\Http\Url::COMPONENT_PATH ], $matches ) )
|
||||
{
|
||||
$class = '\IPS\forums\Topic';
|
||||
$types = array( 'topics', 'forums_topics' );
|
||||
$oldId = (int) $matches[1];
|
||||
}
|
||||
elseif( preg_match( '#/discussion/comment/([0-9]+)#i', $url->data[ \IPS\Http\Url::COMPONENT_PATH ], $matches ) )
|
||||
{
|
||||
$class = '\IPS\forums\Topic\Post';
|
||||
$types = array( 'posts', 'forums_posts' );
|
||||
$oldId = $matches[1];
|
||||
}
|
||||
|
||||
if( isset( $class ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
$data = (string) $this->app->getLink( (int) $matches[1], array( 'topics', 'forums_topics' ) );
|
||||
$data = (string) $this->app->getLink( $oldId, $types );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
$data = (string) $this->app->getLink( (int) $matches[1], array( 'topics', 'forums_topics' ), FALSE, TRUE );
|
||||
$data = (string) $this->app->getLink( $oldId, $types, FALSE, TRUE );
|
||||
}
|
||||
$item = \IPS\forums\Topic::load( $data );
|
||||
$item = $class::load( $data );
|
||||
|
||||
if( $item->canView() )
|
||||
if( $item instanceof \IPS\Content )
|
||||
{
|
||||
return $item->url();
|
||||
if( $item->canView() )
|
||||
{
|
||||
return $item->url();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( \Exception $e )
|
||||
|
||||
@@ -87,7 +87,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
public static function softwareName()
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "vBulletin Forums (3.x/4.x)";
|
||||
return "vBulletin Forums (3.8.x/4.x)";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -601,11 +601,13 @@ class _Vbulletin5 extends \IPS\convert\Software
|
||||
|
||||
foreach( $main AS $attachment )
|
||||
{
|
||||
/* This is the first post in the topic */
|
||||
try
|
||||
{
|
||||
$this->app->getLink( $attachment['parentid'], 'forums_topics' );
|
||||
$post_id = $attachment['nodeid'];
|
||||
$post_id = $attachment['parentid'];
|
||||
}
|
||||
/* It isn't the first post in the topic */
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
try
|
||||
|
||||
Reference in new issue
Block a user