Would removing this code from the script ignore the right-click protection?
Removing that piece of code would make the download button show when right-click protection is on, but it wouldn't work because Smugmug prevents the download photo option from working when right-click protection is on (as I recall, you end up downloading a blank gif or something like that). So, there is no point in having a download button that doesn't work. Anyway, I see no point in having right-click protection on when you are letting people download originals (since it isn't accomplishing anything), so people who want downloads might as well turn right-click protection off.
Ok, so I turned right-click protection on. Enabled the Original file size. Updated. Still don't see the button. The gallery is here. I'll PM you the password to get in if you need it.
As jchin said, right-click protection must be OFF for the download option to work. I don't allow PMs. You can email me the password via my profile.
I meant off. Sorry. It is off, and no button. I'll email you the password.
In that gallery, you have no customization so the download button javascript is not present. I think that's probably because you have "Appearance" set to "Smugmug", not set to "Custom" in the customize gallery screen.
In that gallery, you have no customization so the download button javascript is not present. I think that's probably because you have "Appearance" set to "Smugmug", not set to "Custom" in the customize gallery screen.
That's so weird. I originally had it set to custom, and it wasn't working. So I thought by when you said it had to be the smugmug setting, I thought you might have meant that, so I switched it, and it still didn't work. I think my site was just acting weird today so the button wasn't working.
That fixed it though. Good to go. Thank you so much!
Is there a way to enable this though so that the original doesn't have to be selected? Can I have it set to large, or XL and be able to have the download button? Possibly by switching the code around in the last part where it says:
That's so weird. I originally had it set to custom, and it wasn't working. So I thought by when you said it had to be the smugmug setting, I thought you might have meant that, so I switched it, and it still didn't work. I think my site was just acting weird today so the button wasn't working.
That fixed it though. Good to go. Thank you so much!
Is there a way to enable this though so that the original doesn't have to be selected? Can I have it set to large, or XL and be able to have the download button? Possibly by switching the code around in the last part where it says:
?
No, I know of no way to make this kind of download work with any other size. The smugmug download URL only works with the original. It's Smugmug server-side functionality that triggers the download in the browser and it only works with the original size.
Never mind. That would be the wrong part of the code. I saw the part about the originals. I guess the only way that I could do that for that specific gallery would be to upload the photos to smugmug at the "large" size by cropping them in my PP software correct? Otherwise it would apply that download button to all my pages. Unless...No. Because my "for sale" galleries don't have right-click protection turned off, so the button wouldn't be there correct? or it just wouldn't work actually I think, which is stupid. So yeah, I would just need to upload smaller files.
*sorry for the thought process, I tend to type what I'm thinking*
Never mind. That would be the wrong part of the code. I saw the part about the originals. I guess the only way that I could do that for that specific gallery would be to upload the photos to smugmug at the "large" size by cropping them in my PP software correct? Otherwise it would apply that download button to all my pages. Unless...No. Because my "for sale" galleries don't have right-click protection turned off, so the button wouldn't be there correct? or it just wouldn't work actually I think, which is stupid. So yeah, I would just need to upload smaller files.
*sorry for the thought process, I tend to type what I'm thinking*
Yes, a separate gallery where the originals are actually smaller files is the only way I know of to make the download button both appear and work with smaller files.
Yes, a separate gallery where the originals are actually smaller files is the only way I know of to make the download button both appear and work with smaller files.
Here's the code. It automatically detects whether originals are enabled and just adds the download button if originals are enabled and doesn't if they aren't. It is only configured to work in Smugmug view. Just paste this code into your bottom javascript.
function IsSmugmugView()
{
return(YD.hasClass(document.body, "smugmug"));
}
function IsGalleryPage()
{
return(YD.hasClass(document.body, "galleryPage"));
}
// code to insert a download button for any gallery that has originals enabled
onPhotoShow.subscribe(ProcessDownloadButton);
function ProcessDownloadButton()
{
// set onlyInGalleries to true if you only want a download button in gallery views
// set onlyInGalleries to false if you want a download button in other views too like (search, keywords, date, etc...)
var onlyInGalleries = true;
if (IsSmugmugView() && (IsGalleryPage() || !onlyInGalleries))
{
if (photoInfo[ImageID].albumOriginals && !photoInfo[ImageID]['protected'] && (photoInfo[ImageID].Format !== "MP4"))
{
var downloadParent = "cartButtonsWrapper";
if (!document.getElementById("cartButtonsWrapper"))
{
downloadParent = "altViews";
}
InsertDownloadButton(downloadParent);
}
else
{
// disable the button
var downloadButton = YAHOO.widget.Button.getButton("downloadButtonId");
if (downloadButton)
{
downloadButton.set("disabled", true);
}
}
}
}
function InsertDownloadButton(parentId)
{
// now add the download button
var parentDiv = document.getElementById(parentId);
var downloadButton = document.getElementById("downloadButtonId");
if (downloadButton)
{
// make sure it is enabled
YAHOO.widget.Button.getButton("downloadButtonId").set("disabled", false);
}
else if (parentDiv)
{
var downloadButtonInfo =
{
id: "downloadButtonId",
label: "Download Image...",
container: parentDiv,
type: "button",
className: "sm-button sm-button-small themesButton glyphButton",
onclick: { fn: InitiateDownloadImage }
};
var dButtonObj = new YAHOO.widget.Button(downloadButtonInfo);
}
}
function InitiateDownloadImage()
{
// construct the download URL
window.location = "/photos/" + ImageID + "_" + ImageKey + "-D.jpg";
}
This should result in a download button that looks like this:
Just wanted to say thanks for this script. Just what I needed
Canon 50D | EF-S 17-55 f/2.8 IS | 70-200 f/2.8L IS
2x White Lightning x1600 | 580 EXII
Sekonic L-358 | 2x Pocket Wizard II | TC-80N3 Remote Shutter
Hi! Does anyone know if this is still working? I cut and pasted the code and made sure my originals are enabled. I still can't see the download link. Any help is much appreciated!!
Hi! Does anyone know if this is still working? I cut and pasted the code and made sure my originals are enabled. I still can't see the download link. Any help is much appreciated!!
The script works and we could help you figure out why it isn't working if you included a link to your Smugmug site and to a non-password protected gallery that has originals enabled. The link in your signature now does not appear to be your smugmug site.
Comments
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
I meant off. Sorry. It is off, and no button. I'll email you the password.
OneTwoFiftieth | Portland, Oregon | Modern Portraiture
My Equipment:
Bodies: Canon 50D, Canon EOS 1
Lenses: Canon 10-22mm f/3.5-4.5, Canon 24-105mm f/4L IS, Canon 50mm f/1.4, Canon 100mm f/2.8 Macro, Canon MP-E 65mm f/2.8
Lighting: Canon 580EXII, Canon 420 EX, 12" Reflector, Pocket Wizard Plus II (3), AB800 (3), Large Softbox
Stability: Manfrotto 190CXPRO3 Tripod, Manfrotto 488RC4 Ball Head, Manfrotto 679B Monopod
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
That's so weird. I originally had it set to custom, and it wasn't working. So I thought by when you said it had to be the smugmug setting, I thought you might have meant that, so I switched it, and it still didn't work. I think my site was just acting weird today so the button wasn't working.
That fixed it though. Good to go. Thank you so much!
Is there a way to enable this though so that the original doesn't have to be selected? Can I have it set to large, or XL and be able to have the download button? Possibly by switching the code around in the last part where it says:
?
OneTwoFiftieth | Portland, Oregon | Modern Portraiture
My Equipment:
Bodies: Canon 50D, Canon EOS 1
Lenses: Canon 10-22mm f/3.5-4.5, Canon 24-105mm f/4L IS, Canon 50mm f/1.4, Canon 100mm f/2.8 Macro, Canon MP-E 65mm f/2.8
Lighting: Canon 580EXII, Canon 420 EX, 12" Reflector, Pocket Wizard Plus II (3), AB800 (3), Large Softbox
Stability: Manfrotto 190CXPRO3 Tripod, Manfrotto 488RC4 Ball Head, Manfrotto 679B Monopod
No, I know of no way to make this kind of download work with any other size. The smugmug download URL only works with the original. It's Smugmug server-side functionality that triggers the download in the browser and it only works with the original size.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
*sorry for the thought process, I tend to type what I'm thinking*
OneTwoFiftieth | Portland, Oregon | Modern Portraiture
My Equipment:
Bodies: Canon 50D, Canon EOS 1
Lenses: Canon 10-22mm f/3.5-4.5, Canon 24-105mm f/4L IS, Canon 50mm f/1.4, Canon 100mm f/2.8 Macro, Canon MP-E 65mm f/2.8
Lighting: Canon 580EXII, Canon 420 EX, 12" Reflector, Pocket Wizard Plus II (3), AB800 (3), Large Softbox
Stability: Manfrotto 190CXPRO3 Tripod, Manfrotto 488RC4 Ball Head, Manfrotto 679B Monopod
Yes, a separate gallery where the originals are actually smaller files is the only way I know of to make the download button both appear and work with smaller files.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Figured. Thank you for all your help.
OneTwoFiftieth | Portland, Oregon | Modern Portraiture
My Equipment:
Bodies: Canon 50D, Canon EOS 1
Lenses: Canon 10-22mm f/3.5-4.5, Canon 24-105mm f/4L IS, Canon 50mm f/1.4, Canon 100mm f/2.8 Macro, Canon MP-E 65mm f/2.8
Lighting: Canon 580EXII, Canon 420 EX, 12" Reflector, Pocket Wizard Plus II (3), AB800 (3), Large Softbox
Stability: Manfrotto 190CXPRO3 Tripod, Manfrotto 488RC4 Ball Head, Manfrotto 679B Monopod
Just wanted to say thanks for this script. Just what I needed
2x White Lightning x1600 | 580 EXII
Sekonic L-358 | 2x Pocket Wizard II | TC-80N3 Remote Shutter
Studio Simplicity
www.studiosimplicity.com
jenny@studiosimplicity.com
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question