• The function “Scan folder for new images” currently searches for new images to add to the gallery.

    I needed the functionality to delete images that no longer existed. For this following code is added to the procedure nggAdmin::import_gallery().

    // create list of old images (BOO)
    $old_images = array_diff($old_imageslist, $new_imageslist);

    // delete old images from database (BOO)
    foreach($old_images as $key => $picture) {
    $image_id = $wpdb->get_var(“SELECT pid from $wpdb->nggpictures WHERE galleryid = ‘$gallery_id’ and filename = ‘$picture’ “);
    if ($image_id) {
    $delete_pic = nggdb::delete_image( $image_id );
    }
    }

    // write message on number of deleted images (BOO)
    nggGallery::show_message( $created_msg . count($old_images) .__(‘ picture(s) successfully deleted’,’nggallery’) );

    Could this be added to Nextgen?

    Grt, Bart

  • The topic ‘[Plugin: NextGEN Gallery] Delete during scan folder’ is closed to new replies.