Add a Download Link for the full-size image v1.1 - v1.4 Add a Download Link for the full-size image v1.1 - v1.4
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Add a Download Link for the full-size image v1.1 - v1.4

Started by Joe Carver, July 05, 2010, 11:23:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe Carver

This plugin will add a Download Link for visitors to download the full-size image, A link will show at the bottom of the info. table or a button will appear below the title or caption. Clicking the button will open the image in a new window.

Config options - Show to logged users and location of link on page.

Note: If used with the LightBox plugin: LightBox must be below this plugin on the "Installed plugins" listing in Plugin manager. Or use option to show link in info. table.

v1.4 contribution by 1aB - Read the posts below for more information.

kboutelle

I installed this and the Facebook Sharer add-in and this link disabled or overwrote the Facebook Sharer button. :-(

Both work fine, just not together unfortunately.

My Gallery
~~~~~~~~~~~~~~~~~~~~~~~~~~~
*Link Removed*
*Link Removed*
*Link Removed*

Plazik

kboutelle in Plugin Manager put this plugin first and Facebook Sharer second.
(Like in my gallery http://rihanna1photos.ru/displayimage-1082-22818.html#top_display_media)

kboutelle

~~~~~~~~~~~~~~~~~~~~~~~~~~~
*Link Removed*
*Link Removed*
*Link Removed*

Joe Carver

Release of Version 1.1

    Changelog
    • Add config. feature - show link to logged users only
    • Add config option to show link in pic. info. table

    New version attached to first post.

    Zitrone

    Hey Joe, i have a question of the download_link_addon...

    Its a nice addon and i use it, but maybe we can configure something that it works how i like :D

    I want that, if i click on the Button "Download-Link" that comes a Pop-Up how ask me where i want to save the picture, but on this Addon it only opens the Picture in FullView.
    I hope you know what i mean.



    Best Regards,
    Zitrone
    CPG-Version 1.5.8 (Up-to-date)
    FTP : 2 GB Traffic
    MySQL-Version: 5.0.51a

    Αndré

    Afaik it's a browser feature if it opens the file directly in the browser or asks you to save the file. Maybe there's a solution that forces a download dialog I'm not aware of.

    Joe Carver

    Quote from: Αndré on September 03, 2010, 12:37:44 PM
    Maybe there's a solution that forces a download dialog I'm not aware of.
    Looking at: function download_file in archive.php 
    $header = "Content-Disposition: attachment; filename=\"";
    Tells the browser what to do with the file. Of course there is more to it than just one line.


    Quote from: Zitrone on September 03, 2010, 12:33:30 PM
    ..... maybe we can configure something that it works how i like
    At the moment "we" would have to be you. This would take more time than I would care to spend. The above pageheader + filename + filetype needs to be set into codebase.php and tested for different image types. There needs to be a config. option with corresponding - help + admin. + lang. file updates.

    It can be done, but the next update on this plugin might take some time.

    1aB

    Hi,

    I hope you do not mind that I implemented the Content-Disposition feature in order for the browser to do a "real" Save As (this should work with all modern browsers). Actually it had been done before in a cpg1.4 plugin called "alternate file loading", so I just had to put it together with your great stuff, and I called it v1.2. There is now also a German translation.

    Note the new config option "Use Content-Disposition to Save As" in order to activate it. (Just in case someone is liking the opening-in-separate window so much, it is still possible and still default.)

    And have a new idea, maybe "someone" could fancy to implement this? ;)
    Per-album configuration for the Download Link. I.e. I would like the download link only on some albums but not on all. (Is that possible at all?)

    Thanks to all who work on the great Coppermine, the great plugins and have great ideas for both...

    Best regards,
    Roland

    Joe Carver

    Quote from: 1aB on December 29, 2010, 05:25:27 PM
    I hope you do not mind that I implemented the Content-Disposition feature.......

    Not at all, actually it is great that new features can be contributed.
    Nice work.  :)
    I hope to have some time to try it soon.

    Quote from: 1aB on December 29, 2010, 05:25:27 PM
    I would like the download link only on some albums but not on all. (Is that possible at all?)

    You can try to make it conditional on:
         $CURRENT_ALBUM_DATA['aid']

    The global:
         $CURRENT_ALBUM_DATA
    should also be added.


    Αndré

    Quote from: 1aB on December 29, 2010, 05:25:27 PM
    Per-album configuration for the Download Link. I.e. I would like the download link only on some albums but not on all. (Is that possible at all?)
    The main task is to create the user interface where the admin/album owner can determine if he want to enable the link or not.

    1aB

    Quote from: Αndré on December 30, 2010, 09:46:31 AM
    The main task is to create the user interface where the admin/album owner can determine if he want to enable the link or not.

    Indeed. Ideal configurability would hook into the album configuration page and probably need an extra db table ...sounds complicated.

    So when I think it through, I notice that for my own purposes, granularity at category level would probably suffice, and then maybe just to have a plugin setting with a regex, defaulting to '.*' , so that admin could set it to '(Events|Public|Fine Work)' in order to enable only for those categories and not for the others.

    Suppose I could then use     $CURRENT_CAT_NAME in order to decide?

    That would be not as nifty as full per-album configurability, but for me as a "Coppermine Newbie" ;) sounds doable if I find one or two more days to actually do it.

    1aB

    Oops, that was easier than I thought: the biggest problem is actually to properly sanitize the regex string from the input field ...that could probably still be improved.
    Otherwise, it would be nice if this place:
    http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/
    could be updated with a newer version than v1.0 ;)

    v1.3

    • Configure option to show link only for certain categories
    v1.2

    • German translation
    • Content-Disposition -> Save As box in the browser

    epula

    good plug in
    but i would like the link under the picture not in info picture. how to modify the code ?
    thank you

    Αndré

    Quote from: 1aB on December 30, 2010, 04:48:12 PM
    it would be nice if this place:
    http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/
    could be updated with a newer version than v1.0 ;)
    Done as suggested. It would also be nice if you would add the latest version to your initial post, so users don't have to search the whole thread for the latest release ;)

    epula

    Thank You
    it's exactly that I want do with this version of plugin.
    sorry for the localisation of my first post but my english is not perfect and is not easy for me to make the things in order

    Mimer

    #16
    Hi

    Danish languagefiles for Joe Carvers v1.1 and 1aBs v1.3

    Mimer  8)

    Mimer

    How can I change/add to the plugin to download the intermediet picture instead of Full Size piture?

    Mimer  8)

    Joe Carver

    Quote from: Mimer on March 04, 2011, 11:30:08 PM
    Danish languagefiles for Joe Carvers v1.1 and 1aBs v1.3

    Thank you for the contribution.
    It might be a while before I release a newer version. Before then users should download your contribution above.

    Quote from: Mimer on March 04, 2011, 11:36:44 PM
    How can I change/add to the plugin to download the intermediet picture instead of Full Size piture?

    In my version 1.1 find in codebase.php:

        $pics_link = 'albums/' . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];

    Change to:

        $pics_link = get_pic_url($CURRENT_PIC_DATA, 'normal');


    Mimer