It would be nice to have the image pages within the drupal site, and not flickr. Maybe have the flickr description and next/previous image links below the current image.

Comments

andrewlevine’s picture

Assigned: Unassigned » andrewlevine
ezichko’s picture

yes, that would be great. wordpress can do that right now.

andrewlevine’s picture

It's hard to find the time to work on flickrhood since I've been really busy lately, but I'm going to work on a thickbox based implementation of this as soon as I can. I really appreciate the feedback.

ojkelly’s picture

Hey andrewlevine, just wondering how far you haven gotten with this and if its worth me having a crack at it?

thanks m8

ojkelly’s picture

hey well i had a crack at it and omfg it works :p

it does however need work, i think in the admin or user prefs to be able to select the display size would be good, but neway it works.

heres the code

function theme_flickrhood_user_photos ($uid, $fp_arr) {
	
	drupal_add_css(drupal_get_path('module', 'flickrhood') . '/flickrhood.css');
	
	//thickbox integration
	drupal_add_css(drupal_get_path('module', 'flickrhood') . '/thickbox.css');
	drupal_add_js(drupal_get_path('module', 'flickrhood') . '/thickbox.js');

	$output = theme('pager', NULL, variable_get('flickrhood_photos_per_page', $fp_arr['info']['PERPAGE']));
	
	$output .= "<ul id=\"flickrhood_photolist\">\n";
    
    if (array_key_exists('photos', $fp_arr)) {
	    foreach ($fp_arr['photos'] as $photo) {
	    	$imgpage_url = 'http://www.flickr.com/photos/' . $photo['OWNER'] . '/' . $photo['ID'];
	    	$img_url = 'http://static.flickr.com/' . $photo['SERVER'] . '/' . $photo['ID'] . '_' . $photo['SECRET'] . '_t.jpg';
	    	$full_img_url = 'http://static.flickr.com/' . $photo['SERVER'] . '/' . $photo['ID'] . '_' . $photo['SECRET'] . '_b.jpg';

	        $output .= '<li>';
					// The following has been edited by ojk007
	        //$output .= l("<img src=\"$img_url\">", $imgpage_url, array(), NULL, NULL, FALSE, TRUE);
	        $output .= l("<img src=\"$img_url\">", $full_img_url, array("rel" => "gallery-$uid", "class" => "thickbox"), NULL, NULL, FALSE, TRUE);
	        $output .= '</li>';
	        $output .= "\n";
	
	    }
    }

    $output .= '</ul>' . "\n";
    
    $output .= 
    theme('pager', NULL, variable_get('flickrhood_photos_per_page', $fp_arr['info']['PERPAGE']));
    
    return $output;
}
ojkelly’s picture

oops in my haste to get that up, as im about to leave i forgot to add this:

you need to put thickbox.js and thickbox.css in the flickhood module folder.

You can download them from here http://jquery.com/demo/thickbox/

:D

andrewlevine’s picture

Looks awesome. I'm going to commit this to head the second I get a chance to test it. I'm also going to eventually make another "mode" of single photo display using thickbox's "AJAX Content" feature which will display a photo's image, comments, tags.

However, before that I'm going to work on making sure flickrhood css works correctly in the Garland (default) theme. So if you've got nothing else to do :) you could work on that too.

Thanks so much for the help!

ojkelly’s picture

well i noticed by default it shows the bullets next to each image. i did however find 2 solid solutions. one in the css, the other the php.

function theme_flickrhood_user_photos ($uid, $fp_arr) {
    
    drupal_add_css(drupal_get_path('module', 'flickrhood') . '/flickrhood.css');
    
    //thickbox integration
    drupal_add_css(drupal_get_path('module', 'flickrhood') . '/thickbox.css');
    drupal_add_js(drupal_get_path('module', 'flickrhood') . '/thickbox.js');

    $output = theme('pager', NULL, variable_get('flickrhood_photos_per_page', $fp_arr['info']['PERPAGE']));
    
    $output .= "<ul id=\"flickrhood_photolist\">\n";
    
    if (array_key_exists('photos', $fp_arr)) {
        foreach ($fp_arr['photos'] as $photo) {
            $imgpage_url = 'http://www.flickr.com/photos/' . $photo['OWNER'] . '/' . $photo['ID'];
            $img_url = 'http://static.flickr.com/' . $photo['SERVER'] . '/' . $photo['ID'] . '_' . $photo['SECRET'] . '_t.jpg';
            $full_img_url = 'http://static.flickr.com/' . $photo['SERVER'] . '/' . $photo['ID'] . '_' . $photo['SECRET'] . '_b.jpg';

//Following 1 line has been edited
            $output .= '<li style=\"list-style-type:none !important; list-style:none !important;\">';
            $output .= l("<img src=\"$img_url\">", $full_img_url, array("rel" => "gallery-$uid", "class" => "thickbox"), NULL, NULL, FALSE, TRUE);
            $output .= '</li>';
            $output .= "\n";
    
        }
    }

    $output .= '</ul>' . "\n";
    
    $output .= 
    theme('pager', NULL, variable_get('flickrhood_photos_per_page', $fp_arr['info']['PERPAGE']));
    
    return $output;
}

Of course this needs to be done for ever list in the php, but as this is set as an inline style, it cannot be overidded by garland. It could be set as optional though, through a simple var.

ojkelly’s picture

wow i just realised by not linking back to the flickr photo page this currently violates flickrs TOS, so im currently working on a small fix.

ojkelly’s picture

hey firstly soz for the million posts ive made here.

I've reached the limits of the gallery feature in ThickBox, but i reckon we can do it with the ajax feature, so im gonna have a go at it.

andrewlevine’s picture

Status: Active » Closed (won't fix)

move to the flickr module and refile if necessary.