[DownloadLink] New Module
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
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. |
|
tccarpenter
Joined: 2007-03-13
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! |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
I would suggest is not having the permissions for downloads on by default. 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. |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
I have created a codex page: Dave PS: dm |
|
tberman333
![]()
Joined: 2007-12-26
Posts: 41 |
![]() |
Post Removed... |
|
kenholmes
Joined: 2007-10-25
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. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
kenholmes wrote:
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, 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.) |
|
Oli4
Joined: 2008-07-15
Posts: 18 |
![]() |
-deleted- |
|
alecmyers
Joined: 2006-08-01
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. |
|
drei
Joined: 2008-04-03
Posts: 1 |
![]() |
I followed the instructions on the codex page for inserting a link to download the original image. Is there a possibility to only show the link if the permission to download the original version is given? - David. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
Is there a possibility to only show the link if the permission to download the original version is given? 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. |
|
swordfish
![]()
Joined: 2004-10-01
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. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
So, guess thats what you mean by not yet compatible with 2.3. Yes, the module reuses code from the core.DownloadItem view, which was considerably refactored for 2.3 in a way that breaks downloadlink. |
|
swordfish
![]()
Joined: 2004-10-01
Posts: 388 |
![]() |
Ah, I see. For now I just removed permission checking in your module and the download link works well. |
|
dlongnecker
Joined: 2007-03-08
Posts: 21 |
![]() |
Quote:
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. 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! |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
I've updated this module to a 2.3-compatible version. |
|
blade007
Joined: 2006-08-07
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"> 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. |
|
jfgarcia
![]()
Joined: 2007-11-06
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. ----------------------------- |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
It's in the community repository. Make sure this option is ticked before you update your plugins list. |
|
jfgarcia
![]()
Joined: 2007-11-06
Posts: 11 |
![]() |
I've done that, but downloadlink is not in the list... ----------------------------- |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
well, there it is... I don't know what else to say except look again. |
|
ttkingdom
Joined: 2007-08-25
Posts: 8 |
![]() |
blade007 wrote:
Your piece of code works great with Matrix theme. However in IE I get a HTTP 500 Error, works with Firefox though |
|
TSB
Joined: 2009-04-06
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? |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
You can download tarballs for all the community modules directly from Sourceforge: in the gallery-contrib project, here: Go into which ever one you want and use the download GNU tarball at the the end of the page. |
|
TSB
Joined: 2009-04-06
Posts: 2 |
![]() |
Thanks for your quick reply! Good plugin by the way |
|
kdji123
Joined: 2009-05-05
Posts: 24 |
![]() |
well this module works pretty fine. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
which i want to convert to [Download Wallpaper(size)] Edit the file module.inc - look for something like "Download %s". |
|
PaulYaro
Joined: 2009-04-04
Posts: 23 |
![]() |
Hello alecmyers, |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
You can check the old files out of the Subversion repository on Sourceforge, here: I'm afraid I don't have a zipped version of old code. Quote:
Also, one more question: is it possible to limit item action/download only for one album? 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. |
|
PaulYaro
Joined: 2009-04-04
Posts: 23 |
![]() |
Hello alecmyers, |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
You want revision 1379 - Put 1379 in the box for revision number. Quote:
this action is always possible If the user/guest doesn't have the relevant [downloadlink] permission then the download link doesn't appear in the menu. |
|
PaulYaro
Joined: 2009-04-04
Posts: 23 |
![]() |
Hi, |
|
diegosanchez
Joined: 2009-12-07
Posts: 54 |
![]() |
hey i had to change the Theme customisation link from <a href="{g->url arg1="view=downloadlink.OfferDownload" arg2="itemId=`$theme.item.id`"}"> Download and save full image</a> to
therefore i can click link to download original |
|
kdji123
Joined: 2009-05-05
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. regard. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
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. 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. |
|
kdji123
Joined: 2009-05-05
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(); someone with php skill can help, |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
and the change that should be made is in the following code in module inc of downloadlink module. 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 asort($potentialImages); 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. Quote:
the sorting is clearly alphanumerically. 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.) |
|
kdji123
Joined: 2009-05-05
Posts: 24 |
![]() |
ur right alecmyers the sorting is not in the module inc. i think or else if u could suggest alternate possibility, thanks. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
it would be better if the module has its own block. I don't think that would suit most people. How about this: see the part Quote:
'text' => 'Download photo(%s x %s)','arg1' => $potentialImage->getWidth(),'arg2' => $potentialImage->getHeight()) 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. |
|
kdji123
Joined: 2009-05-05
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. Regards! |
|
diegosanchez
Joined: 2009-12-07
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 |
|
alecmyers
Joined: 2006-08-01
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. |
|
diegosanchez
Joined: 2009-12-07
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. |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
what id be looking for would be something conditional. You can program it however you like. |
|
diegosanchez
Joined: 2009-12-07
Posts: 54 |
![]() |
any help on recreating the script would be great, i cant make heads or tails on whats there at the moment |
|