/**
  * Counts gallery image markers.
  */
 public function countGalleryImageMarkers()
 {
     if (version_compare($this->getPackageVersion('com.woltlab.gallery'), '2.1.0 Alpha 1', '>=') && version_compare(\gallery\system\GALLERYCore::getInstance()->getPackage()->packageVersion, '2.1.0 Alpha 1', '>=')) {
         return $this->__getMaxID("gallery" . $this->dbNo . "_image_marker", 'markerID');
     }
     // version 2.0 does not support image markers
     return 0;
 }
 /**
  * Exports gallery albums.
  */
 public function exportGalleryAlbums($offset, $limit)
 {
     $destVersion21 = version_compare(\gallery\system\GALLERYCore::getInstance()->getPackage()->packageVersion, '2.1.0 Alpha 1', '>=');
     $sql = "SELECT\t\tgallery_album.*, user_table.username\n\t\t\tFROM\t\twcf" . $this->dbNo . "_user_gallery_album gallery_album\n\t\t\tLEFT JOIN\twcf" . $this->dbNo . "_user user_table\n\t\t\tON\t\t(user_table.userID = gallery_album.ownerID)\n\t\t\tWHERE\t\tgallery_album.albumID BETWEEN ? AND ?\n\t\t\tORDER BY\talbumID";
     $statement = $this->database->prepareStatement($sql);
     $statement->execute(array($offset + 1, $offset + $limit));
     while ($row = $statement->fetchArray()) {
         $data = array('userID' => $row['ownerID'], 'username' => $row['username'] ?: '', 'title' => $row['title'], 'description' => $row['description'], 'lastUpdateTime' => $row['lastUpdateTime']);
         if ($destVersion21 && $row['isPrivate']) {
             $data['accessLevel'] = 2;
         }
         ImportHandler::getInstance()->getImporter('com.woltlab.gallery.album')->import($row['albumID'], $data);
     }
 }