Now in the community repository, see the "add more plugins" page.
Note: this module was called download, but on uploading it to the repository I see that there already exists a download module, that does something similar although without the links and permissions (I don't think it ever got to the stage of being automatically installable) so I've renamed this one downloadlink. Sorry for the inconvenience. If you're using it under its previous name you should probably uninstall that, delete it, and then install this one.
I've updated the download module I created for someone, added permissions and some other misc stuff (downloads are now of the preferred derivative rather than the original). A few people might find it useful.
What it does is add a set of "Download Photo" links under each picture - you can set permissions to show the link for originals, resizes (both on by default) and thumbnails (off by default).
If you installed the previous version please *uninstall* that before copying this over and installing - or else you won't see the new permissions.
If it gets a thumbs up from one or two people I'll put it in the repository.
Posts: 13
I've updated my download module with the new files. Thank you for the added permissions, just what I needed! The only change I would suggest is not having the permissions for downloads on by default. Allowing downloads would be exceptions rather than the rule at least in my case.
Thanks for your work on this!
Posts: 4342
But you won't have to answer the flood of "I've installed this module and I can't see any download links! Why doesn't it work?" questions from people who are too lazy or ignorant to read the module description and read that there are permissions to be set.
Posts: 27300
I have created a codex page:
http://codex.gallery2.org/Gallery2:Modules:downloadlink
please feel free to flesh out.
Developers don't like to do documentation, so if you like this module please contribute to helping out by making the documentation better for all.
Dave
PS:
alecmyers, thanks for the continued contribution.
dm
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 41
Post Removed...
Posts: 4
This is an excellent plugin, but is there any way to get a download link on the photo page? Looks like it only displays on the thumbnail page, which is less than optimal. I have large images that I need to offer to the press (3000x2000) and they don't always understand the "right click and chose save target as" instructions, and enlarging a photo that size in a browser is a bit much.
Posts: 4342
The links display alongside all the other ItemActions, in both album and photo pages. The exact location depends on your theme. For the Matrix (default) theme, this is a typical display on a photo page (see attachment.)
Posts: 18
-deleted-
Posts: 4342
This module isn't compatible with Gallery 2.3. I've an updated version which I'll put into the repository when 2.3 is formally released.
Posts: 1
I followed the instructions on the codex page for inserting a link to download the original image.
This link though is now shown no matter how the permissions are set.
Is there a possibility to only show the link if the permission to download the original version is given?
- David.
Posts: 4342
Of course! you can do anything you like in Gallery....
The best way I think would be to add a callback to the module to check the permission, then you can make display of the link conditional on that permission with smarty {if} {/if} tags.
Posts: 388
G2 2.3 RC1 is here (using it now) and I'd really like to use this module. Have it installed but I get a G2 permission denied error when clicking the download link; even as admin. So, guess thats what you mean by not yet compatible with 2.3.
Anyways, looking forward to it when the day comes.
Posts: 4342
Yes, the module reuses code from the core.DownloadItem view, which was considerably refactored for 2.3 in a way that breaks downloadlink.
Posts: 388
Ah, I see. For now I just removed permission checking in your module and the download link works well.
Posts: 21
Looks like 2.3 is now available. When my users try to download, the get
Security Violation: The action you attempted is not permitted.
Even I get it with every access right possible. I am hoping your updates will fix it!
Posts: 4342
I've updated this module to a 2.3-compatible version.
Posts: 12
Hi there. Awesome. I'm, going to have have a go with this module.
On my Pure Anime Gallery I was using a bit of code to generate a download link below the image, in photo.tpl
In fact I was using:
{* Download link for item in original format *}
<div class="gbBlock">
{$theme.item.title|default:$theme.item.pathComponent|markup:strip}
{g->text text=" : Right click and save link as to "}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}">
{g->text text="Download this picture in original format" arg1=$theme.sourceImage.itemTypeName.1}
</a>
</div>
which is probably a bit of a frig, but works. Not very elegant because there's nothing to set it on or off individual albums. I'm going to have a go with yours and see if I can get some more control and cooler results.
Posts: 11
Hi,
I've updated the plugins page but downloadlink doesn't show.
is it normal?
I'd like to allow visitors to download pictures but can't do that...
Thanks.
-----------------------------
Live from Brittany, France...
Posts: 4342
It's in the community repository. Make sure this option is ticked before you update your plugins list.
Posts: 11
I've done that, but downloadlink is not in the list...
-----------------------------
Live from Brittany, France...
Posts: 4342
well, there it is... I don't know what else to say except look again.
Posts: 8
Your piece of code works great with Matrix theme.
However in IE I get a HTTP 500 Error, works with Firefox though
Posts: 2
Hi There
Would someone be so kind to supply a direct link to download this plugin as my gallery sits behind a corporate proxy server?
Posts: 4342
You can download tarballs for all the community modules directly from Sourceforge: in the gallery-contrib project, here:
http://gallery-contrib.svn.sourceforge.net/viewvc/gallery-contrib/trunk/gallery2/modules/
Go into which ever one you want and use the download GNU tarball at the the end of the page.
Posts: 2
Thanks for your quick reply! Good plugin by the way
Posts: 24
well this module works pretty fine.
however,i want a little customization. this module shows [Download Photo(size)]
which i want to convert to [Download Wallpaper(size)]
how to do this.
Posts: 4342
Edit the file module.inc - look for something like "Download %s".
Posts: 23
Hello alecmyers,
I use Gallery for over year - its excellent and I see you give much work to this project.
I have tried your module downloadlink however my version of gallery is 2.2.4 and for some important reasons cannot be updated. So, I see downloadlink module in repository works only with 2.3, will not work with my Gallery.
I have installed download module but I think it is different a little bit. Would you be so kind to give a link to your old version of module for version 2.2.4 ?
Also, one more question: is it possible to limit item action/download only for one album? However, permissions for parent and other albums MUST allow to view all version for everybody? Is it possible?
Hope you understand my question, sorry for my poor english.
PaulYaro
Posts: 4342
You can check the old files out of the Subversion repository on Sourceforge, here:
http://gallery-contrib.svn.sourceforge.net/viewvc/gallery-contrib/trunk/gallery2/modules/downloadlink/
There are only three files so it shouldn't take long. You want revision 1379 for the version without the G2.3 changes.
I'm afraid I don't have a zipped version of old code.
I don't really understand what you want to do - but in general the G2 permissions system is configurable so that each album and item can have different permissions, so - probably.
Posts: 23
Hello alecmyers,
thanks for so quick reply - you are always on-line!
What I see in your link is: update for G2.3
so, no old version.
My second question - sorry if not precise, or I am missing something:
if I set permissions for guests ONLY TO SEE ITEMS in album, nothing more, there is always drop-down action list and download possibility. I would like to give this permission only in some subalbums.
I have checked all permission, but this action is always possible, no metter what I set in permission. Is it my mistake somewhere?
Thanks - PaulYaro
Posts: 4342
- Put 1379 in the box for revision number.
If the user/guest doesn't have the relevant [downloadlink] permission then the download link doesn't appear in the menu.
Posts: 23
Hi,
thank you very much - version that you recommended works excellent. No problem with permission.
For some reasons version of "download" module (not your downloadlink) had no possibility to set permissions - there was no this option on permission list, simply no!
Thanks again, alecmyers!
Posts: 54
hey i had to change the Theme customisation link
from
to
<a href="{g->url arg1="view=downloadlink.OfferDownload" arg2="itemId=`$child.id`"}"> Download and save full image</a>
therefore i can click link to download original
Posts: 24
[img]http://gallery.menalto.com/files/untitled_10.JPG[/img]
As it can be seen in above pic., the links given by download link module is not in ascending or descending order of image size,But is based on the first digit in the size.
I want the help to make it to be organized on the basis of sizes as the case of "block-core-PhotoSizes" module.
regard.
Posts: 4342
That's correct. All the itemAction links are listed alphabetically, not alphanumerically, I think. Not sure where you'll change that. It's not in the downloadlink module, you may have to hack around in your templates to re-sort the array of itemAction links. Good luck.
Posts: 24
the sorting is clearly alphanumerically.
and the change that should be made is in the following code in module inc of downloadlink module.
$itemTypeNames = $item->itemTypeName();
foreach ($potentialImages as $potentialImage) {
$links[$masterId][] =
array('text' => $this->translate(array('text' => 'Download photo(%s x %s)','arg1' =>
$potentialImage->getWidth(),'arg2' => $potentialImage->getHeight())),
'params' => array('view' => 'downloadlink.OfferDownload',
'itemId' => $potentialImage->getId()));
}
someone with php skill can help,
ithink uksort function of arrey will help dont how though.
Posts: 4342
I don't think you can set the order the links are displayed in that bit of code.
I think *all* the links under the item are sorted independently, before they are displayed. If you want to test that, try inserting
before the 'foreach' loop. If that makes a difference to the order the links are displayed then you can fix the order they're displayed in there. (Post back, and I'll see if I can work out how, for you). If it doesn't make a difference, then I think you'll have to modify code elsewhere.
I think we disagree on the meaning of alphabetical vs. alphanumeric. Regardless, it doesn't sort the way you want.
(EDITED to change sort to asort - the indexation is important.)
Posts: 24
ur right alecmyers the sorting is not in the module inc. i think
it would be better if the module has its own block.
what say u?
or else if u could suggest alternate possibility,
thanks.
Posts: 4342
I don't think that would suit most people.
How about this: see the part
What happens if you use a different format string other than %s - maybe something that will pad the number out with spaces at the front then you'd get "<space>150" and "1600" for instance, and they'd sort in the right order. I think you do that by changing %s to %4d, for example. Try it.
Posts: 24
ya alecmyers this works,thanks a lot!.
though i want to separate the links from other modules like favorite or ecard. so guess the only way to do this is to use separate block for Downloadlink.
i will greatly appreciate it if u could suggest that what should be the parameters for module.inc and the callbacks for the module.template.
Regards!
Posts: 54
is there a way to get it so that you can specify individual names
such as instead of Download Photo (100 x 75) and Download Photo (3648 x 2736)
you can have Download Thumbnail and Download Original
Posts: 4342
@diegosanchez: read the posts above from kdji123 about sorting the links in a different order, and refer to the code in the module.inc file. Obviously you can change the code so the links have any name you like.
Posts: 54
from the information gathered above i can changed the text displayed, which then changes the entire lot.
what id be looking for would be something conditional.
Posts: 4342
You can program it however you like.
Posts: 54
any help on recreating the script would be great, i cant make heads or tails on whats there at the moment