• Resolved Karolina Vyskocilova

    (@vyskoczilova)


    Hi,

    firstly – thanks for that! it’s really awesome!

    I’m using last version of your plugin to allow our partners to download our jpg materials when they need to. I’ve arrived to allow them download hi-res pictures instead of showed low-res with your filter ngg_dlgallery_image_path, but I need to let them choose if they want to download JPG or TIFF file. Both JPG and TIFF files are in the same directory and the only difference is the extension:

    https://fotobanka.idealab.cz/wp-content/fotobanka/cvicne/hires/DSC_5452.jpg
    https://fotobanka.idealab.cz/wp-content/fotobanka/cvicne/hires/DSC_5452.tiff

    What I need is:
    1) to have two check-boxes under each image
    2) under all gallery options to:
    – select all jpgs
    – select all tiffs
    – download selected (they can mix jpg and tiffs together)
    – download all jpgs
    – download all tiffs

    I’m at the very beginning of this job, but what I’ve done:
    1) I have already got both hires urls because I’m printing the info about size of each jpg/tiff file (feel free to add it in some kind of way to the future update of the plugin) and it’s printed on the right side of check-box
    2) tried to add another check-box ends with displaying only the second one under the image…? Same kind of problem arises with adding another submit button.

    Could you give me a hint why I can’t add another checkbox under the image?

    code of gallery-download.php
    code of custom functions.php for my child theme
    website link with the plugin and a current state of work:

    Your help will be really appreciated.

    https://www.ads-software.com/plugins/nextgen-download-gallery/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Karolina Vyskocilova

    (@vyskoczilova)

    update:
    code of gallery-download.php
    code download-form.js

    Ok, I have arrived to display other download buttons, when clicking on “select all tiffs” it select all tiffs, but I haven’ arrived to download them either download them all.
    Still can’t display both checkboxes under picture.

    Would you mind helping me please?

    Plugin Author webaware

    (@webaware)

    G’day kybernaut,

    The simplest solution that I can suggest is that you keep just having one checkbox, but offer separately to download as TIFF or JPEG — I’d use a couple of radio buttons, with the JPEG option selected by default. You can then test for that input in the request when your filter hook is called. e.g.

    <input type="radio" name="download-format" value="jpeg" selected /> JPEG <br>
    <input type="radio" name="download-format" value="tiff" /> TIFF

    and

    if (isset($_REQUEST['download-format']) && $_REQUEST['download-format'] === 'tiff') {
        // replace name with name of TIFF image
    }

    cheers,
    Ross

    Thread Starter Karolina Vyskocilova

    (@vyskoczilova)

    Hi Webaware!

    That’s pretty cool and elegant, I’ve already tried to implement it and it works like a charm! Thanks really a lot for your great help and your useful plugin!

    Cheers
    Karolina

    Plugin Author webaware

    (@webaware)

    Good stuff!

    cheers,
    Ross

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Choose between two files for download (jpg or tiff)’ is closed to new replies.