Ejemplo n.º 1
0
 function import_next_picture()
 {
     $picture = array_pop($this->nextgen_pictures);
     $nextgen = new FooGallery_NextGen_Helper();
     $attachment_id = $nextgen->import_picture($this->nextgen_gallery->path, $picture);
     $attachment_ids = get_post_meta($this->foogallery_id, FOOGALLERY_META_ATTACHMENTS, true);
     if (empty($attachment_ids)) {
         $attachment_ids = array();
     }
     $attachment_ids[] = $attachment_id;
     //link all attachments to foogallery
     update_post_meta($this->foogallery_id, FOOGALLERY_META_ATTACHMENTS, $attachment_ids);
     //update our list of imported attachments
     $this->attachments[] = $attachment_id;
     //update our percentage complete
     $this->percentage_complete = count($this->attachments) / $this->import_count * 100;
     //update our status if 100%
     if (100 === $this->percentage_complete) {
         $this->status = self::PROGRESS_COMPLETED;
     }
 }