First of all thanks for developing this module - it works really well and is very useful.

I'm using it with Lightbox2 6.x-1.9 to load flickr images on every page except */sets. This means I can go to the sets page, click on the thumbnail for a particular set and see all the photos in that set. If I click on one of the photos then, I get the lightbox image popping up with the medium sized photo. I also get a medium sized photo popping up when I click on one of the images in the sidebar blocks (random or recent).

Is it possible to make the link to the large or original image instead of the medium sized one? If it was too large, then lightbox could manage that, but at the moment there is no way of seeing the larger images without leaving the site.

Many thanks

Comments

Edward Andrews’s picture

I managed to do this by changing theme_flickr_photo_box in flickr.module to this:

function theme_flickr_photo_box($p, $size = NULL, $format = NULL, $attribs = NULL) {
$img = flickr_img($p, $size, $attribs);
$title = is_array($p['title']) ? $p['title']['_content'] : $p['title'];
$photo_url = flickr_photo_page_url($p['owner'], $p['id']);
$link_img = flickr_photo_img($p, 'b');

$output = "<div class='flickr-photo-box'>\n";
$output .= "<a href='$link_img'>$img</a>";
$output .= "<a href='$photo_url'>";
$output .= '<div>'. check_plain($title) ."</div>\n"; $output .= "</a>";
$output .= "</div>\n";
return $output;
}

I added an extra variable for the link to the image $link_img and set its size to b - large. For some reason o - original doesn't work.

Then I set lightbox automatic image handling for flickr to html grouped - if set to lightbox then it still only links to the smaller image.

binford2k’s picture

please note that Flickr TOS requires you to link back to the photo page, not just the image

ekkljs’s picture

Does someone know how to resolve this issue?

Edward Andrews’s picture

In the end what I did was change the lightbox module, rather than the flickr module.

In lightbox, in the directory js, there's a file named auto_image_handling.js

If you alter line 82 from

href = $(child).attr("src").replace("_s.", ".").replace("_t.", ".").replace("_m.", ".").replace("_b.", ".");

to

href = $(child).attr("src").replace("_s.", "_b.").replace("_t.", "_b.").replace("_m.", "_b.");

then lightbox loads the large images rather than the smaller ones.

This doesn't get round the fact that the Flickr TOS requires you to link back to the photo page, not just the image

tomnoels’s picture

That was it where I was searching for the whole evening.

thanks a lot!

lolandese’s picture

Version: 6.x-1.1 » 7.x-1.x-dev
Status: Active » Fixed

The D7 dev version opens Flickr photos in colorbox, Lightbox or alike.
A title caption under the image links to the Flickr photo page to comply with their TOS.

If you still need this for D6, open a new issue with a request to back port.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.