Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When I click on the thumbnail to view an image using Lightbox2, I can see the file name of the original image, however, I see no link that will allow the user to download the original image. I thought I configured LightBox2 to allow that capability. Is this possible with this pair of modules (I'm using the 'recommended' release for 6x of both modules)
Comment | File | Size | Author |
---|---|---|---|
#11 | brilliant_gallery.module_2.txt | 50.49 KB | drpchris |
#10 | brilliant_gallery.module.txt | 50.42 KB | icesurfer |
Comments
Comment #1
drpchris CreditAttribution: drpchris commentedYou have to change the code of BG. Try this:
brilliant_gallery.module:
line 448 original:
$displayimage .= ' rel="lightbox['. $setname .']"';
new:
$displayimage .= ' rel="lightbox[' . $setname . '][<a href="' . $fullimgpath . '">' . $caption . '</a>]"';
Should give you a link to the image with the caption as the text.
Comment #2
drpchris CreditAttribution: drpchris commentedComment #3
icesurfer CreditAttribution: icesurfer commentedThanks. I'm new to drupal so I'm wary of hacking the modules at this time.
I found a way to get the high resolution image without modifying the module (although it requires the user to do a right-click). I set the maximum image width to 5000. When the thumbnail is clicked, I get a medium resolution image, if I expand that using the 4-outward-pointing-arrows icon the high resolution image is shown in a new window. The user can then right click and save the image. This should work for my tech-savy users until I have the courage to hack the module code.
(Nice to get such fast response to a question!)
Comment #4
icesurfer CreditAttribution: icesurfer commentedI made the change but there is still no link in the lightbox. I cleared the cache... do I need to do something else to see the change occur?
Comment #5
drpchris CreditAttribution: drpchris commentedSOrry didn't notice some other things:
you need to insert this at line 745 (before the
switch ($overbrowser) {
line):Comment #6
icesurfer CreditAttribution: icesurfer commentedI have made both changes on both my public and test website. I still don't have an option to download the original image. Could I be missing a security setting? (I have tested as user 0 as well as authenticated and anonymous users with the same results)
Comment #7
drpchris CreditAttribution: drpchris commentedIs there a URL you can give out so we can look at what you've got?
Comment #8
icesurfer CreditAttribution: icesurfer commentedSorry for the slow reply, other projects have taken priority this month. Now I'm back to working on my drupal site again. Please see Brilliant Image in use here: http://www.dasselambassadors.com/node/7
(I have the 6.x-3.6 release running on my localhost testbed, and I don't get a link to the original photo using the 3.6 release either)
Comment #9
drpchris CreditAttribution: drpchris commentedNo link because it's not showing up in your code. Maybe attach your brilliant_gallery.module file here so we can take a look?
Comment #10
icesurfer CreditAttribution: icesurfer commentedI have attached my current brilliant_gallery.module. It is the same as the 6.x-3.6 module (square thumbnails) with the exception of line 448. I had to add a .txt extension so I could upload it to this site.
Comment #11
drpchris CreditAttribution: drpchris commentedSorry - I gave the wrong line numbers the first time. I've attached a corrected file. The difference is that the change needs to be in the
render_brilliant_gallery()
function (approx line 860), not in therender_brilliant_gallery_manage()
function.Comment #12
drpchris CreditAttribution: drpchris commentedComment #13
icesurfer CreditAttribution: icesurfer commentedIt works! Thanks.
Will this be included in new releases, or will I need to make the patch with each new release?
In the past 4 days I installed Eclipse-PDT with the Zend debugger so I could single step through the code. Before I started stepping through the code, I thought I'd check the forum once more for an update. I was very pleased to see the solution posted.
Comment #14
skobe CreditAttribution: skobe commentedhey drupals,
3 years later i'm facing the same problem.. I'm using D7.15 lightbox2 7.x-1.0-beta1 and brilliant gallery 7.x-1.2 and tried your solution but as i expected it doesn't work with the new versions of this set of modules.
has anyone managed to provide a link in the lightbox to download the original image coming from a brilliant gallery?
appreciate any suggestions or thougts on this! thanks in advance!
skobe
Comment #15
SmokinX CreditAttribution: SmokinX commented@skobe
again 2 years later, I'm facing this too.
I applied above tip to lines 511 - 515 of gallery_showtime.inc in the D7 version with Lightbox2 selected:
Image caption is now opening the original image! Will do some more tweaking so it downloads instead of opens in window.
Comment #16
SmokinX CreditAttribution: SmokinX commentedAdjusted the code to download the image: