• Resolved superflyfr

    (@superflyfr)


    Hi,
    [echoing/describing the feature request made earlier]
    I have set a standard image gallery (WP MU) with a particular directory (/wp-content/uploads/sites/[blog_ID]/ngg-gallery).

    What I need is that uploaded files within this directory are imported into the gallery at the end of the upload (that’s another part, dealing with gravity forms).

    Basically, it’s exactly what we can trigger manually in the gallery settings by clicking the button “scan for new images”.

    I thought I could “retro-engineer” and add my own function to do that but I’d say that I’m ending with a few concerns about reliability and durability.
    Here’s where I am right now

    $gallerypath = $wpdb->get_var("SELECT path FROM $wpdb->nggallery WHERE name = 'my-import-gallery' ");
    $gallery_id = $wpdb->get_var("SELECT gid FROM $wpdb->nggallery WHERE name = 'my-import-gallery' ");
    			
    // read list of images
    $new_imageslist = array_diff(scandir($gallerypath), array('..', '.','thumbs'));
    $old_imageslist = $wpdb->get_col("SELECT filename FROM $wpdb->nggpictures WHERE galleryid = $gallery_id ");
    $new_images = array_diff($new_imageslist, $old_imageslist);

    So, I have the gallery_id, the image(s) to import array and I wish I could “simply” call a function like nggAdmin::add_Images($galleryID, $new_images);
    But I believe it’s restricted for admin area only (or I’m missing something obvious for PHP experts …).

    Note : as of now I’m using the free version but I’ll be glad to jump to the Pro version if this was achievable.
    BR,
    Antoine aka Superfly

    • This topic was modified 5 years, 8 months ago by superflyfr.
    • This topic was modified 5 years, 8 months ago by superflyfr.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter superflyfr

    (@superflyfr)

    Note : I could inject images via SQL query but then I’ll miss the resize, thumbs and various features that make NGG so great ??

    Plugin Support Mihai Ceban

    (@mihaiimagely)

    Hi @superflyfr,

    Our efforts in the forum are more in offering support in breaking down what could be the source of the conflict (i.e. check server settings, check for possible plugin or theme conflict). If it’s something quick, like some CSS to add or remove a border, that’s OK.

    Thanks for your understanding

    • This reply was modified 5 years, 8 months ago by Mihai Ceban.
    Thread Starter superflyfr

    (@superflyfr)

    Hi Mihail,
    Fair enough, this was more FTR (and a feature vote suggestion)than a real support request.

    Though, the final question “is it feasible” is pre-sale related and it’ll be useful for me to get an answer.
    Thanks!

    • This reply was modified 5 years, 8 months ago by superflyfr.
    • This reply was modified 5 years, 8 months ago by superflyfr.
    Plugin Support Mihai Ceban

    (@mihaiimagely)

    Hi @superflyfr,

    I will surely add it as a vote to our feature requests list which would be the most what we’ll be able to do even in case that you would have a Pro membership with us.

    As long as I am aware, we don’t currently have such code workarounds that would help to achieve an automatically update for the images from all NextGen galleries and albums. The main thing to think about here is that a possible implementation will possible run into resource overflow problems for lots of installations due to the amount of processing data for sites with a high number of galleries.

    Thanks for your understanding

    • This reply was modified 5 years, 8 months ago by Mihai Ceban.
    • This reply was modified 5 years, 8 months ago by Mihai Ceban.
    • This reply was modified 5 years, 8 months ago by Mihai Ceban.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Launch new image scan programatically’ is closed to new replies.