Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -28,9 +28,10 @@ class _<#CLASS#> extends \IPS\convert\Library
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -10,5 +10,9 @@
|
||||
"LoginHandler": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Login\\Handler"
|
||||
},
|
||||
"LegacyParser": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Text\\LegacyParser"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="convert">
|
||||
<file javascript_app="convert" javascript_location="admin" javascript_path="controllers/convert" javascript_name="ips.convert.menu.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
|
||||
<file javascript_app="convert" javascript_location="admin" javascript_path="controllers/convert" javascript_name="ips.convert.menu.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<app key="convert" version="103005">
|
||||
<app key="convert" version="103038">
|
||||
<word key="__app_convert" js="0">Converter</word>
|
||||
<word key="menu__convert_manage" js="0">Conversions</word>
|
||||
<word key="menu__convert_manage_manage_start" js="0">Start New Conversion</word>
|
||||
@@ -139,7 +139,9 @@
|
||||
<word key="reconfigure" js="0">Reconfigure</word>
|
||||
<word key="cannot_convert" js="0">Cannot Convert Yet</word>
|
||||
<word key="cannot_convert_desc" js="0">This step cannot be run until the steps before this one have been run.</word>
|
||||
<word key="waiting_previous_process" js="0">Waiting for a previous conversion cycle to finish</word>
|
||||
<word key="no_conversion_app" js="0">The conversion you attempted to run could not be found.</word>
|
||||
<word key="converter_could_not_continue" js="0"><![CDATA[There was a problem proceeding with the conversion, a previous cycle was still running. Please go back to <a href='{internal.app=convert&module=manage&controller=manage}'>the conversion</a> to continue.]]></word>
|
||||
<word key="convert_custom_bbcode" js="0">Custom BBCode</word>
|
||||
<word key="convert_emoticons" js="0">Emoticons</word>
|
||||
<word key="emoticon_path" js="0">Path to emoticons</word>
|
||||
|
||||
@@ -558,7 +558,9 @@
|
||||
}
|
||||
},
|
||||
"collation": "utf8mb4_unicode_ci",
|
||||
"engine": "InnoDB"
|
||||
"engine": "InnoDB",
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"convert_link_posts": {
|
||||
"name": "convert_link_posts",
|
||||
@@ -705,7 +707,9 @@
|
||||
}
|
||||
},
|
||||
"collation": "utf8mb4_unicode_ci",
|
||||
"engine": "InnoDB"
|
||||
"engine": "InnoDB",
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"convert_link_topics": {
|
||||
"name": "convert_link_topics",
|
||||
@@ -852,7 +856,9 @@
|
||||
}
|
||||
},
|
||||
"collation": "utf8mb4_unicode_ci",
|
||||
"engine": "InnoDB"
|
||||
"engine": "InnoDB",
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"convert_logs": {
|
||||
"name": "convert_logs",
|
||||
|
||||
@@ -120,9 +120,43 @@
|
||||
"102046": "4.2.7",
|
||||
"102047": "4.2.8",
|
||||
"102048": "4.2.8",
|
||||
"102049": "4.2.9",
|
||||
"103000": "4.3.0 Beta 1",
|
||||
"103002": "4.3.0 Beta 2",
|
||||
"103003": "4.3.0 Beta 3",
|
||||
"103004": "4.3.0 Beta 4",
|
||||
"103005": "4.3.0"
|
||||
"103005": "4.3.0",
|
||||
"103006": "4.3.1",
|
||||
"103007": "4.3.1",
|
||||
"103008": "4.3.1",
|
||||
"103009": "4.3.2",
|
||||
"103010": "4.3.2",
|
||||
"103011": "4.3.3",
|
||||
"103012": "4.3.3",
|
||||
"103013": "4.3.3",
|
||||
"103014": "4.3.3",
|
||||
"103015": "4.3.3",
|
||||
"103016": "4.3.3",
|
||||
"103017": "4.3.3",
|
||||
"103018": "4.3.3",
|
||||
"103019": "4.3.3",
|
||||
"103020": "4.3.3",
|
||||
"103021": "4.3.4",
|
||||
"103022": "4.3.4",
|
||||
"103023": "4.3.4",
|
||||
"103024": "4.3.4",
|
||||
"103025": "4.3.4",
|
||||
"103026": "4.3.5 Beta 1",
|
||||
"103027": "4.3.5 Beta 2",
|
||||
"103028": "4.3.5",
|
||||
"103029": "4.3.5",
|
||||
"103030": "4.3.5",
|
||||
"103031": "4.3.5",
|
||||
"103032": "4.3.5",
|
||||
"103033": "4.3.6 Beta 1",
|
||||
"103034": "4.3.6 Beta 2",
|
||||
"103035": "4.3.6",
|
||||
"103036": "4.3.6",
|
||||
"103037": "4.3.6",
|
||||
"103038": "4.3.6"
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
//<?php
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
class convert_hook_LegacyParser extends _HOOK_CLASS_
|
||||
{
|
||||
/**
|
||||
* Parse statically
|
||||
*
|
||||
* @param string $value The value to parse
|
||||
* @param \IPS\Member|null $member The member posting. NULL will use currently logged in member.
|
||||
* @param bool $allowHtml Allow HTML
|
||||
* @param string $attachClass Key to use for attachments
|
||||
* @param int $id1 ID1 to use for attachments
|
||||
* @param int $id2 ID2 to use for attachments
|
||||
* @param int|NULL $id3 ID3 to use for attachments
|
||||
* @param string $itemClass The *item* classname (e.g. IPS\forums\Topic)
|
||||
* @return string
|
||||
* @see __construct
|
||||
*/
|
||||
public static function parseStatic( $value, $member=NULL, $allowHtml=FALSE, $attachClass=null, $id1=0, $id2=0, $id3=NULL, $itemClass=NULL )
|
||||
{
|
||||
/* This content has previously been parsed, don't do it again
|
||||
* -- This can occur with the rebuildNonContent background tasks as they cannot confirm if
|
||||
* -- content was converted, or already present
|
||||
*/
|
||||
if( mb_stristr( $value, '<___base_url___>' ) OR mb_stristr( $value, 'data-ips' ) )
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
return parent::parseStatic( $value, $member, $allowHtml, $attachClass, $id1, $id2, $id3, $itemClass );
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class _convert extends \IPS\Dispatcher\Controller
|
||||
/* Build our table. If I can do this using only the Table helper, I'll be impressed */
|
||||
try
|
||||
{
|
||||
$menuRows = $libraryClass->menuRows();
|
||||
$menuRows = $libraryClass->menuRows( TRUE );
|
||||
|
||||
/* "Extra steps" should not show in the list of things to convert, but still need to be defined in menu rows */
|
||||
$extraSteps = array();
|
||||
|
||||
@@ -41,7 +41,7 @@ class _manage extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Remind the user that they must configure permissions after the conversion is complete */
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core' )->message( 'convert_configure_permissions', 'information' );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core' )->message( 'convert_configure_permissions', 'warning' );
|
||||
|
||||
/* Create the table */
|
||||
$table = new \IPS\Helpers\Table\Db( 'convert_apps', \IPS\Http\Url::internal( 'app=convert&module=manage&controller=manage' ) );
|
||||
|
||||
@@ -31,7 +31,25 @@ class _Upgrade
|
||||
public function step1()
|
||||
{
|
||||
/* Install new login handler */
|
||||
\IPS\Application::load('convert')->installOther();
|
||||
try
|
||||
{
|
||||
\IPS\Db::i()->select( '*', 'core_login_methods', array( "login_classname=?", 'IPS\\convert\\Login' ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
$position = \IPS\Db::i()->select( 'MAX(login_order)', 'core_login_methods' )->first();
|
||||
|
||||
$handler = new \IPS\convert\Login;
|
||||
$handler->classname = 'IPS\\convert\\Login';
|
||||
$handler->order = $position + 1;
|
||||
$handler->acp = TRUE;
|
||||
$handler->settings = array( 'auth_types' => \IPS\Login::AUTH_TYPE_USERNAME + \IPS\Login::AUTH_TYPE_EMAIL );
|
||||
$handler->enabled = TRUE;
|
||||
$handler->register = FALSE;
|
||||
$handler->save();
|
||||
|
||||
\IPS\Lang::saveCustom( 'core', "login_method_{$handler->id}", 'Converter' );
|
||||
}
|
||||
|
||||
/* Remove legacy login handler */
|
||||
\IPS\Db::i()->delete( 'core_login_handlers', array( 'login_key=?', 'Convert' ) );
|
||||
|
||||
@@ -554,9 +554,45 @@ class _App extends \IPS\Patterns\ActiveRecord
|
||||
switch( $this->data['app_key'] )
|
||||
{
|
||||
case 'photopost8':
|
||||
case 'photopost7':
|
||||
$this->app_key = 'photopost';
|
||||
$this->save();
|
||||
break;
|
||||
|
||||
case 'bbpress23':
|
||||
case 'bbpress_standalone':
|
||||
$this->app_key = 'bbpress';
|
||||
$this->save();
|
||||
break;
|
||||
|
||||
case 'mybb_legacy':
|
||||
$this->app_key = 'mybb';
|
||||
$this->save();
|
||||
break;
|
||||
|
||||
case 'phpbb_legacy':
|
||||
$this->app_key = 'phpbb';
|
||||
$this->save();
|
||||
break;
|
||||
|
||||
case 'smf_legacy':
|
||||
$this->app_key = 'smf';
|
||||
$this->save();
|
||||
break;
|
||||
|
||||
case 'vbulletin_legacy':
|
||||
case 'vbulletin_legacy36':
|
||||
case 'vbulletin_subs':
|
||||
case 'vbblog':
|
||||
case 'vbdynamics':
|
||||
$this->app_key = 'vbulletin';
|
||||
$this->save();
|
||||
break;
|
||||
|
||||
case 'vb5connect':
|
||||
$this->app_key = 'vbulletin5';
|
||||
$this->save();
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'IPS\\convert\\Software\\' . ucwords( $this->_data['sw'] ) . '\\' . ucwords( $this->_data['app_key'] ) ) )
|
||||
@@ -650,7 +686,44 @@ class _App extends \IPS\Patterns\ActiveRecord
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set running flag
|
||||
*
|
||||
* @param string $method Method name
|
||||
* @param bool $status Flag status
|
||||
*/
|
||||
public function setRunningFlag( $method, $status )
|
||||
{
|
||||
$running = isset( $this->_session['running'] ) ? $this->_session['running'] : array();
|
||||
|
||||
/* If setting running flag, set to a timestamp */
|
||||
if( $status === TRUE )
|
||||
{
|
||||
$status = time();
|
||||
}
|
||||
|
||||
$running[ $method ] = $status;
|
||||
|
||||
$this->_session = array_merge( $this->_session, array( 'running' => $running ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get running flag
|
||||
*
|
||||
* @param string $method Method name
|
||||
* @return bool|int False or a timestamp
|
||||
*/
|
||||
public function getRunningFlag( $method )
|
||||
{
|
||||
if( isset( $this->_session['running'][ $method ] ) )
|
||||
{
|
||||
return $this->_session['running'][ $method ];
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,12 @@ abstract class _Library
|
||||
{
|
||||
$completed[] = $method;
|
||||
}
|
||||
$this->software->app->_session = array( 'working' => array(), 'more_info' => $more_info, 'completed' => $completed );
|
||||
|
||||
/* Manually set running flag to save write queries */
|
||||
$running = $this->software->app->_session['running'];
|
||||
$running[ $method ] = FALSE;
|
||||
|
||||
$this->software->app->_session = array( 'working' => array(), 'more_info' => $more_info, 'completed' => $completed, 'running' => $running );
|
||||
unset( $_SESSION['currentKeyValue'] );
|
||||
unset( $_SESSION['convertCountRows'][ $method ] );
|
||||
unset( $_SESSION['convertContinue'] );
|
||||
@@ -194,10 +199,41 @@ abstract class _Library
|
||||
/* Set as last key value */
|
||||
$this->setLastKeyValue( $lastId );
|
||||
|
||||
/* Clear the running flag but only after we've given previous runs a chance to clear */
|
||||
if( $this->software->app->getRunningFlag( $method ) AND $this->software->app->getRunningFlag( $method ) < ( time() - 45 ) )
|
||||
{
|
||||
unset( $_SESSION['convertSkipped'] );
|
||||
$this->software->app->setRunningFlag( $method, FALSE );
|
||||
}
|
||||
|
||||
/* Unset this so we don't do this again. */
|
||||
unset( $_SESSION['convertContinue'] );
|
||||
}
|
||||
|
||||
|
||||
/* Conversion process is still running, process may have broken out of the multiredirector */
|
||||
if( $this->software->app->getRunningFlag( $method ) )
|
||||
{
|
||||
/* Count how many times we've seen this */
|
||||
$_SESSION['convertSkipped'] = ( isset( $_SESSION['convertSkipped'] ) ? $_SESSION['convertSkipped'] : 0 ) + 1;
|
||||
|
||||
/* If we've shown this 5 times, and the flag was set more than 60 seconds ago, there's a good chance something is wrong */
|
||||
if( $_SESSION['convertSkipped'] > 5 AND $this->software->app->getRunningFlag( $method ) < ( time() - 60 ))
|
||||
{
|
||||
unset( $_SESSION['convertSkipped'] );
|
||||
\IPS\Output::i()->error( 'converter_could_not_continue', '2V387/1', 403, '' );
|
||||
}
|
||||
|
||||
/* Generate dots for UI to show that processing is still occuring */
|
||||
$dots = str_repeat( '.', $_SESSION['convertSkipped'] );
|
||||
|
||||
/* Sleep to allow the other process to complete without hammering the server */
|
||||
sleep(5);
|
||||
return array( $data, \IPS\Member::loggedIn()->language()->get( 'waiting_previous_process' ) . $dots, 100 / $total * ( $data ) );
|
||||
}
|
||||
|
||||
/* Set conversion as running */
|
||||
$this->software->app->setRunningFlag( $method, TRUE );
|
||||
|
||||
/* Fetch data from the software */
|
||||
try
|
||||
{
|
||||
@@ -212,7 +248,12 @@ abstract class _Library
|
||||
{
|
||||
$completed[] = $method;
|
||||
}
|
||||
$this->software->app->_session = array( 'working' => array(), 'more_info' => $more_info, 'completed' => $completed );
|
||||
|
||||
/* Manually set running flag to save write queries */
|
||||
$running = $this->software->app->_session['running'];
|
||||
$running[ $method ] = FALSE;
|
||||
|
||||
$this->software->app->_session = array( 'working' => array(), 'more_info' => $more_info, 'completed' => $completed, 'running' => $running );
|
||||
unset( $_SESSION['currentKeyValue'] );
|
||||
unset( $_SESSION['convertContinue'] );
|
||||
return NULL;
|
||||
@@ -221,6 +262,9 @@ abstract class _Library
|
||||
{
|
||||
\IPS\Log::log( $e, 'converters' );
|
||||
|
||||
/* Clear the running flag */
|
||||
$this->software->app->setRunningFlag( $method, FALSE );
|
||||
|
||||
$this->software->app->log( $e->getMessage(), __METHOD__, \IPS\convert\App::LOG_WARNING );
|
||||
throw new \IPS\convert\Exception;
|
||||
}
|
||||
@@ -228,11 +272,18 @@ abstract class _Library
|
||||
{
|
||||
\IPS\Log::log( $e, 'converters' );
|
||||
|
||||
/* Clear the running flag */
|
||||
$this->software->app->setRunningFlag( $method, FALSE );
|
||||
|
||||
$this->software->app->log( $e->getMessage(), __METHOD__, \IPS\convert\App::LOG_WARNING );
|
||||
throw new \IPS\convert\Exception;
|
||||
}
|
||||
|
||||
$this->software->app->_session = array_merge( $this->software->app->_session, array( 'working' => array( $method => $data + static::$perCycle ) ) );
|
||||
|
||||
/* Manually set running flag to save write queries */
|
||||
$running = $this->software->app->_session['running'];
|
||||
$running[ $method ] = FALSE;
|
||||
|
||||
$this->software->app->_session = array_merge( $this->software->app->_session, array( 'working' => array( $method => $data + static::$perCycle ), 'running' => $running ) );
|
||||
return array( $data + static::$perCycle, sprintf( \IPS\Member::loggedIn()->language()->get( 'converted_x_of_x' ), ( $data + static::$perCycle > $total ) ? $total : $data + static::$perCycle, \IPS\Member::loggedIn()->language()->addToStack( $this->getMethodFromMenuRows( $method )['step_title'] ), $total ), 100 / $total * ( $data + static::$perCycle ) );
|
||||
}
|
||||
}
|
||||
@@ -365,6 +416,9 @@ abstract class _Library
|
||||
/* Get the link type */
|
||||
$menuRows = $this->menuRows();
|
||||
|
||||
/* Delete these */
|
||||
$toDelete = array( 'convert_link' => array(), 'convert_link_pms' => array(), 'convert_link_posts' => array(), 'convert_link_topics' => array() );
|
||||
|
||||
foreach( $truncate as $table => $where )
|
||||
{
|
||||
/* Kind of a hacky way to make sure we truncate the right forums archive table */
|
||||
@@ -383,20 +437,55 @@ abstract class _Library
|
||||
{
|
||||
$linkType = $menuRows[ $method ]['link_type'];
|
||||
}
|
||||
|
||||
/* Remove links... we don't really care about which table they are in right now */
|
||||
foreach( array( 'convert_link', 'convert_link_pms', 'convert_link_posts', 'convert_link_topics' ) as $linkTable )
|
||||
{
|
||||
if( $linkType !== NULL )
|
||||
{
|
||||
\IPS\Db::i()->delete( $linkTable, array( "type=? AND app=?", $linkType, $this->software->app->app_id ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( $linkTable, array( "type=? AND app=?", $table, $this->software->app->app_id ) );
|
||||
switch( $linkType )
|
||||
{
|
||||
default:
|
||||
$key = $linkType ?: $table;
|
||||
$toDelete['convert_link'][ $key ] = $key;
|
||||
break;
|
||||
case 'core_message_topics':
|
||||
case 'core_message_posts':
|
||||
$toDelete['convert_link_pms'][ $linkType ] = $linkType;
|
||||
break;
|
||||
case 'forums_topics':
|
||||
$toDelete['convert_link_topics'][ $linkType ] = $linkType;
|
||||
break;
|
||||
case 'forums_posts':
|
||||
$toDelete['convert_link_posts'][ $linkType ] = $linkType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
unset( $_SESSION['currentKeyValue'] );
|
||||
|
||||
foreach( $toDelete AS $table => $links )
|
||||
{
|
||||
if( !\count( $links ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If posts or topics we may be able to truncate */
|
||||
if( \in_array( $table, array( 'convert_link_topics', 'convert_link_posts' ) ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Check for other app data in this table */
|
||||
\IPS\Db::i()->select( 'link_id', $table, array('app<>?', $this->software->app->app_id ), NULL, 1 )->first();
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
/* There isn't any other app data in this table, truncate */
|
||||
\IPS\Db::i()->delete( $table );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( $table, array( \IPS\Db::i()->in( 'type', $links ) . " AND app=?", $this->software->app->app_id ) );
|
||||
}
|
||||
|
||||
/* Clear the running flag */
|
||||
$this->software->app->setRunningFlag( $method, FALSE );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -472,29 +561,71 @@ abstract class _Library
|
||||
(string) \IPS\Http\Url::internal( "app=convert&module=manage&controller=convert&do=finish&id={$appId}" )
|
||||
) ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
abstract public function menuRows();
|
||||
abstract public function menuRows( $rowCounts=FALSE );
|
||||
|
||||
/**
|
||||
* Utility method to run queries for menuRows() data
|
||||
*
|
||||
* @param array $return menuRow() data
|
||||
* @return array
|
||||
* @throws \UnderflowException
|
||||
* @throws \IPS\convert\Exception
|
||||
*/
|
||||
public function getDatabaseRowCounts( array $return )
|
||||
{
|
||||
foreach( $return as $key => $value )
|
||||
{
|
||||
if( isset( $value['ips_rows'] ) AND $value['ips_rows'] instanceof \IPS\Db\Select )
|
||||
{
|
||||
$return[ $key ]['ips_rows'] = (int) $value['ips_rows']->first();
|
||||
}
|
||||
|
||||
if( isset( $return[ $key ]['source_rows']['table'] ) )
|
||||
{
|
||||
$return[ $key ]['source_rows'] = $this->software->countRows( $value['source_rows']['table'], $value['source_rows']['where'] );
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Cache menu row data
|
||||
*/
|
||||
protected $_menuRowCache = array( 'rows' => array(), 'noRows' => array() );
|
||||
|
||||
/**
|
||||
* Get method from menu rows - abstracted to allow 'fake' entries not in menuRows()
|
||||
*
|
||||
* @param string $method Method requested
|
||||
* @param string $method Method requested
|
||||
* @param bool $rowCount Count local rows
|
||||
* @return array
|
||||
*/
|
||||
public function getMethodFromMenuRows( $method )
|
||||
public function getMethodFromMenuRows( $method, $rowCount=FALSE )
|
||||
{
|
||||
$menuRows = $this->menuRows();
|
||||
if( isset( $menuRows[ $method ] ) )
|
||||
$key = $rowCount ? 'rows' : 'noRows';
|
||||
if( isset( $this->_menuRowCache[ $key ][ $method ] ) )
|
||||
{
|
||||
return $menuRows[ $method ];
|
||||
return $this->_menuRowCache[ $key ][ $method ];
|
||||
}
|
||||
|
||||
return array();
|
||||
/* Set to to the cache */
|
||||
$this->_menuRowCache[ $key ] = $this->menuRows( $rowCount );
|
||||
|
||||
/* Cache an empty array for the response */
|
||||
if( !isset( $this->_menuRowCache[ $key ][ $method ] ) )
|
||||
{
|
||||
$this->_menuRowCache[ $key ][ $method ] = array();
|
||||
}
|
||||
|
||||
return $this->_menuRowCache[ $key ][ $method ];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,13 +27,14 @@ class _Blog extends Core
|
||||
* @brief Application
|
||||
*/
|
||||
public $app = 'blog';
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
|
||||
@@ -45,8 +46,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blogs',
|
||||
'step_method' => 'convertBlogs',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'blog_blogs',
|
||||
@@ -57,8 +58,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blog_entries',
|
||||
'step_method' => 'convertBlogEntries',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_entries' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_entries' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertBlogs' ),
|
||||
'link_type' => 'blog_entries',
|
||||
@@ -69,8 +70,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blog_comments',
|
||||
'step_method' => 'convertBlogComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertBlogEntries' ),
|
||||
'link_type' => 'bog_comments',
|
||||
@@ -81,8 +82,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blog_rss_import',
|
||||
'step_method' => 'convertBlogRssImport',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_rss_import' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_rss_import' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertBlogs' ),
|
||||
'link_type' => 'blog_rss_import',
|
||||
@@ -93,8 +94,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_blogs',
|
||||
'step_method' => 'convertClubBlogs',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertClubs' ),
|
||||
'link_type' => 'core_club_blogs'
|
||||
@@ -105,8 +106,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_blog_entries',
|
||||
'step_method' => 'convertClubBlogEntries',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'SUM(blog_entries)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'SUM(blog_entries)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubBlogs' ),
|
||||
'link_type' => 'core_club_blogs_entries',
|
||||
@@ -118,8 +119,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_blog_comments',
|
||||
'step_method' => 'convertClubBlogComments',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'SUM(blog_comments)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'SUM(blog_comments)', 'blog_blogs', array( "blog_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubBlogEntries' ),
|
||||
'link_type' => 'core_club_blogs_comments',
|
||||
@@ -131,8 +132,8 @@ class _Blog extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_blog_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( 'location_key=? AND id1<>? AND id2 IS NULL', 'blog_Entries', 0 ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( 'location_key=? AND id1<>? AND id2 IS NULL', 'blog_Entries', 0 ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => array( 'convertBlogEntries', 'convertBlogComments' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -143,6 +144,12 @@ class _Blog extends Core
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ class _Calendar extends Core
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
|
||||
@@ -42,8 +43,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_calendars',
|
||||
'step_method' => 'convertCalendarCalendars',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_calendars' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_calendars' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'calendar_calendars',
|
||||
@@ -54,8 +55,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_venues',
|
||||
'step_method' => 'convertCalendarVenues',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_venues' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_venues' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCalendarCalendars' ),
|
||||
'link_type' => 'calendar_venues',
|
||||
@@ -66,8 +67,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_events',
|
||||
'step_method' => 'convertCalendarEvents',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_events' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_events' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertCalendarCalendars' ),
|
||||
'link_type' => 'calendar_events',
|
||||
@@ -79,8 +80,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_comments',
|
||||
'step_method' => 'convertCalendarComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'calendar_event_comments',
|
||||
@@ -92,8 +93,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_reviews',
|
||||
'step_method' => 'convertCalendarReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'calendar_event_reviews',
|
||||
@@ -105,8 +106,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_rsvps',
|
||||
'step_method' => 'convertCalendarRsvps',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_rsvp' )->first(),
|
||||
'source_rows' => $this->sofrware->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_rsvp' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'calendar_event_rsvp',
|
||||
@@ -117,8 +118,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_feeds',
|
||||
'step_method' => 'convertCalendarFeeds',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_import_feeds' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_import_feeds' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCalendarCalendars' ),
|
||||
'link_type' => 'calendar_import_feeds',
|
||||
@@ -129,8 +130,8 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_calendar_reminders',
|
||||
'step_method' => 'convertCalendarReminders',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_reminders' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'calendar_event_reminders' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'calendar_reminders',
|
||||
@@ -141,10 +142,10 @@ class _Calendar extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments', array( "location_key=?", 'calendar_Events' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'calendar_Calendar' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCalendarEvents', 'convertCalendarComments', 'convertCalendarReviews' ),
|
||||
'dependencies' => array( 'convertCalendarEvents' ),
|
||||
'link_type' => 'core_attachments',
|
||||
);
|
||||
break;
|
||||
@@ -152,7 +153,13 @@ class _Calendar extends Core
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -210,9 +217,13 @@ class _Calendar extends Core
|
||||
case 'convertCalendarReminders':
|
||||
$return['convertCalendarReminders'] = array( 'calender_reminders' => NULL );
|
||||
break;
|
||||
|
||||
case 'convertAttachments':
|
||||
$return['convertAttachments'] = array( 'core_attachments' => array( "location_key=?", 'calendar_Events' ) );
|
||||
$attachIds = array();
|
||||
foreach( \IPS\Db::i()->select( 'attachment_id', 'core_attachments_map', array( 'location_key=?', 'calendar_Calendar' ) ) AS $attachment )
|
||||
{
|
||||
$attachIds[] = $attachment;
|
||||
}
|
||||
$return['convertAttachments'] = array( 'core_attachments' => \IPS\Db::i()->in( 'attach_id', $attachIds ), 'core_attachments_map' => array( "location_key=?", 'calendar_Calendar' ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -321,6 +332,8 @@ class _Calendar extends Core
|
||||
|
||||
\IPS\Lang::saveCustom( 'calendar', "calendar_calendar_{$inserted_id}", $name );
|
||||
\IPS\Lang::saveCustom( 'calendar', "calendar_calendar_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'calendar', 'perm_type' => 'calendar', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
if ( $info['cal_club_id'] )
|
||||
{
|
||||
@@ -1318,13 +1331,14 @@ class _Calendar extends Core
|
||||
$map['id1_type'] = 'calendar_events';
|
||||
$map['id1_from_parent'] = FALSE;
|
||||
$map['id2_from_parent'] = FALSE;
|
||||
|
||||
/* Some set up */
|
||||
if ( !isset( $info['id3'] ) )
|
||||
if ( !isset( $map['id3'] ) )
|
||||
{
|
||||
$info['id3'] = NULL;
|
||||
$map['id3'] = NULL;
|
||||
}
|
||||
|
||||
if ( is_null( $info['id3'] ) OR $info['id3'] != 'review' )
|
||||
if ( is_null( $map['id3'] ) OR $map['id3'] != 'review' )
|
||||
{
|
||||
$map['id2_type'] = 'calendar_event_comments';
|
||||
}
|
||||
|
||||
@@ -37,16 +37,17 @@ class _Cms extends Core
|
||||
{
|
||||
return parent::getPostConversionInformation() . \IPS\Member::loggedIn()->language()->addToStack( 'convert_cms_info_message' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
$classname = get_class( $this->software );
|
||||
|
||||
foreach( $this->getConvertableItems() as $k => $v )
|
||||
{
|
||||
switch( $k )
|
||||
@@ -60,8 +61,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_blocks',
|
||||
'step_method' => 'convertCmsBlocks',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_blocks' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_blocks' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'cms_blocks',
|
||||
@@ -72,8 +73,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_containers',
|
||||
'step_method' => 'convertCmsContainers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_containers' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_containers' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'cms_containers',
|
||||
@@ -89,8 +90,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_databases',
|
||||
'step_method' => 'convertCmsDatabases',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_databases' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_databases' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'cms_databases',
|
||||
@@ -101,8 +102,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_database_categories',
|
||||
'step_method' => 'convertCmsDatabaseCategories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_categories' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_categories' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCmsDatabases' ),
|
||||
'link_type' => 'cms_database_categories',
|
||||
@@ -114,7 +115,10 @@ class _Cms extends Core
|
||||
$links = array();
|
||||
foreach( \IPS\Db::i()->select( 'database_id', 'cms_databases' ) AS $database )
|
||||
{
|
||||
$count += \IPS\Db::i()->select( 'COUNT(*)', "cms_custom_database_{$database}" )->first();
|
||||
if( $rowCounts )
|
||||
{
|
||||
$count += \IPS\Db::i()->select( 'COUNT(*)', "cms_custom_database_{$database}" )->first();
|
||||
}
|
||||
$links[] = "cms_custom_database_{$database}";
|
||||
}
|
||||
|
||||
@@ -128,7 +132,7 @@ class _Cms extends Core
|
||||
'step_title' => 'convert_cms_database_records',
|
||||
'step_method' => 'convertCmsDatabaseRecords',
|
||||
'ips_rows' => $count,
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertCmsDatabases' ),
|
||||
'link_type' => $links,
|
||||
@@ -140,8 +144,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_database_comments',
|
||||
'step_method' => 'convertCmsDatabaseComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCmsDatabaseRecords' ),
|
||||
'link_type' => 'cms_database_comments',
|
||||
@@ -153,8 +157,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_database_reviews',
|
||||
'step_method' => 'convertCmsDatabaseReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_database_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertCmsDatabaseRecords' ),
|
||||
'link_type' => 'cms_database_reviews',
|
||||
@@ -166,8 +170,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_folders',
|
||||
'step_method' => 'convertCmsFolders',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_folders' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_folders' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'cms_folders',
|
||||
@@ -184,8 +188,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_media',
|
||||
'step_method' => 'convertCmsMedia',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_media' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_media' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'cms_media',
|
||||
@@ -196,8 +200,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_media_folders',
|
||||
'step_method' => 'convertCmsMediaFolders',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_media_folders' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_media_folders' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'cms_media_folders',
|
||||
@@ -214,8 +218,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_pages',
|
||||
'step_method' => 'convertCmsPages',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_pages' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'cms_pages' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'cms_pages',
|
||||
@@ -232,8 +236,8 @@ class _Cms extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_cms_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( \IPS\Db::i()->in( 'id3', $in ) . " AND location_key=?", 'cms_Records' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( \IPS\Db::i()->in( 'id3', $in ) . " AND location_key=?", 'cms_Records' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
#'dependencies' => array( 'convertCmsDatabaseRecords', 'convertCmsDatabaseComments', 'convertCmsDatabaseReviews' ),
|
||||
'dependencies' => array( 'convertCmsDatabaseRecords' ), //TODO dear code reviewer... please review this part.. i had to remove it for my further work
|
||||
@@ -245,6 +249,12 @@ class _Cms extends Core
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -546,6 +556,8 @@ class _Cms extends Core
|
||||
$inserted_id = \IPS\Db::i()->insert( 'cms_pages', $info );
|
||||
$this->software->app->addLink( $inserted_id, $id, 'cms_pages' );
|
||||
\IPS\Lang::saveCustom( 'cms', "cms_page_{$inserted_id}", $info['page_name'] );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'pages', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
return $inserted_id;
|
||||
}
|
||||
@@ -730,6 +742,8 @@ class _Cms extends Core
|
||||
|
||||
\IPS\Lang::saveCustom( 'cms', "content_block_name_{$inserted_id}", $name );
|
||||
\IPS\Lang::saveCustom( 'cms', "content_block_name_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'blocks', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
return $inserted_id;
|
||||
}
|
||||
@@ -1060,6 +1074,8 @@ class _Cms extends Core
|
||||
|
||||
$inserted_id = \IPS\Db::i()->insert( 'cms_databases', $info );
|
||||
$this->software->app->addLink( $inserted_id, $id, 'cms_databases' );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'databases', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
/* And now fields */
|
||||
$validFields = array_merge( static::$fieldTypes, \IPS\cms\Fields::$additionalFieldTypes, array( 'Youtube', 'Spotify', 'Soundcloud' ) );
|
||||
@@ -1297,6 +1313,8 @@ class _Cms extends Core
|
||||
\IPS\Lang::saveCustom( 'cms', "content_field_{$fieldInsertedId}", $fieldName );
|
||||
\IPS\Lang::saveCustom( 'cms', "content_field_{$fieldInsertedId}_desc", $fieldDesc );
|
||||
$this->software->app->addLink( $fieldInsertedId, $fieldId, 'cms_database_fields' );
|
||||
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'fields', 'perm_type_id' => $fieldInsertedId, 'perm_view' => '' ) );
|
||||
|
||||
if ( $haveTitleField AND $titleField == 0 )
|
||||
{
|
||||
@@ -1777,6 +1795,7 @@ class _Cms extends Core
|
||||
$this->software->app->addLink( $inserted_id, $id, 'cms_database_categories' );
|
||||
|
||||
\IPS\Db::i()->update( 'cms_database_categories', array( "category_parent_id" => $inserted_id ), array( "category_conv_parent=? AND category_conv_parent<>?", $id, 0 ) );
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'cms', 'perm_type' => 'categories', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
\IPS\Lang::saveCustom( 'cms', "content_cat_name_{$inserted_id}", $info['category_name'] );
|
||||
\IPS\Lang::saveCustom( 'cms', "content_cat_name_{$inserted_id}_desc", $desc );
|
||||
|
||||
@@ -29,9 +29,10 @@ class _Core extends \IPS\convert\Library
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
|
||||
@@ -43,8 +44,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_acronyms',
|
||||
'step_method' => 'convertAcronyms',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_acronyms' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_acronyms' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_acronyms',
|
||||
@@ -64,8 +65,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_administrators',
|
||||
'step_method' => 'convertAdministrators',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_admin_permission_rows' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_admin_permission_rows' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_administrators',
|
||||
@@ -76,8 +77,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_announcements',
|
||||
'step_method' => 'convertAnnouncements',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_announcements' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_announcements' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_announcements',
|
||||
@@ -88,8 +89,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -100,8 +101,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_banfilters',
|
||||
'step_method' => 'convertBanfilters',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_banfilters' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_banfilters' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_banfilters',
|
||||
@@ -112,8 +113,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[$k] = array(
|
||||
'step_title' => 'convert_custom_bbcode',
|
||||
'step_method' => 'convertCustomBbcode',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'custom_bbcode' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'custom_bbcode' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_bbcode',
|
||||
@@ -124,8 +125,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_dname_changes',
|
||||
'step_method' => 'convertDnameChanges',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history', array( 'log_app=? AND log_type=?', 'core', 'display_name' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history', array( 'log_app=? AND log_type=?', 'core', 'display_name' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_dname_changes',
|
||||
@@ -136,8 +137,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_edit_history',
|
||||
'step_method' => 'convertEditHistory',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_edit_history' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_edit_history' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_edit_history',
|
||||
@@ -148,8 +149,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_emoticons',
|
||||
'step_method' => 'convertEmoticons',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_emoticons' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_emoticons' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_emoticons',
|
||||
@@ -160,8 +161,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_groups',
|
||||
'step_method' => 'convertGroups',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_groups' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_groups' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_groups',
|
||||
@@ -172,8 +173,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_ignored_users',
|
||||
'step_method' => 'convertIgnoredUsers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_ignored_users' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_ignored_users' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_ignored_users',
|
||||
@@ -184,8 +185,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_leader_groups',
|
||||
'step_method' => 'convertLeaderGroups',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_leaders_groups' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_leaders_groups' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_leader_groups',
|
||||
@@ -211,8 +212,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_leaders',
|
||||
'step_method' => 'convertLeaders',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_leaders' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_leaders' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_leaders',
|
||||
@@ -223,8 +224,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_ranks',
|
||||
'step_method' => 'convertRanks',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_ranks' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_ranks' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_member_ranks',
|
||||
@@ -235,8 +236,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_reactions',
|
||||
'step_method' => 'convertReactions',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_reactions' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_reactions' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_reactions',
|
||||
@@ -247,8 +248,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_statuses',
|
||||
'step_method' => 'convertStatuses',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_updates' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_updates' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_member_status_updates',
|
||||
@@ -259,8 +260,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_status_replies',
|
||||
'step_method' => 'convertStatusReplies',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_replies' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_replies' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertMembers', 'convertStatuses' ),
|
||||
'link_type' => 'core_member_status_replies',
|
||||
@@ -284,8 +285,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_members',
|
||||
'step_method' => 'convertMembers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_members',
|
||||
@@ -296,8 +297,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_member_history',
|
||||
'step_method' => 'convertMemberHistory',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_member_history',
|
||||
@@ -308,8 +309,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_warn_actions',
|
||||
'step_method' => 'convertWarnActions',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members_warn_actions' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members_warn_actions' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_members_warn_actions',
|
||||
@@ -320,8 +321,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_warn_reasons',
|
||||
'step_method' => 'convertWarnReasons',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members_warn_reasons' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members_warn_reasons' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_members_warn_reasons',
|
||||
@@ -332,8 +333,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_private_messages',
|
||||
'step_method' => 'convertPrivateMessages',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_message_topics' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_message_topics' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => array( 'core_message_topics', 'core_message_topic_user_map' ),
|
||||
@@ -344,8 +345,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_private_message_replies',
|
||||
'step_method' => 'convertPrivateMessageReplies',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_message_posts' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_message_posts' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertPrivateMessages' ),
|
||||
'link_type' => array( 'core_message_posts' ),
|
||||
@@ -357,8 +358,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_moderators',
|
||||
'step_method' => 'convertModerators',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_moderators' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_moderators' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_members',
|
||||
@@ -369,8 +370,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_profile_field_groups',
|
||||
'step_method' => 'convertProfileFieldGroups',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_groups' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_groups' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_pfields_groups',
|
||||
@@ -388,8 +389,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_profile_fields',
|
||||
'step_method' => 'convertProfileFields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_data' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_data' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_pfields_data',
|
||||
@@ -400,8 +401,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_profanity_filters',
|
||||
'step_method' => 'convertProfanityFilters',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_profanity_filters' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_profanity_filters' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_profanity_filters',
|
||||
@@ -412,8 +413,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_question_and_answers',
|
||||
'step_method' => 'convertQuestionAndAnswers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_question_and_answer' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_question_and_answer' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_question_and_answer',
|
||||
@@ -424,8 +425,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_report_comments',
|
||||
'step_method' => 'convertReportComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_rc_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_rc_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_report_comments',
|
||||
@@ -436,8 +437,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_reputation_levels',
|
||||
'step_method' => 'convertReputationLevels',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_reputation_levels' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_reputation_levels' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'core_reputation_levels',
|
||||
@@ -448,8 +449,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_clubs',
|
||||
'step_method' => 'convertClubs',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_clubs'
|
||||
@@ -460,8 +461,8 @@ class _Core extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_members',
|
||||
'step_method' => 'convertClubMembers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs_memberships' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_clubs_memberships' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertClubs' ),
|
||||
'link_type' => 'core_clubs_memberships'
|
||||
@@ -471,7 +472,13 @@ class _Core extends \IPS\convert\Library
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -764,7 +771,7 @@ class _Core extends \IPS\convert\Library
|
||||
|
||||
if ( isset( $info['row_updated'] ) )
|
||||
{
|
||||
if ( $info['row_update'] instanceof \IPS\DateTIme )
|
||||
if ( $info['row_update'] instanceof \IPS\DateTime )
|
||||
{
|
||||
$info['row_updated'] = $info['row_updated']->getTimestamp();
|
||||
}
|
||||
@@ -893,7 +900,7 @@ class _Core extends \IPS\convert\Library
|
||||
|
||||
if ( !isset( $info['announce_page_location'] ) )
|
||||
{
|
||||
$info['announce_page_location'] = 'sidebar';
|
||||
$info['announce_page_location'] = array( 'sidebar' );
|
||||
}
|
||||
elseif( !is_array( $info['announce_page_location'] ) )
|
||||
{
|
||||
@@ -1047,16 +1054,17 @@ class _Core extends \IPS\convert\Library
|
||||
|
||||
$info['attach_location'] = (string) $file;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
$this->software->app->log( 'attachment_creation_fail', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
return FALSE;
|
||||
}
|
||||
catch( \ErrorException $e )
|
||||
{
|
||||
$this->software->app->log( $e->getMessage(), __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
return FALSE;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
\IPS\Log::log( array( 'exception' => $e, 'file' => $info ), 'converter_attachment_fail' );
|
||||
$this->software->app->log( 'attachment_creation_fail_exception', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( $file === NULL )
|
||||
{
|
||||
@@ -1090,14 +1098,14 @@ class _Core extends \IPS\convert\Library
|
||||
|
||||
$info['attach_thumb_location'] = (string) $thumbnail;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
$this->software->app->log( 'attachment_thumb_creation_fail', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
}
|
||||
catch( \ErrorException $e )
|
||||
{
|
||||
$this->software->app->log( $e->getMessage(), __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
$this->software->app->log( 'attachment_thumb_creation_fail', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['attach_id'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1674,7 +1682,6 @@ class _Core extends \IPS\convert\Library
|
||||
$filepathx2 = NULL;
|
||||
}
|
||||
$filex2 = \IPS\File::create( 'core_Emoticons', $info['filenamex2'], $filedatax2, 'emoticons', FALSE, NULL, static::$obscureFilenames );
|
||||
unset( $info['filenamex2'] );
|
||||
$info['image_2x'] = (string) $filex2;
|
||||
}
|
||||
catch( \Exception $e )
|
||||
@@ -1686,7 +1693,8 @@ class _Core extends \IPS\convert\Library
|
||||
$info['image_2x'] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
unset( $info['filenamex2'] );
|
||||
|
||||
if ( $haveID )
|
||||
{
|
||||
$id = $info['id'];
|
||||
@@ -3209,7 +3217,7 @@ class _Core extends \IPS\convert\Library
|
||||
$photo = \IPS\File::create( 'core_Profile', $profilePhotoName, $profileFileData );
|
||||
$info['pp_photo_type'] = 'custom';
|
||||
$info['pp_main_photo'] = (string) $photo;
|
||||
$info['pp_thumb_photo'] = (string) $photo->thumbnail( 'core_Profile', \IPS\PHOTO_THUMBNAIL_SIZE, \IPS\PHOTO_THUMBNAIL_SIZE );
|
||||
$info['pp_thumb_photo'] = (string) $photo->thumbnail( 'core_Profile', \IPS\PHOTO_THUMBNAIL_SIZE, \IPS\PHOTO_THUMBNAIL_SIZE, TRUE );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
@@ -4359,7 +4367,7 @@ class _Core extends \IPS\convert\Library
|
||||
'friend_only' => NULL,
|
||||
);
|
||||
|
||||
$permId = \IPS\Db::i()->insert( 'core_permission_index', $perm );
|
||||
$permId = \IPS\Db::i()->replace( 'core_permission_index', $perm );
|
||||
$perm['perm_id'] = $permId;
|
||||
}
|
||||
|
||||
@@ -4545,16 +4553,16 @@ class _Core extends \IPS\convert\Library
|
||||
$name = $info['pf_name'];
|
||||
unset( $info['pf_name'] );
|
||||
}
|
||||
|
||||
if ( !isset( $info['pf_desc'] ) )
|
||||
|
||||
if ( !isset( $info['pf_desc'] ) OR empty( $info['pf_desc'] ) )
|
||||
{
|
||||
$desc = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$desc = $info['pf_desc'];
|
||||
unset( $info['pf_desc'] );
|
||||
}
|
||||
unset( $info['pf_desc'] );
|
||||
|
||||
if ( isset( $info['pf_content'] ) )
|
||||
{
|
||||
@@ -4613,47 +4621,38 @@ class _Core extends \IPS\convert\Library
|
||||
{
|
||||
$info['pf_format'] = NULL;
|
||||
}
|
||||
|
||||
if ( isset( $info['pf_group_id'] ) )
|
||||
|
||||
/* !Profile Field Group */
|
||||
try
|
||||
{
|
||||
try
|
||||
if ( isset( $info['pf_group_id'] ) )
|
||||
{
|
||||
$info['pf_group_id'] = $this->software->app->getLink( $info['pf_group_id'], 'core_pfields_groups' );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
/* Create an orphan group */
|
||||
$info['pf_group_id'] = $this->convertProfileFieldGroup( array(
|
||||
'pf_group_id' => '__orphaned__',
|
||||
'pf_group_name' => 'Converted',
|
||||
) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
else
|
||||
{
|
||||
$info['pf_group_id'] = $this->software->app->getLink( '__orphaned__', 'core_pfields_groups' );
|
||||
}
|
||||
|
||||
/* Make sure it exists */
|
||||
try
|
||||
{
|
||||
\IPS\Db::i()->select( 'pf_group_id', 'core_pfields_groups', array( 'pf_group_id=?', $info['pf_group_id'] ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
/* Delete the relation if it no longer exists */
|
||||
$this->software->app->deleteLink( '__orphaned__', 'core_pfields_groups' );
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
/* Make sure it exists */
|
||||
try
|
||||
{
|
||||
$info['pf_group_id'] = $this->convertProfileFieldGroup( array(
|
||||
'pf_group_id' => '__orphaned__',
|
||||
'pf_group_name' => 'Converted',
|
||||
) );
|
||||
\IPS\Db::i()->select( 'pf_group_id', 'core_pfields_groups', array( 'pf_group_id=?', $info['pf_group_id'] ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
/* Delete the relation if it no longer exists */
|
||||
$this->software->app->deleteLink( '__orphaned__', 'core_pfields_groups' );
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
/* Create an orphan group */
|
||||
$info['pf_group_id'] = $this->convertProfileFieldGroup( array(
|
||||
'pf_group_id' => '__orphaned__',
|
||||
'pf_group_name' => 'Converted',
|
||||
) );
|
||||
}
|
||||
|
||||
if ( !isset( $info['pf_search_type'] ) )
|
||||
|
||||
@@ -28,12 +28,12 @@ class _Downloads extends Core
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
$classname = get_class( $this->software );
|
||||
|
||||
foreach( $this->getConvertableItems() as $k => $v )
|
||||
{
|
||||
@@ -43,8 +43,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsCfields',
|
||||
'step_title' => 'convert_downloads_cfields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_cfields' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_cfields' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'downloads_cfields',
|
||||
@@ -62,8 +62,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsCategories',
|
||||
'step_title' => 'convert_downloads_categories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'downloads_categories',
|
||||
@@ -85,8 +85,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsFiles',
|
||||
'step_title' => 'convert_downloads_files',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'downloads_files',
|
||||
@@ -98,8 +98,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsComments',
|
||||
'step_title' => 'convert_downloads_comments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertDownloadsFiles' ),
|
||||
'link_type' => 'downloads_comments',
|
||||
@@ -111,8 +111,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertDownloadsReviews',
|
||||
'step_title' => 'convert_downloads_reviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertDownloadsFiles' ),
|
||||
'link_type' => 'downloads_reviews',
|
||||
@@ -124,8 +124,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_downloads_categories',
|
||||
'step_method' => 'convertClubDownloadsCategories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories', array( "cclub_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubs' ),
|
||||
'link_type' => 'core_club_downloads_categories',
|
||||
@@ -136,8 +136,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_downloads_files',
|
||||
'step_method' => 'convertClubDownloadsFiles',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertClubDownloadsCategories' ),
|
||||
'link_type' => 'core_club_downloads_files'
|
||||
@@ -148,8 +148,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_downloads_comments',
|
||||
'step_method' => 'convertClubDownloadsComments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments', array( \IPS\Db::i()->in( 'comment_file_id', \IPS\Db::i()->select( 'file_id', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ) ) ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments', array( \IPS\Db::i()->in( 'comment_file_id', \IPS\Db::i()->select( 'file_id', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ) ) ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubDownloadsFiles' ),
|
||||
'link_type' => 'core_club_downloads_comments',
|
||||
@@ -160,8 +160,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_downloads_reviews',
|
||||
'step_method' => 'convertClubDownloadsReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files_reviews', array( \IPS\Db::i()->in( 'review_file_id', \IPS\Db::i()->select( 'file_id', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ) ) ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files_reviews', array( \IPS\Db::i()->in( 'review_file_id', \IPS\Db::i()->select( 'file_id', 'downloads_files', array( \IPS\Db::i()->in( 'file_category_id', \IPS\Db::i()->select( 'cid', 'downloads_categories', array( "cclub_id IS NOT NULL" ) ) ) ) ) ) ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubDownloadsFiles' ),
|
||||
'link_type' => 'core_club_downloads_reviews',
|
||||
@@ -172,8 +172,8 @@ class _Downloads extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertAttachments',
|
||||
'step_title' => 'convert_attachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'downloads_Downloads' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'downloads_Downloads' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertDownloadsFiles', 'convertDownloadsComments', 'convertDownloadsReviews' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -183,7 +183,13 @@ class _Downloads extends Core
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -222,7 +228,11 @@ class _Downloads extends Core
|
||||
break;
|
||||
|
||||
case 'convertDownloadsFiles':
|
||||
$return['convertDownloadsFiles'] = array( 'downloads_files' => NULL, 'downloads_files_records' => NULL );
|
||||
$return['convertDownloadsFiles'] = array(
|
||||
'downloads_files' => NULL,
|
||||
'downloads_files_records' => NULL,
|
||||
'core_tags' => array( 'tag_meta_app=? AND tag_meta_area=?', 'downloads', 'downloads' )
|
||||
);
|
||||
break;
|
||||
|
||||
case 'convertDownloadsComments':
|
||||
@@ -700,12 +710,12 @@ class _Downloads extends Core
|
||||
|
||||
$inserted_id = \IPS\Db::i()->insert( 'downloads_categories', $info );
|
||||
$this->software->app->addLink( $inserted_id, $id, 'downloads_categories' );
|
||||
|
||||
|
||||
|
||||
\IPS\Lang::saveCustom( 'downloads', "downloads_category_{$inserted_id}", $name );
|
||||
\IPS\Lang::saveCustom( 'downloads', "downloads_category_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->update( 'downloads_categories', array( "cparent" => $inserted_id ), array( "cconv_parent=? AND cconv_parent<>?", $id, 0 ) );
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'downloads', 'perm_type' => 'category', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
if ( $info['cclub_id'] )
|
||||
{
|
||||
@@ -1281,7 +1291,7 @@ class _Downloads extends Core
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
$this->software->app->log( 'download_review_missing_image', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['review_id'] );
|
||||
$this->software->app->log( 'download_review_missing_file', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['review_id'] );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,10 @@ class _Forums extends Core
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
$classname = get_class( $this->software );
|
||||
@@ -46,8 +47,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_forums',
|
||||
'step_method' => 'convertForumsForums',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'forums_forums',
|
||||
@@ -58,8 +59,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_topics',
|
||||
'step_method' => 'convertForumsTopics',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_topics' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_topics' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertForumsForums' ),
|
||||
'link_type' => 'forums_topics',
|
||||
@@ -70,8 +71,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_posts',
|
||||
'step_method' => 'convertForumsPosts',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertForumsTopics' ),
|
||||
'link_type' => 'forums_posts',
|
||||
@@ -83,8 +84,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_archive_posts',
|
||||
'step_method' => 'convertForumsArchivePosts',
|
||||
'ips_rows' => \IPS\forums\Topic\ArchivedPost::db()->select( 'COUNT(*)', 'forums_archive_posts' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\forums\Topic\ArchivedPost::db()->select( 'COUNT(*)', 'forums_archive_posts' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertForumsTopics' ),
|
||||
'link_type' => 'forums_posts',
|
||||
@@ -95,8 +96,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_topic_multimods',
|
||||
'step_method' => 'convertForumsTopicMultimods',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_topic_mmod' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_topic_mmod' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertForumsForums' ),
|
||||
'link_type' => 'forums_topic_mmod',
|
||||
@@ -107,8 +108,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_rss_imports',
|
||||
'step_method' => 'convertForumsRssImports',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_rss_import' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_rss_import' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertForumsForums' ),
|
||||
'link_type' => 'forums_rss_import',
|
||||
@@ -119,8 +120,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_rss_imported',
|
||||
'step_method' => 'convertForumsRssImported',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_rss_imported' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_rss_imported' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertForumsTopics', 'convertForumsRssImports' ),
|
||||
'link_type' => 'forums_rss_imported',
|
||||
@@ -131,8 +132,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_question_ratings',
|
||||
'step_method' => 'convertForumsQuestionRatings',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_question_ratings' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_question_ratings' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertForumsTopics' ),
|
||||
'link_type' => 'forums_question_ratings',
|
||||
@@ -143,8 +144,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_answer_ratings',
|
||||
'step_method' => 'convertForumsAnswerRatings',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_answer_ratings' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_answer_ratings' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertForumsPosts' ),
|
||||
'link_type' => 'forums_answer_ratings',
|
||||
@@ -155,8 +156,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_forums_attachments',
|
||||
'step_method' => 'convertAttachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'forums_Forums' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'forums_Forums' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 50,
|
||||
'dependencies' => array( 'convertForumsPosts' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -167,8 +168,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_forums',
|
||||
'step_method' => 'convertClubForums',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums', array( "club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums', array( "club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertForumsForums' ),
|
||||
'link_type' => 'core_club_forums'
|
||||
@@ -179,8 +180,8 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_topics',
|
||||
'step_method' => 'convertClubTopics',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'COUNT(tid)', 'forums_topics', array( 'forum_id IN ( ' . (string) \IPS\Db::i()->select( 'id', 'forums_forums', array( "club_id IS NOT NULL" ) ) . ')' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(tid)', 'forums_topics', array( 'forum_id IN ( ' . (string) \IPS\Db::i()->select( 'id', 'forums_forums', array( "club_id IS NOT NULL" ) ) . ')' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubForums' ),
|
||||
'link_type' => 'core_club_topics'
|
||||
@@ -191,10 +192,10 @@ class _Forums extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_posts',
|
||||
'step_method' => 'convertClubPosts',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'COUNT(pid)', 'forums_forums', array( "club_id IS NOT NULL" ) )
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(pid)', 'forums_forums', array( "club_id IS NOT NULL" ) )
|
||||
->join( 'forums_topics', 'forums_topics.forum_id=forums_forums.id')
|
||||
->join( 'forums_posts', 'forums_posts.topic_id=forums_topics.tid')->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
->join( 'forums_posts', 'forums_posts.topic_id=forums_topics.tid'),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubTopics' ),
|
||||
'link_type' => 'core_club_posts'
|
||||
@@ -204,6 +205,12 @@ class _Forums extends Core
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -211,17 +218,18 @@ class _Forums extends Core
|
||||
/**
|
||||
* Get method from menu rows - abstracted to allow 'fake' entries not in menuRows()
|
||||
*
|
||||
* @param string $method Method requested
|
||||
* @param string $method Method requested
|
||||
* @param bool $rowCount Count local rows
|
||||
* @return array
|
||||
*/
|
||||
public function getMethodFromMenuRows( $method )
|
||||
public function getMethodFromMenuRows( $method, $rowCount=FALSE )
|
||||
{
|
||||
if( $method == 'convertForumsBoards' )
|
||||
{
|
||||
$method = 'convertForumsForums';
|
||||
}
|
||||
|
||||
return parent::getMethodFromMenuRows( $method );
|
||||
return parent::getMethodFromMenuRows( $method, $rowCount );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -824,6 +832,7 @@ class _Forums extends Core
|
||||
\IPS\Lang::saveCustom( 'forums', "forums_forum_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->update( 'forums_forums', array( "parent_id" => $inserted_id ), array( "conv_parent=? AND conv_parent<>?", $id, 0 ) );
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'forums', 'perm_type' => 'forum', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
if ( $info['club_id'] )
|
||||
{
|
||||
|
||||
@@ -28,9 +28,10 @@ class _Gallery extends Core
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
$classname = get_class( $this->software );
|
||||
@@ -43,8 +44,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryCategories',
|
||||
'step_title' => 'convert_gallery_categories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'gallery_categories',
|
||||
@@ -63,8 +64,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryAlbums',
|
||||
'step_title' => 'convert_gallery_albums',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_albums' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_albums' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'gallery_albums',
|
||||
@@ -75,8 +76,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryAlbumComments',
|
||||
'step_title' => 'convert_gallery_album_comments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_album_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_album_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertGalleryAlbums' ),
|
||||
'link_type' => 'gallery_album_comments',
|
||||
@@ -88,8 +89,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryAlbumReviews',
|
||||
'step_title' => 'convert_gallery_album_reviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_album_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_album_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertGalleryAlbums' ),
|
||||
'link_type' => 'gallery_album_reviews',
|
||||
@@ -114,8 +115,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryImages',
|
||||
'step_title' => 'convert_gallery_images',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_images' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_images' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'gallery_images',
|
||||
@@ -127,8 +128,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryComments',
|
||||
'step_title' => 'convert_gallery_comments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_comments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_comments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertGalleryImages' ),
|
||||
'link_type' => 'gallery_comments',
|
||||
@@ -140,8 +141,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertGalleryReviews',
|
||||
'step_title' => 'convert_gallery_reviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_reviews' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertGalleryImages' ),
|
||||
'link_type' => 'gallery_reviews',
|
||||
@@ -153,8 +154,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_gallery_categories',
|
||||
'step_method' => 'convertClubGalleryCategories',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertGalleryImages' ),
|
||||
'link_type' => 'core_club_gallery_categories'
|
||||
@@ -165,8 +166,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_gallery_images',
|
||||
'step_method' => 'convertClubGalleryImages',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'SUM(category_count_imgs)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'SUM(category_count_imgs)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertClubGalleryCategories' ),
|
||||
'link_type' => 'core_club_gallery_images'
|
||||
@@ -177,8 +178,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_gallery_comments',
|
||||
'step_method' => 'convertClubGalleryComments',
|
||||
'ips_rows' => (int) \IPS\Db::i()->select( 'SUM(category_count_comments)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'SUM(category_count_comments)', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubGalleryImages' ),
|
||||
'link_type' => 'core_club_gallery_comments'
|
||||
@@ -189,8 +190,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_club_gallery_reviews',
|
||||
'step_method' => 'convertClubGalleryReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_reviews', array( \IPS\Db::i()->in( 'review_image_id', \IPS\Db::i()->select( 'image_id', 'gallery_images', array( \IPS\Db::i()->in( 'image_category_id', \IPS\Db::i()->select( 'category_id', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ) ) ) ) ) ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'gallery_reviews', array( \IPS\Db::i()->in( 'review_image_id', \IPS\Db::i()->select( 'image_id', 'gallery_images', array( \IPS\Db::i()->in( 'image_category_id', \IPS\Db::i()->select( 'category_id', 'gallery_categories', array( "category_club_id IS NOT NULL" ) ) ) ) ) ) ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertClubGalleryImages' ),
|
||||
'link_type' => 'core_club_gallery_reviews'
|
||||
@@ -213,8 +214,8 @@ class _Gallery extends Core
|
||||
$return[ $k ] = array(
|
||||
'step_method' => 'convertAttachments',
|
||||
'step_title' => 'convert_attachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'gallery_Images' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( "location_key=?", 'gallery_Images' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -224,7 +225,13 @@ class _Gallery extends Core
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -384,10 +391,18 @@ class _Gallery extends Core
|
||||
$info['category_cover_img_id'] = 0;
|
||||
$info['category_last_img_id'] = 0;
|
||||
$info['category_last_img_date'] = 0;
|
||||
|
||||
if ( !isset( $info['category_sort_options'] ) OR !in_array( $info['category_sort_options'], array( 'updated', 'rating', 'num_comments' ) ) )
|
||||
|
||||
/* Album Sort Order */
|
||||
$sortOrders = array( 'album_last_img_date', 'album_last_comment', 'album_rating_aggregate', 'album_comments','album_reviews', 'album_name', 'album_count_comments', 'album_count_imgs' );
|
||||
if ( !isset( $info['category_sort_options'] ) OR !in_array( $info['category_sort_options'], $sortOrders ) )
|
||||
{
|
||||
$info['category_sort_options'] = NULL;
|
||||
$info['category_sort_options'] = 'album_last_img_date';
|
||||
}
|
||||
|
||||
/* Image Sort Order */
|
||||
if ( !isset( $info['category_sort_options_img'] ) OR !in_array( $info['category_sort_options_img'], array( 'updated', 'last_comment', 'title', 'rating', 'date', 'num_comments', 'num_reviews', 'views' ) ) )
|
||||
{
|
||||
$info['category_sort_options_img'] = 'updated';
|
||||
}
|
||||
|
||||
/* One Defaults */
|
||||
@@ -445,6 +460,7 @@ class _Gallery extends Core
|
||||
\IPS\Lang::saveCustom( 'gallery', "gallery_category_{$inserted_id}_desc", $desc );
|
||||
|
||||
\IPS\Db::i()->update( 'gallery_categories', array( "category_parent_id" => $inserted_id ), array( "category_conv_parent=? AND category_conv_parent<>?", $id, 0 ) );
|
||||
\IPS\Db::i()->insert( 'core_permission_index', array( 'app' => 'gallery', 'perm_type' => 'category', 'perm_type_id' => $inserted_id, 'perm_view' => '' ) );
|
||||
|
||||
if ( $info['category_club_id'] )
|
||||
{
|
||||
|
||||
@@ -28,9 +28,10 @@ class _Nexus extends \IPS\convert\Library
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
*
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows()
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
{
|
||||
$return = array();
|
||||
$classname = get_class( $this->software );
|
||||
@@ -43,8 +44,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_customer_fields',
|
||||
'step_method' => 'convertNexusCustomerFields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_fields' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_fields' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_customer_fields'
|
||||
@@ -61,8 +62,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_customers',
|
||||
'step_method' => 'convertNexusCustomers',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customers' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customers' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'nexus_customers',
|
||||
@@ -73,8 +74,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_customer_addresses',
|
||||
'step_method' => 'convertNexusCustomerAddresses',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_addresses' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_addresses' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusCustomers' ),
|
||||
'link_type' => 'nexus_customer_addresses',
|
||||
@@ -85,8 +86,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_customer_history',
|
||||
'step_method' => 'convertNexusCustomerHistory',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history', array( 'log_app=?', 'nexus' ) )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_member_history', array( 'log_app=?', 'nexus' ) ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusCustomers' ),
|
||||
'link_type' => 'nexus_customer_history',
|
||||
@@ -97,8 +98,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_alternate_contacts',
|
||||
'step_method' => 'convertNexusAlternateContacts',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_alternate_contacts' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_alternate_contacts' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusCustomers' ),
|
||||
'link_type' => 'nexus_alternate_contacts'
|
||||
@@ -109,8 +110,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_notes',
|
||||
'step_method' => 'convertNexusNotes',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_notes' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_notes' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertNexusCustomers' ),
|
||||
'linK_type' => 'nexus_notes'
|
||||
@@ -121,8 +122,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_package_groups',
|
||||
'step_method' => 'convertNexusPackageGroups',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_package_groups' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_package_groups' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_package_groups'
|
||||
@@ -133,8 +134,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_package_fields',
|
||||
'step_method' => 'convertNexusPackageFields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_package_fields' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_package_fields' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_package_fields'
|
||||
@@ -155,8 +156,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_packages',
|
||||
'step_method' => 'convertNexusPackages',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_packages' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_packages' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'nexus_packages',
|
||||
@@ -168,8 +169,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_reviews',
|
||||
'step_method' => 'convertNexusReviews',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_reviews' )->first(),
|
||||
'source_rows' => $this->software->sourceRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_reviews' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertNexusPackages' ),
|
||||
'link_type' => 'nexus_reviews',
|
||||
@@ -181,8 +182,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_coupons',
|
||||
'step_method' => 'convertNexusCoupons',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_coupons' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_coupons' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusPackages' ),
|
||||
'link_type' => 'nexus_coupons'
|
||||
@@ -193,8 +194,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_invoices',
|
||||
'step_method' => 'convertNexusInvoices',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_invoices' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_invoices' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertNexusCustomers', 'convertNexusPackages' ),
|
||||
'link_type' => 'nexus_invoices',
|
||||
@@ -205,8 +206,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_transactions',
|
||||
'step_method' => 'convertNexusTransactions',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertNexusCustomers', 'convertNexusInvoices' ),
|
||||
'link_type' => 'nexus_transactions',
|
||||
@@ -217,8 +218,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_purchases',
|
||||
'step_method' => 'convertNexusPurchases',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1000,
|
||||
'dependencies' => array( 'convertNexusCustomers', 'convertNexusPackages', 'convertNexusInvoices' ),
|
||||
'link_type' => 'nexus_purchases'
|
||||
@@ -229,8 +230,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_fraud_rules',
|
||||
'step_method' => 'convertNexusFraudRules',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_fraud_rules' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_fraud_rules' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_fraud_rules',
|
||||
@@ -241,8 +242,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_departments',
|
||||
'step_method' => 'convertNexusSupportDepartments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_departments' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_departments' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertNexusPackages' ),
|
||||
);
|
||||
@@ -252,8 +253,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_fields',
|
||||
'step_method' => 'convertNexusSupportFields',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_fields' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_fields' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertNexusSupportDepartments' ),
|
||||
'link_type' => 'nexus_support_fields',
|
||||
@@ -264,8 +265,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_statuses',
|
||||
'step_method' => 'convertNexusSupportStatuses',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_statuses' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_statuses' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array(),
|
||||
'link_type' => 'nexus_support_statuses',
|
||||
@@ -276,8 +277,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_severities',
|
||||
'step_method' => 'convertNexusSupportSeverities',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_severities' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_severities' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertNexusSupportDepartments' ),
|
||||
'link_type' => 'nexus_support_severities'
|
||||
@@ -288,8 +289,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_stock_actions',
|
||||
'step_method' => 'convertNexusSupportStockActions',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_stock_actions' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_stock_actions' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertNexusSupportDepartments' ),
|
||||
'link_type' => 'nexus_support_stock_actions'
|
||||
@@ -300,8 +301,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_requests',
|
||||
'step_method' => 'convertNexusSupportRequests',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_requests' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_requests' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertNexusCustomers', 'convertNexusSupportDepartments', 'convertNexusSupportFields' ),
|
||||
'link_type' => 'nexus_support_requests',
|
||||
@@ -313,8 +314,8 @@ class _Nexus extends \IPS\convert\Library
|
||||
$return[ $k ] = array(
|
||||
'step_title' => 'convert_nexus_support_replies',
|
||||
'step_method' => 'convertNexusSupportReplies',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_replies' )->first(),
|
||||
'source_rows' => $this->software->countRows( $v['table'], $v['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_replies' ),
|
||||
'source_rows' => array( 'table' => $v['table'], 'where' => $v['where'] ),
|
||||
'per_cycle' => 2000,
|
||||
'dependencies' => array( 'convertNexusSupportRequests' ),
|
||||
'link_type' => 'nexus_support_replies',
|
||||
@@ -326,6 +327,12 @@ class _Nexus extends \IPS\convert\Library
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
/* Run the queries if we want row counts */
|
||||
if( $rowCounts )
|
||||
{
|
||||
$return = $this->getDatabaseRowCounts( $return );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -1168,6 +1175,7 @@ class _Nexus extends \IPS\convert\Library
|
||||
't_fraud_blocked' => 0,
|
||||
't_currency' => $currency,
|
||||
't_partial_refund' => 0.000,
|
||||
't_credit' => 0.000,
|
||||
't_auth' => NULL,
|
||||
't_billing_agreement' => NULL
|
||||
);
|
||||
|
||||
@@ -79,7 +79,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
public static function softwareName()
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "vBulletin Blog (3.x/4.x)";
|
||||
return "vBulletin Blog (3.8.x/4.x)";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
public static function softwareName()
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "vBulletin Calendar (3.x/4.x)";
|
||||
return "vBulletin Calendar (3.8.x/4.x)";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -97,8 +97,8 @@ class _Expressionengine extends \IPS\convert\Software
|
||||
$rows['convertPmAttachments'] = array(
|
||||
'step_method' => 'convertPmAttachments',
|
||||
'step_title' => 'convert_attachments',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments' )->first(),
|
||||
'source_rows' => $this->countRows( static::canConvert()['convertPmAttachments']['table'], static::canConvert()['convertPmAttachments']['where'] ),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments' ),
|
||||
'source_rows' => array( 'table' => static::canConvert()['convertPmAttachments']['table'], 'where' => static::canConvert()['convertPmAttachments']['where'] ),
|
||||
'per_cycle' => 100,
|
||||
'dependencies' => array( 'convertPrivateMessageReplies' ),
|
||||
'link_type' => 'core_attachments',
|
||||
@@ -756,7 +756,7 @@ class _Expressionengine extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
$length = \strlen( $member->conv_password );
|
||||
$providedHash = FALSE;
|
||||
|
||||
@@ -220,7 +220,8 @@ class _Invisioncommunity extends \IPS\convert\Software
|
||||
'convertReputationLevels',
|
||||
'convertClubs',
|
||||
'convertAttachments',
|
||||
'convertReactions'
|
||||
'convertReactions',
|
||||
'convertProfileFields'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -267,6 +268,32 @@ class _Invisioncommunity extends \IPS\convert\Software
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'convertProfileFields':
|
||||
$return['convertProfileFields'] = array();
|
||||
|
||||
$options = array();
|
||||
$options['none'] = \IPS\Member::loggedIn()->language()->addToStack( 'none' );
|
||||
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_pfields_data' ), 'IPS\core\ProfileFields\Field' ) AS $field )
|
||||
{
|
||||
$options[ $field->_id ] = $field->_title;
|
||||
}
|
||||
|
||||
foreach( $this->db->select( '*', 'core_pfields_data' ) AS $field )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words["map_pfield_{$field['pf_id']}"] = $this->getWord( 'core_pfield_' . $field['pf_id'] );
|
||||
\IPS\Member::loggedIn()->language()->words["map_pfield_{$field['pf_id']}_desc"] = \IPS\Member::loggedIn()->language()->addToStack( 'map_pfield_desc' );
|
||||
|
||||
$return['convertProfileFields']["map_pfield_{$field['pf_id']}"] = array(
|
||||
'field_class' => 'IPS\\Helpers\\Form\\Select',
|
||||
'field_default' => NULL,
|
||||
'field_required' => FALSE,
|
||||
'field_extra' => array( 'options' => $options ),
|
||||
'field_hint' => NULL,
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'convertGroups':
|
||||
$return['convertGroups'] = array();
|
||||
|
||||
@@ -541,7 +568,10 @@ class _Invisioncommunity extends \IPS\convert\Software
|
||||
$row['pf_name'] = $this->getWord( 'core_pfield_' . $row['pf_id'] );
|
||||
$row['pf_desc'] = $this->getWord( 'core_pfield_' . $row['pf_id'] . '_desc' );
|
||||
|
||||
$libraryClass->convertProfileField( $row );
|
||||
/* Merge with existing field */
|
||||
$merge = ( $this->app->_session['more_info']['convertProfileFields']["map_pfield_{$row['pf_id']}"] != 'none' ) ? $this->app->_session['more_info']['convertProfileFields']["map_pfield_{$row['pf_id']}"] : NULL;
|
||||
|
||||
$libraryClass->convertProfileField( $row, $merge );
|
||||
$libraryClass->setLastKeyValue( $row['pf_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ class _Joomla extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
/* Joomla 3 */
|
||||
if( preg_match( '/^\$2[ay]\$(0[4-9]|[1-2][0-9]|3[0-1])\$[a-zA-Z0-9.\/]{53}/', $member->conv_password ) )
|
||||
|
||||
@@ -1117,7 +1117,7 @@ class _Mybb extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
if ( \IPS\Login::compareHashes( $member->conv_password, md5( md5( $member->misc ) . md5( $password ) ) ) )
|
||||
{
|
||||
|
||||
@@ -110,7 +110,7 @@ class _Phpbb extends \IPS\convert\Software
|
||||
{
|
||||
$rows['convertBanfilters2'] = $rows['convertBanfilters'];
|
||||
$rows['convertBanfilters2']['step_method'] = 'convertBanfilters2';
|
||||
$rows['convertBanfilters2']['source_rows'] = $this->countRows( static::canConvert()['convertBanfilters2']['table'], static::canConvert()['convertBanfilters2']['where'] );
|
||||
$rows['convertBanfilters2']['source_rows'] = array( 'table' => static::canConvert()['convertBanfilters2']['table'], 'where' => static::canConvert()['convertBanfilters2']['where'] );
|
||||
}
|
||||
|
||||
return $rows;
|
||||
@@ -361,9 +361,37 @@ class _Phpbb extends \IPS\convert\Software
|
||||
/* Convert newlines to <br> tags */
|
||||
$post = nl2br($post);
|
||||
|
||||
/* Preserve code data */
|
||||
$codeboxes = array();
|
||||
preg_match_all( "/\[code(.*?)\](.+?)\[\/code\]/ims", $post, $matches );
|
||||
|
||||
foreach( $matches[0] as $k => $m )
|
||||
{
|
||||
$c = \count( $codeboxes );
|
||||
$codeboxes[ $c ] = $m;
|
||||
|
||||
$replacement = '__CODE_BOX_' . $c . '__';
|
||||
|
||||
$post = str_replace( $m, $replacement, $post );
|
||||
}
|
||||
|
||||
/* Convert HTML entities back into actual entities */
|
||||
$post = html_entity_decode($post, ENT_COMPAT | ENT_HTML401, "UTF-8");
|
||||
|
||||
/* Put codeboxes back */
|
||||
foreach( $codeboxes as $k => $v )
|
||||
{
|
||||
$post = str_replace( '__CODE_BOX_' . $k . '__', $v, $post );
|
||||
}
|
||||
|
||||
/* PhpBB 3.2 */
|
||||
$search = array( '<r>', '<t>', '<s>', '<e>', '<code>', '</r>', '</t>', '</s>', '</e>', '</img>', '</url>', '</quote>', '</link_text>', '</code>' );
|
||||
$post = str_ireplace( $search, '', $post );
|
||||
$post = preg_replace( '/<url url=\"([^\]]+?)"([^>]+?)?>/i', '', $post );
|
||||
$post = preg_replace( '/<img src=\"([^\]]+?)"([^>]+?)?>/i', '', $post );
|
||||
$post = preg_replace( '/<quote author=\"([^\]]+?)"([^>]+?)?>/i', '', $post );
|
||||
$post = preg_replace( '/<link_text text=\"([^\]]+?)"([^>]+?)?>/i', '', $post );
|
||||
|
||||
/* Rework quotes so they'll match our parser style */
|
||||
$post = str_replace( '][quote', "]\n[quote", $post );
|
||||
$post = preg_replace( "#\[quote=(.+)\]#", "[quote name=$1]", $post );
|
||||
@@ -704,7 +732,8 @@ class _Phpbb extends \IPS\convert\Software
|
||||
$filename = array_pop( $filebits );
|
||||
$filepath = implode( '/', $filebits );
|
||||
break;
|
||||
|
||||
|
||||
case 'avatar.driver.local':
|
||||
case 'avatar.driver.gallery':
|
||||
/* I couldn't figure out how to set these up so they are probably wrong */
|
||||
$filepath = $this->app->_session['more_info']['convertMembers']['gallery_location'];
|
||||
@@ -1139,7 +1168,7 @@ class _Phpbb extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
$password = html_entity_decode( $password );
|
||||
$success = FALSE;
|
||||
|
||||
@@ -462,7 +462,7 @@ class _Punbb extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
$success = FALSE;
|
||||
|
||||
|
||||
@@ -908,7 +908,7 @@ class _Smf extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
if ( \IPS\Login::compareHashes( $member->conv_password, sha1( mb_strtolower( $member->name ) . html_entity_decode( $password ) ) ) )
|
||||
{
|
||||
|
||||
@@ -148,7 +148,7 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
$rows['convertMembersFollowers'] = array(
|
||||
'step_method' => 'convertMembersFollowers',
|
||||
'step_title' => 'convert_follows',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_follow', array( 'follow_app=? and follow_area=?', 'core', 'member' ) )->first(),
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_follow', array( 'follow_app=? and follow_area=?', 'core', 'member' ) ),
|
||||
'source_rows' => $count,
|
||||
'per_cycle' => 500,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
@@ -833,7 +833,7 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
$hash = $member->members_pass_hash;
|
||||
$salt = $member->members_pass_salt;
|
||||
|
||||
@@ -531,7 +531,7 @@ class _Vanilla extends \IPS\convert\Software
|
||||
'map_user_id' => $row['UserID'],
|
||||
'map_read_time' => static::mysqlToDateTime( $row['DateLastViewed'] ),
|
||||
//'map_folder_id' => TODO: Create a Bookmarks folder for "Bookmarked" conversations?
|
||||
'map_user_active' => (int) ( $row['Deleted'] != '0' ),
|
||||
'map_user_active' => $row['Deleted'] == 0 ? 1 : 0,
|
||||
'map_last_topic_reply' => static::mysqlToDateTime( $row['DateConversationUpdated'] )
|
||||
);
|
||||
}
|
||||
@@ -574,7 +574,7 @@ class _Vanilla extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
/* Vanilla 2.2 */
|
||||
if( preg_match( '/^\$2[ay]\$(0[4-9]|[1-2][0-9]|3[0-1])\$[a-zA-Z0-9.\/]{53}/', $member->conv_password ) OR mb_substr( $member->conv_password, 0, 3 ) == '$P$' )
|
||||
|
||||
@@ -29,7 +29,12 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
* @brief The schematic for vB3 and vB4 is similar enough that we can make specific concessions in a single converter for either version.
|
||||
*/
|
||||
protected static $isLegacy = NULL;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Flag to indicate the post data has been fixed during conversion, and we only need to use Legacy Parser
|
||||
*/
|
||||
public static $contentFixed = TRUE;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -82,7 +87,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
public static function softwareName()
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "vBulletin (3.x/4.x)";
|
||||
return "vBulletin (3.8.x/4.x)";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -542,8 +547,6 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
$post = str_replace( ">", ">", $post );
|
||||
$post = str_replace( "'", "'", $post );
|
||||
|
||||
$post = nl2br( $post );
|
||||
|
||||
$post = preg_replace( "#\[quote=([^\];]+?)\]#i", "[quote name='$1']", $post );
|
||||
$post = preg_replace( "#\[quote=([^\];]+?);\d+\]#i", "[quote name='$1']", $post );
|
||||
$post = preg_replace( "#\[quote=([^\];]+?);n\d+\]#i", "[quote name='$1']", $post );
|
||||
@@ -553,37 +556,41 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
|
||||
/* This is not a core feature in vBulletin, but is a popular addon and the code was supplied below.
|
||||
Addon URL: https://www.dragonbyte-tech.com/store/product/20-advanced-user-tagging/ */
|
||||
preg_match_all( '#\[MENTION=(\d+)\](.+?)\[\/MENTION\]#i', $post, $matches );
|
||||
|
||||
if ( count( $matches ) )
|
||||
if( mb_stristr( $post, '[mention=' ) )
|
||||
{
|
||||
if ( isset( $matches[1] ) )
|
||||
{
|
||||
$mentions = array();
|
||||
foreach( $matches[1] AS $k => $v )
|
||||
{
|
||||
if ( isset( $matches[2][$k] ) )
|
||||
{
|
||||
$mentions[ $matches[2][$k] ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$maps = array();
|
||||
$urls = array();
|
||||
$cardUrls = array();
|
||||
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( \IPS\Db::i()->in( 'name', array_keys( $mentions ) ) ) ), 'IPS\Member' ) AS $member )
|
||||
{
|
||||
$maps[$member->name] = $member->member_id;
|
||||
$urls[$member->name] = $member->url();
|
||||
$cardUrls[$member->name] = $member->url()->setQueryString( 'do', 'hovercard' );
|
||||
}
|
||||
|
||||
foreach( $mentions AS $member_name => $member_id )
|
||||
{
|
||||
$maps[$member_name] = preg_quote( $maps[$member_name], '#' );
|
||||
$member_name = preg_quote( $member_name, '#' );
|
||||
preg_match_all( '#\[MENTION=(\d+)\](.+?)\[\/MENTION\]#i', $post, $matches );
|
||||
|
||||
$post = preg_replace( "#\[MENTION={$member_id}\]{$member_name}\[\/MENTION\]#i", "<a contenteditable=\"false\" rel=\"\" href=\"{$urls[$member_name]}\" data-mentionid=\"{$maps[$member_name]}\" data-ipshover-target=\"{$cardUrls[$member_name]}\" data-ipshover=\"\">@{$member_name}</a>", $post );
|
||||
if ( count( $matches ) )
|
||||
{
|
||||
/* Make sure we actually have mention data */
|
||||
if ( isset( $matches[1] ) AND \count( $matches[1] ) )
|
||||
{
|
||||
$mentions = array();
|
||||
foreach ( $matches[1] AS $k => $v )
|
||||
{
|
||||
if ( isset( $matches[2][ $k ] ) )
|
||||
{
|
||||
$mentions[ $matches[2][ $k ] ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$maps = array();
|
||||
$urls = array();
|
||||
$cardUrls = array();
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array(\IPS\Db::i()->in( 'name', array_keys( $mentions ) )) ), 'IPS\Member' ) AS $member )
|
||||
{
|
||||
$maps[ $member->name ] = $member->member_id;
|
||||
$urls[ $member->name ] = $member->url();
|
||||
$cardUrls[$member->name] = $member->url()->setQueryString( 'do', 'hovercard' );
|
||||
}
|
||||
|
||||
foreach ( $mentions AS $member_name => $member_id )
|
||||
{
|
||||
$maps[ $member_name ] = preg_quote( $maps[ $member_name ], '#' );
|
||||
$member_name = preg_quote( $member_name, '#' );
|
||||
|
||||
$post = preg_replace( "#\[MENTION={$member_id}\]{$member_name}\[\/MENTION\]#i", "<a contenteditable=\"false\" rel=\"\" href=\"{$urls[ $member_name ]}\" data-mentionid=\"{$maps[ $member_name ]}\" data-ipshover-target=\"{$cardUrls[ $member_name ]}\" data-ipshover=\"\">@{$member_name}</a>", $post );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -859,7 +866,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
$g_signature_limits[] = ( $group['sigmaxlines'] > 0 ) ? $group['sigmaxlines'] : '';
|
||||
}
|
||||
|
||||
/* Let's disect all of these bit options */
|
||||
/* Let's dissect all of these bit options */
|
||||
$info = array(
|
||||
'g_id' => $group['usergroupid'],
|
||||
'g_name' => $group['title'],
|
||||
@@ -987,13 +994,16 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
};
|
||||
|
||||
/* Fetch our last warning */
|
||||
$warn_lastwarn = 0;
|
||||
try
|
||||
$warnings = iterator_to_array( $this->db->select( '*', 'infraction', array( "userid=?", $user['userid'] ), "dateline ASC" ) );
|
||||
$lastWarning = 0;
|
||||
|
||||
/* If there are warnings, get the last warning */
|
||||
if( \count( $warnings ) )
|
||||
{
|
||||
$warn_lastwarn = $this->db->select( 'dateline', 'infraction', array( "userid=?", $user['userid'] ), "dateline DESC", 1 )->first();
|
||||
$lastWarning = end( $warnings );
|
||||
reset( $warnings );
|
||||
}
|
||||
catch( \UnderflowException $e ) {}
|
||||
|
||||
|
||||
/* Birthday */
|
||||
if ( $user['birthday'] )
|
||||
{
|
||||
@@ -1050,7 +1060,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
'joined' => $user['joindate'],
|
||||
'ip_address' => $user['ipaddress'],
|
||||
'warn_level' => ( $user['ipoints'] > 2147483647 ) ? 2147483647 : $user['ipoints'],
|
||||
'warn_lastwarn' => $warn_lastwarn,
|
||||
'warn_lastwarn' => $lastWarning['dateline'],
|
||||
'bday_day' => $bday_day,
|
||||
'bday_month' => $bday_month,
|
||||
'bday_year' => $bday_year,
|
||||
@@ -1138,6 +1148,8 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
$firstTable = 'customprofilepic';
|
||||
$secondTable = 'customavatar';
|
||||
}
|
||||
$filedata = NULL;
|
||||
$filename = NULL;
|
||||
if ( $this->app->_session['more_info']['convertMembers']['photo_location'] == 'database' )
|
||||
{
|
||||
try
|
||||
@@ -1246,7 +1258,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
}
|
||||
}
|
||||
|
||||
$libraryClass->convertMember( $info, $profileFields, $filename, $filepath );
|
||||
$libraryClass->convertMember( $info, $profileFields, $filename, $filepath, $filedata );
|
||||
|
||||
/* Any friends need converting to followers? */
|
||||
foreach( $this->db->select( '*', 'userlist', array( "type=? AND friend=? AND userid=?", 'buddy', 'yes', $user['userid'] ) ) AS $follower )
|
||||
@@ -1259,30 +1271,39 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
'follow_member_id' => $follower['userid'],
|
||||
) );
|
||||
}
|
||||
|
||||
/* And warn logs made on the profile - we'll do content specific later */
|
||||
foreach( $this->db->select( '*', 'infraction', array( "userid=? AND postid=?", $user['userid'], 0 ) ) AS $warn )
|
||||
|
||||
/* Skip this if we know that the user doesn't have any warnings */
|
||||
if( \count( $warnings ) )
|
||||
{
|
||||
$warnId = $libraryClass->convertWarnLog( array(
|
||||
'wl_id' => $warn['infractionid'],
|
||||
'wl_member' => $warn['userid'],
|
||||
'wl_moderator' => $warn['whoadded'],
|
||||
'wl_date' => $warn['dateline'],
|
||||
'wl_points' => $warn['points'],
|
||||
'wl_note_member' => $warn['note'],
|
||||
'wl_note_mods' => $warn['customreason'],
|
||||
/* And warn logs made on the profile - we'll do content specific later */
|
||||
foreach ( $warnings AS $warn )
|
||||
{
|
||||
if( $warn['postid'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$warnId = $libraryClass->convertWarnLog( array(
|
||||
'wl_id' => $warn['infractionid'],
|
||||
'wl_member' => $warn['userid'],
|
||||
'wl_moderator' => $warn['whoadded'],
|
||||
'wl_date' => $warn['dateline'],
|
||||
'wl_points' => $warn['points'],
|
||||
'wl_note_member' => $warn['note'],
|
||||
'wl_note_mods' => $warn['customreason'],
|
||||
) );
|
||||
|
||||
/* Add a member history record for this member */
|
||||
$libraryClass->convertMemberHistory( array(
|
||||
'log_id' => 'w' . $warn['infractionid'],
|
||||
'log_member' => $warn['userid'],
|
||||
'log_by' => $warn['whoadded'],
|
||||
'log_type' => 'warning',
|
||||
'log_data' => array( 'wid' => $warnId ),
|
||||
'log_date' => $warn['dateline']
|
||||
)
|
||||
);
|
||||
/* Add a member history record for this member */
|
||||
$libraryClass->convertMemberHistory( array(
|
||||
'log_id' => 'w' . $warn['infractionid'],
|
||||
'log_member' => $warn['userid'],
|
||||
'log_by' => $warn['whoadded'],
|
||||
'log_type' => 'warning',
|
||||
'log_data' => array( 'wid' => $warnId ),
|
||||
'log_date' => $warn['dateline']
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$libraryClass->setLastKeyValue( $user['userid'] );
|
||||
@@ -1323,7 +1344,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
'status_id' => $status['vmid'],
|
||||
'status_member_id' => $status['userid'],
|
||||
'status_date' => $status['dateline'],
|
||||
'status_content' => $status['pagetext'],
|
||||
'status_content' => static::fixPostData( $status['pagetext'] ),
|
||||
'status_author_id' => $status['postuserid'],
|
||||
'status_author_ip' => $status['ipaddress'],
|
||||
'status_approved' => $approved
|
||||
@@ -1499,6 +1520,23 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
}
|
||||
}
|
||||
catch( \UnderflowException $e ) {}
|
||||
|
||||
/* Use stored author ids */
|
||||
$toUsers = \unserialize( $pm['touserarray'] );
|
||||
if( isset( $toUsers['cc'] ) )
|
||||
{
|
||||
foreach( array_keys( $toUsers['cc'] ) as $id )
|
||||
{
|
||||
$authors[ $id ] = $id;
|
||||
}
|
||||
}
|
||||
elseif( \count( $toUsers ) AND isset( $toUsers['cc'] ) AND isset( $toUsers['bcc'] ) )
|
||||
{
|
||||
foreach( array_keys( $toUsers ) as $id )
|
||||
{
|
||||
$authors[ $id ] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
$maps = array();
|
||||
|
||||
|
||||
@@ -488,8 +488,6 @@ class _Vbulletin5 extends \IPS\convert\Software
|
||||
*/
|
||||
public static function fixPostData( $post )
|
||||
{
|
||||
//return nl2br( $post ); - I commented this out because it actually causes problems with LegacyParser, and most of what is used by vBulletin is actually handled by LegacyParser just fine, including linebreaks.
|
||||
|
||||
/* Fix Quotes */
|
||||
$post = preg_replace( "#\[quote=([^\];]+?)\]#i", "[quote name='$1']", $post );
|
||||
$post = preg_replace( "#\[quote=([^\];]+?);\d+\]#i", "[quote name='$1']", $post );
|
||||
|
||||
@@ -239,7 +239,7 @@ class _Wordpress extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
$success = FALSE;
|
||||
|
||||
|
||||
@@ -473,41 +473,46 @@ class _Xenforo extends \IPS\convert\Software
|
||||
$post = htmlspecialchars( $post, ENT_DISALLOWED | ENT_QUOTES, 'UTF-8', FALSE );
|
||||
|
||||
// find YouTube ID's and replace.
|
||||
$post = preg_replace( '#\[media=youtube\](.+?)\[/media\]#i', '[media]http://www.youtube.com/watch?v=$1[/media]', $post );
|
||||
|
||||
/* Mentions */
|
||||
preg_match_all( '#\[user=(\d+)\](.+?)\[\/user\]#i', $post, $matches );
|
||||
|
||||
if ( count( $matches ) )
|
||||
$post = preg_replace( '#\[media=youtube\](.+?)\[/media\]#i', 'https://www.youtube.com/watch?v=$1', $post );
|
||||
$post = preg_replace( '#\[media=facebook\](.+?)\[/media\]#i', 'https://www.facebook.com/video.php?v=$1', $post );
|
||||
|
||||
/* Quick check for the presence of user tags */
|
||||
if( mb_stristr( $post, '[user=' ) )
|
||||
{
|
||||
if ( isset( $matches[1] ) )
|
||||
/* Mentions */
|
||||
preg_match_all( '#\[user=(\d+)\](.+?)\[\/user\]#i', $post, $matches );
|
||||
|
||||
if ( count( $matches ) )
|
||||
{
|
||||
$mentions = array();
|
||||
foreach( $matches[1] AS $k => $v )
|
||||
if ( isset( $matches[1] ) AND \count( $matches[1] ) )
|
||||
{
|
||||
if ( isset( $matches[2][ $k ] ) )
|
||||
$mentions = array();
|
||||
foreach ( $matches[1] AS $k => $v )
|
||||
{
|
||||
$name = trim( $matches[2][ $k ], '@' );
|
||||
$mentions[$name] = $v;
|
||||
if ( isset( $matches[2][ $k ] ) )
|
||||
{
|
||||
$name = trim( $matches[2][ $k ], '@' );
|
||||
$mentions[ $name ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$maps = array();
|
||||
$urls = array();
|
||||
$cardUrls = array();
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( \IPS\Db::i()->in( 'name', array_keys( $mentions ) )) ), 'IPS\Member' ) AS $member )
|
||||
{
|
||||
$maps[ $member->name ] = $member->member_id;
|
||||
$urls[ $member->name ] = $member->url();
|
||||
$cardUrls[ $member->name ] = $member->url()->setQueryString( 'do', 'hovercard' );
|
||||
}
|
||||
|
||||
foreach ( $mentions AS $member_name => $member_id )
|
||||
{
|
||||
$maps[ $member_name ] = preg_quote( $maps[ $member_name ], '#' );
|
||||
$memberNameEscaped = preg_quote( $member_name, '#' );
|
||||
|
||||
$post = preg_replace( "#\[user={$member_id}\]@?{$memberNameEscaped}\[\/user\]#i", "<a contenteditable=\"false\" rel=\"\" href=\"{$urls[ $member_name ]}\" data-mentionid=\"{$maps[ $member_name ]}\" data-ipshover-target=\"{$cardUrls[ $member_name ]}\" data-ipshover=\"\">@{$member_name}</a>", $post );
|
||||
}
|
||||
}
|
||||
|
||||
$maps = array();
|
||||
$urls = array();
|
||||
$cardUrls = array();
|
||||
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( \IPS\Db::i()->in( 'name', array_keys( $mentions ) ) ) ), 'IPS\Member' ) AS $member )
|
||||
{
|
||||
$maps[ $member->name ] = $member->member_id;
|
||||
$urls[ $member->name ] = $member->url();
|
||||
$cardUrls[ $member->name ] = $member->url()->setQueryString( 'do', 'hovercard' );
|
||||
}
|
||||
|
||||
foreach( $mentions AS $member_name => $member_id )
|
||||
{
|
||||
$maps[ $member_name ] = preg_quote( $maps[ $member_name ], '#' );
|
||||
$memberNameEscaped = preg_quote( $member_name, '#' );
|
||||
|
||||
$post = preg_replace( "#\[user={$member_id}\]@?{$memberNameEscaped}\[\/user\]#i", "<a contenteditable=\"false\" rel=\"\" href=\"{$urls[ $member_name ]}\" data-mentionid=\"{$maps[ $member_name ]}\" data-ipshover-target=\"{$cardUrls[ $member_name ]}\" data-ipshover=\"\">@{$member_name}</a>", $post );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1084,6 +1089,7 @@ class _Xenforo extends \IPS\convert\Software
|
||||
'allow_admin_mails' => $row['receive_admin_email'],
|
||||
'member_title' => $row['custom_title'],
|
||||
'member_posts' => $row['message_count'],
|
||||
'signature' => $row['signature']
|
||||
);
|
||||
|
||||
/* Profile Photo */
|
||||
@@ -1513,7 +1519,7 @@ class _Xenforo extends \IPS\convert\Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
public static function login( $member, $password )
|
||||
{
|
||||
$password = html_entity_decode( $password );
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -303,9 +303,15 @@ class _Photopost extends \IPS\convert\Software
|
||||
|
||||
if( mb_strpos( $url->data[ \IPS\Http\Url::COMPONENT_PATH ], 'showgallery.php' ) !== FALSE )
|
||||
{
|
||||
if( !$id = \IPS\Request::i()->cat )
|
||||
{
|
||||
preg_match( '#cat/([0-9]+)#', $url->data[ \IPS\Http\Url::COMPONENT_PATH ], $matches );
|
||||
$id = isset( $matches[1] ) ? $matches[1] : NULL;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$data = (string) $this->app->getLink( \IPS\Request::i()->cat, 'gallery_categories' );
|
||||
$data = (string) $this->app->getLink( $id, 'gallery_categories' );
|
||||
$item = \IPS\gallery\Category::load( $data );
|
||||
|
||||
if( $item->can('view') )
|
||||
@@ -320,9 +326,15 @@ class _Photopost extends \IPS\convert\Software
|
||||
}
|
||||
elseif( mb_strpos( $url->data[ \IPS\Http\Url::COMPONENT_PATH ], 'showphoto.php' ) !== FALSE )
|
||||
{
|
||||
if( !$id = \IPS\Request::i()->photo )
|
||||
{
|
||||
preg_match( '#photo/([0-9]+)#', $url->data[ \IPS\Http\Url::COMPONENT_PATH ], $matches );
|
||||
$id = isset( $matches[1] ) ? $matches[1] : NULL;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$data = (string) $this->app->getLink( \IPS\Request::i()->photo, 'gallery_images' );
|
||||
$data = (string) $this->app->getLink( $id, 'gallery_images' );
|
||||
$item = \IPS\gallery\Image::load( $data );
|
||||
|
||||
if( $item->canView() )
|
||||
|
||||
@@ -82,7 +82,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
public static function softwareName()
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "vBulletin Gallery (3.x/4.x)";
|
||||
return "vBulletin Gallery (3.8.x/4.x)";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -443,7 +443,7 @@ class _Vbulletin extends \IPS\convert\Software
|
||||
|
||||
try
|
||||
{
|
||||
if( isset( \IPS\Request::i()->albumid ) )
|
||||
if( isset( \IPS\Request::i()->albumid ) AND mb_strpos( $url->data[ \IPS\Http\Url::COMPONENT_PATH ], 'picture.php' ) === FALSE )
|
||||
{
|
||||
$data = $this->app->getLink( \IPS\Request::i()->albumid, 'gallery_albums' );
|
||||
$item = \IPS\gallery\Album::load( $data );
|
||||
|
||||
@@ -569,8 +569,9 @@ class _Xenforo extends \IPS\convert\Software
|
||||
$libraryClass->setlastKeyValue( $row['media_id'] );
|
||||
continue 2;
|
||||
}
|
||||
|
||||
$description = $em . "<br>" . isset( $row['media_description'] ) ? $row['media_description'] : $row['description'];
|
||||
|
||||
$description = ( isset( $row['media_description'] ) ? $row['media_description'] : $row['description'] );
|
||||
$description = $em . "<br>" . $description;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -702,7 +703,7 @@ class _Xenforo extends \IPS\convert\Software
|
||||
|
||||
$libraryClass::setKey( 'comment_id' );
|
||||
|
||||
foreach( $this->fetch( static::$tablePrefix . 'comment', 'comment_id', array( "content_type=?", 'media' ) ) AS $row )
|
||||
foreach( $this->fetch( static::$tablePrefix . 'comment', 'comment_id', array( "content_type=?", ( static::$isLegacy ? 'media' : 'xfmg_media' ) ) ) AS $row )
|
||||
{
|
||||
/* IP Address */
|
||||
try
|
||||
|
||||
Reference in new issue
Block a user