Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -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'] )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user