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 = "<h2>An error occurred</h2> 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 .= "<div style='float: right;'><img src='".$thumbnail."' alt='".$album_title."' class='$class'></div>";
 
   $output .= "<h2>".$album_title."</h2>";
-  $output .= "<p>". format_plural($album['photos'], '1 photo', '%count photos') ." in this album (<a href='/flickr/setimages/$album_id'>view locally</a> - <a href='$link_to_photoset_on_flickr'>view on Flickr</a>).</p>";
+  $output .= "<p>". format_plural($album['photos'], '1 photo', '%count photos') ." in this album (<a href='flickr/setimages/$album_id'>view locally</a> - <a href='$link_to_photoset_on_flickr'>view on Flickr</a>).</p>";
   $output .= "<p>$album_description</p><br clear='both' />";
   
   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 = "<div style='text-align: center'>";
       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 .= "<a href=\"". variable_get('flickr_proot', 'http://www.flickr.com/photos/').variable_get('flickr_uname', 'jluster')."/$photo_id\"><img src=\"$image\" class='".variable_get('flickr_class','flickr')."'/></a>";
+		// WRONG: rfay Had to change flicker_username to flicker_uid here
+        $output .= '<div class="'.variable_get('flickr_class', 'flickr').'"><a href="'. variable_get('flickr_proot', 'http://www.flickr.com/photos/').variable_get('flickr_uid', 'jluster')."/$photo_id\"><img src=\"$image\" class='".variable_get('flickr_class','flickr')."'/></a></div>";
       }
       $output .= "</div>";
     }
