Full size pictures linked from sets page

Edward Andrews - May 2, 2009 - 16:11
Project:Flickr
Version:6.x-1.1
Component:flickr_sets
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

Edward Andrews - June 26, 2009 - 22:41

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

<?php
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.

#2

binford2k - September 17, 2009 - 21:38

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

 
 

Drupal is a registered trademark of Dries Buytaert.