forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Joe Carver on July 05, 2010, 11:23:06 pm

Title: Add a Download Link for the full-size image v1.1 - v1.4
Post by: Joe Carver on July 05, 2010, 11:23:06 pm
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 (http://forum.coppermine-gallery.net/index.php?action=profile;u=103922) - Read the posts below for more information.
Title: Re: Add a Download Link for the full-size image v1.0
Post by: kboutelle on July 19, 2010, 03:56:04 pm
I installed this and the Facebook Sharer (http://forum.coppermine-gallery.net/index.php/topic,65740.0.html) add-in and this link disabled or overwrote the Facebook Sharer button. :-(

Both work fine, just not together unfortunately.

My Gallery (http://gallery.boutelle.us)
Title: Re: Add a Download Link for the full-size image v1.0
Post by: Plazik on July 19, 2010, 04:13:06 pm
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)
Title: Re: Add a Download Link for the full-size image v1.0
Post by: kboutelle on July 19, 2010, 04:17:46 pm
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)

That worked! Thanks!
Title: Re: Add a Download Link for the full-size image v1.0
Post by: Joe Carver on August 09, 2010, 01:21:14 am
Release of Version 1.1

Changelog

New version attached to first post.
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Zitrone on September 03, 2010, 12:33:30 pm
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
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Αndré on September 03, 2010, 12:37:44 pm
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.
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Joe Carver on September 04, 2010, 03:08:46 am
Maybe there's a solution that forces a download dialog I'm not aware of.
Looking at: function download_file in archive.php 
Code: [Select]
$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.


 
..... 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.
Title: Re: Add a Download Link for the full-size image v1.1
Post by: 1aB on December 29, 2010, 05:25:27 pm
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
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Joe Carver on December 29, 2010, 11:56:12 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.

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:
Code: [Select]
     $CURRENT_ALBUM_DATA['aid']
The global:
Code: [Select]
     $CURRENT_ALBUM_DATAshould also be added.

Title: Re: Add a Download Link for the full-size image v1.1
Post by: Αndré on December 30, 2010, 09:46:31 am
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.
Title: Re: Add a Download Link for the full-size image v1.1
Post by: 1aB on December 30, 2010, 11:28:56 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
Code: [Select]
    $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.
Title: Re: Add a Download Link for the full-size image v1.1
Post by: 1aB on December 30, 2010, 04:48:12 pm
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
v1.2
Title: Re: Add a Download Link for the full-size image v1.1
Post by: epula on February 07, 2011, 10:49:03 pm
good plug in
but i would like the link under the picture not in info picture. how to modify the code ?
thank you
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Αndré on February 08, 2011, 09:17:46 am
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 ;)
Title: Re: Add a Download Link for the full-size image v1.1
Post by: epula on February 08, 2011, 10:22:58 am
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
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Mimer on March 04, 2011, 11:30:08 pm
Hi

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

Mimer  8)
Title: Re: Add a Download Link for the full-size image v1.1
Post by: 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?

Mimer  8)
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Joe Carver on March 05, 2011, 01:06:34 am
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.

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:

Code: [Select]
    $pics_link = 'albums/' . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];
Change to:

Code: [Select]
    $pics_link = get_pic_url($CURRENT_PIC_DATA, 'normal');
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Mimer on March 05, 2011, 01:10:40 am
Tnx, I'll look into it and post back.

Mimer 8)
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Mimer on March 10, 2011, 01:20:01 pm
This one is for 1aB:

Danish translation for upcomming v. 1.4

Mimer  8)
Title: Re: Add a Download Link for the full-size image v1.1
Post by: 1aB on March 10, 2011, 04:36:27 pm
So here is v1.4

The most important changes for v1.4:

Many thanks for this release go to Mimer, not only for translating but also for helping with the testing.

Joe, to follow André's advice, would it be possible for you to put up this version to the first post?
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Αndré on March 10, 2011, 04:55:35 pm
would it be possible for you to put up this version to the first post?
Done.
Title: Re: Add a Download Link for the full-size image v1.1
Post by: TeknoSounds on March 11, 2011, 11:24:50 am
So here is v1.4

The most important changes for v1.4:
  • More placement options
  • Option to use intermediate size rather than full size
  • Danish translation by Mimer included
  • I suppose I found and fixed the bug which used to interfere with the Lightbox and similar plugins. It should now no longer depend on the plugins' order.

Many thanks for this release go to Mimer, not only for translating but also for helping with the testing.

Joe, to follow André's advice, would it be possible for you to put up this version to the first post?


Still having an issue with it not showing on my site, but I think it has to do with the custom coding I introduced for emailing me when FB comments are posted...
Title: Re: Add a Download Link for the full-size image v1.1
Post by: Joe Carver on March 11, 2011, 11:39:23 pm
So here is v1.4
Good work - thanks for the contributions.

