Index: flickr.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/flickrmodule/flickr.module,v
retrieving revision 1.2
diff -F^f -u -b -r1.2 flickr.module
--- flickr.module 29 Dec 2004 08:00:15 -0000 1.2
+++ flickr.module 2 Dec 2005 21:28:46 -0000
@@ -82,12 +82,15 @@ function flickr_page() {
$url = "http://www.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=$flickr_api_key&user_id=$flickr_uid";
$resp = flickr_get_cached_file_contents($url, 'r', 600, variable_get('flickr_cache','/tmp'));
$settree = flickr_make_xmltree($resp);
+ watchdog("user","Flickr: using key $flickr_api_key and uid $flickr_uid, settree=$settree");
- if (!empty($top_level_tree['rsp']['err']) || empty($settree))
+ // WRONG: this should be $settree instead of $top_level_tree. rfay 10/17/05
+ if (!empty($settree['rsp']['err']) || empty($settree))
{
$output = "
An error occurred
Somehow we were unable to parse the response. Please contact the site owner for investigation.";
}
else {
+
$i = 0;
foreach ($settree['rsp']['photosets'] as $album_id => $album_details) {
$output .= theme('flickr_photoset', $album_details, $album_id, "_t");
@@ -109,7 +112,7 @@ function theme_flickr_photoset($album, $
// $tn_size == set to _t, _s, _m, "", or _o
$thumbnail = variable_get('flickr_proot','http://www.flickr.com/photos/').$album['primary']."_".$album['secret'].$tn_size.".jpg";
- $link_to_photoset_on_flickr = variable_get('flickr_proot','http://www.flickr.com/photos/').variable_get('flickr_uname','jluster')."/sets/". $album_id;
+ $link_to_photoset_on_flickr = variable_get('flickr_proot','http://www.flickr.com/photos/').variable_get('flickr_uid','jluster')."/sets/". $album_id;
$album_title = $album['title'];
$album_description = $album['description'];
$css_class = variable_get('flickr_class', 'flickr');
@@ -118,7 +121,7 @@ function theme_flickr_photoset($album, $
$output .= "";
$output .= "".$album_title."
";
- $output .= "". format_plural($album['photos'], '1 photo', '%count photos') ." in this album (view locally - view on Flickr).
";
+ $output .= "". format_plural($album['photos'], '1 photo', '%count photos') ." in this album (view locally - view on Flickr).
";
$output .= "$album_description
";
return $output;
@@ -129,7 +132,7 @@ function flickr_setimages() {
$setid = arg(2);
$flickr_api_key = variable_get('flickr_apik','bd4441fc9cef3745a18955ffdf91c732');
$flickr_uid = variable_get('flickr_uid','35034355182@N01');
- $url = "http://www.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=$flickr_api_key&user_id=$flickr_uid&photoset_id=$setid";
+ $url = "http://www.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=$flickr_api_key&user_id=$flickr_uid&photoset_id=$setid&extras=original_format";
$resp = flickr_get_cached_file_contents($url, 'r', 600, variable_get('flickr_cache','/tmp'));
$settree = flickr_make_xmltree($resp);
@@ -144,7 +147,8 @@ function flickr_setimages() {
$output = "";
foreach ($settree['rsp'][$setid] as $photo_id => $photo_details) {
$image = "http://photos".$photo_details['server'].".flickr.com/".$photo_id."_".$photo_details['secret']."_m.jpg";
- $output .= "

";
+ // WRONG: rfay Had to change flicker_username to flicker_uid here
+ $output .= '
";
}
$output .= "
";
}