diff options
author | Joe7 <jozsef.rnagy@site.hu> | 2011-01-06 02:31:50 +0100 |
---|---|---|
committer | Joe7 <jozsef.rnagy@site.hu> | 2011-01-07 17:51:21 +0100 |
commit | c338d3138e2c93bfb219a8d32ba9110138fcf9c2 (patch) | |
tree | 638b36219d6c3be8f8f78220659e5dccd93ce411 /modules/g2_import/helpers/g2_import.php | |
parent | f2477703faa7cd05ff1aa16da3ecef7b666bef40 (diff) |
Importing Gallery2 users in batches
Fixes Ticket #1554
Diffstat (limited to 'modules/g2_import/helpers/g2_import.php')
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index b2e3836a..5e2a61e8 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -1155,7 +1155,7 @@ class g2_import_Core { "SELECT [GalleryComment::id] " . "FROM [GalleryComment] " . "WHERE [GalleryComment::publishStatus] = 0 " . // 0 == COMMENT_PUBLISH_STATUS_PUBLISHED - "AND [GalleryComment::id] > ?", + "AND [GalleryComment::id] > ?", array($min_id), array("limit" => array("count" => 100)))); while ($result = $results->nextResult()) { @@ -1184,6 +1184,26 @@ class g2_import_Core { } /** + * Get a set of user ids from Gallery 2 greater than $min_id. We use this to get the + * next chunk of users to import. + */ + static function get_user_ids($min_id) { + global $gallery; + + $ids = array(); + $results = g2($gallery->search( + "SELECT [GalleryUser::id] " . + "FROM [GalleryUser] " . + "WHERE [GalleryUser::id] > ?", + array($min_id), + array("limit" => array("count" => 100)))); + while ($result = $results->nextResult()) { + $ids[] = $result[0]; + } + return $ids; + } + + /** * Look in our map to find the corresponding Gallery 3 id for the given Gallery 2 id. */ static function map($g2_id) { |