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 _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'] )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user