Done.
Thank you  :)

Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: nickelas on August 09, 2011, 12:29:04 pm
Thanks for this plugin.
Attached is the swedish translation
Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: Afonso on March 29, 2012, 05:35:05 pm
Portuguese translation to  Add a Download Link for the full-size image

Nice plugin, good work.


Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: Sonya54 on October 04, 2015, 12:18:43 pm
Hi all ^^

Someone knows how i can add a download link only under each thumbnails ??

Thank you ^^
Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: Sonya54 on October 06, 2015, 11:17:51 am
anyone ?
I tried to figured out by myself but nothing good came out lol  :'( ;D
Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: ron4mac on October 06, 2015, 03:46:05 pm
I looked into the possibility of modifying this plugin to provide a download link with the thumbnail.  My conclusion is that it is currently not possible with this plugin (or any plugin) to provide that feature.

I didn't explore this specifically, but it could be possible for you to achieve it with a custom theme.
Title: Re: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: Sonya54 on October 06, 2015, 04:14:30 pm
I looked into the possibility of modifying this plugin to provide a download link with the thumbnail.  My conclusion is that it is currently not possible with this plugin (or any plugin) to provide that feature.

I didn't explore this specifically, but it could be possible for you to achieve it with a custom theme.

Thank you for your answer and for watching :)
So it's impossible for me (with a plugin) to have this result ?

Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: ron4mac on October 06, 2015, 04:50:55 pm
So it's impossible for me (with a plugin) to have this result ?
Awww ... jeez ... now you've done it ;)
You caused me to explore again to make sure my answer to you was correct. This time I think I've come up with a way to do it!
Give me a couple days and I'll have something for you.
Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: phill104 on October 06, 2015, 06:18:33 pm
Feel free to add a plugin hook if you feel it could be a worthy addition for more than just the one use.
Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: ron4mac on October 06, 2015, 06:40:43 pm
So it's impossible for me (with a plugin) to have this result ?
So I had a little time on my hands and it went pretty quickly. It's a little clunky, but I was able to add a download link to the thumbnail captions.
Perhaps it will be sufficient to fill your needs.
Replace/add the files below to the 1.4 version of the plugin.  All my changes to the plugin are marked by //RJC.
Title: Re: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: Sonya54 on October 06, 2015, 11:22:04 pm
So I had a little time on my hands and it went pretty quickly. It's a little clunky, but I was able to add a download link to the thumbnail captions.
Perhaps it will be sufficient to fill your needs.
Replace/add the files below to the 1.4 version of the plugin.  All my changes to the plugin are marked by //RJC.

Oh my God !!!! I don't know how can i thank youu ? ? ? 
It works perfectly , thank you very very much !!!!!!!  ;D ;D ;D  :-*
Title: Re: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: Joe Carver on October 08, 2015, 01:43:31 am
Many thanks ron4mac - I'm just getting caught up and you've already created the solution.

... It's a little clunky...
If it started as one of mine, the clunk was built in from the start.  :)
Title: Re: Add a Download Link for the full-size image v1.1 - v1.4
Post by: bg62 on January 15, 2017, 06:18:58 pm
french :)
mais pas tip top pour la dernière version ... :)
Title: Re: Optimisattion Add a Download Link for the full-size image v1.1 - v1.4
Post by: bg62 on February 03, 2017, 04:30:25 pm
Hello again ;)
I have already made a request:
Http://forum.coppermine-gallery.net/index.php/topic,78964.msg382846/topicseen.html#msg382846
Maybe a little confused ...
I would like to get the following changes:
1 - I have this:
Code: [Select]
<span id="plugin_pic_download_link" style="display: block; padding-top: 0.1em; text-align: center;">
<a class="button" href="./?file=pic_download_link/picture&pid=124" title="Enregistrer la photo">Télécharger la photo</a>
</span>
2 - I would like this:
Code: [Select]
<span id="plugin_pic_download_link" style="display: block; padding-top: 0.1em; text-align: center;">
<a class="button" href="./?file=pic_download_link/picture&pid=124" title="TITRE DE LA PHOTO">TITRE DE LA PHOTO</a>
</span>
If I also take this as an example:
http://refok.fr/wall/displayimage.php?album=7&pid=70
'Télécharger la photo' would be replaced for a button, and the 'real title' (+ atl) 'chutes d'eau glacée ' ... :) ( ou nom du fichier en grand format )

To get links (+ title + alt) that direct to the original image so that the engines can find them and reference them in Googles Images ...
The Top had a "button" (download) that has both options, and if possible with a download in another window (maybe with "onclick =" window.open (this.href); return False; ")
A bit like here, but still better!
http://www.unesourisetmoi.info/index.php?article277/joyeuses-fetes-fin-d-annee-en-images#prettyPhoto[7713]/2/
I start, be clement therefore, and moreover my English is void ...
But it's doable and I've seen it on other scripts, so this could benefit all sites made with GPC
To better understand I join 2 images below
Thank you in advance
Bg