Title: [Plugin: NextGEN Gallery] idea: Button to refresh picture folder
Last modified: August 19, 2016

---

# [Plugin: NextGEN Gallery] idea: Button to refresh picture folder

 *  [manupape](https://wordpress.org/support/users/manupape/)
 * (@manupape)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/)
 * Hey Ho,
    i want to ask if it is possible that someone could tell me how to create
   such a button:
 * [http://www.manupape.de/manu/nextgen1.png](http://www.manupape.de/manu/nextgen1.png)
 * to this place:
 * [http://www.manupape.de/manu/nextgen2.png](http://www.manupape.de/manu/nextgen2.png)
 * This would make creating a post much easier, because I load up my photos with
   ftp to my Server.
 * Also, I think this is a nice idea for the next update of NextGen Gallery!
 * It would be great if someone could help me!
 * greets, Manu!

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [manupape](https://wordpress.org/support/users/manupape/)
 * (@manupape)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941620)
 * please please help me!!!!
 *  Thread Starter [manupape](https://wordpress.org/support/users/manupape/)
 * (@manupape)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941640)
 * sorry for third post… but can nobody help me?
 * **please!!**
 *  [Alex Rabe](https://wordpress.org/support/users/alexrabe/)
 * (@alexrabe)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941644)
 * For what exact do you need help ? As far as I understand your post ,this is a
   feature request and not a urgent bug report.
 *  [Alex Rabe](https://wordpress.org/support/users/alexrabe/)
 * (@alexrabe)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941645)
 * You will find the media screen in the file admin/media-upload.php inside the 
   plugin folder. There you need to add the button.
 *  Thread Starter [manupape](https://wordpress.org/support/users/manupape/)
 * (@manupape)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941656)
 * Hey thx for the responses! I thought that this is the right forum… Now I made
   it to create the button to the right place, but there isn’t any function. When
   I click on it, something is loading, but then nothing changed and nothing has
   been updated!
 * I added this code from the manage-images.php file to the media-upload.php next
   to the “Save changes”-button:
 * `<input type="submit" class="button-secondary" name="scanfolder" value="<?php
   _e("Scan Folder for new images",'nggallery')?> " />`
 * This is how it looks:
 * [http://www.manupape.de/manu/nextgen3.png](http://www.manupape.de/manu/nextgen3.png)
 * Has someone an idea how I could do this?
 * Greets, Manu!
 * ps to alexrabe:
    This feature would make creating a post much easier, if you 
   use ftp-upload for your images. It would be great if this function is contained
   in the next update of NextGEN Gallery!
 *  [gwegnerde](https://wordpress.org/support/users/gwegnerde/)
 * (@gwegnerde)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941691)
 * I think this is a great idea and would serve to streamline everyones workflow
   who uploads via ftp (for example directly out of lightroom).
 * Thus I made a little hack to accomplish this. I hope, alex will incorporate it
   in one of the upcoming versions – surely in a neater way.
 * So here we go:
 * In **media-upload.php** find the function **media_upload_nextgen_form**
 * Near line 96 insert the code embraced by the comment-block:
 *     ```
       // Get number of images in gallery
       if ($_REQUEST['select_gal']){
           $galleryID = (int) $_REQUEST['select_gal'];
   
           // ---Hack by gwegner.de ----------------------
           // rescans the selected folder for new Images before showing it
           include_once (dirname (__FILE__) . '/functions.php');
           $gallerypath = $wpdb->get_var("SELECT path FROM $wpdb->nggallery WHERE gid = '$galleryID'");
           nggAdmin::import_gallery($gallerypath);
           // --------------------------------------------	
   
           $total = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures WHERE galleryid = '$galleryID'");
       }
       ```
   
 * This one will rescan and refresh the gallery every time it is chosen in the WordPress
   mediauploader.
 * Have Fun!
 *  [gwegnerde](https://wordpress.org/support/users/gwegnerde/)
 * (@gwegnerde)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941698)
 * I currently don’t know why, but unfortunately the hack above is not generating
   Thumbnails for new images, although the method is being called. Sorry, I’m going
   to look into it a bit further if time.
 *  Thread Starter [manupape](https://wordpress.org/support/users/manupape/)
 * (@manupape)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941733)
 * would be nice… =)

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘[Plugin: NextGEN Gallery] idea: Button to refresh picture folder’ is 
closed to new replies.

 * 8 replies
 * 3 participants
 * Last reply from: [manupape](https://wordpress.org/support/users/manupape/)
 * Last activity: [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-button-to-refresh-picture-folder/#post-941733)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
