Index: /extensions/flickr2piwigo/admin/import.php
===================================================================
--- /extensions/flickr2piwigo/admin/import.php	(revision 17475)
+++ /extensions/flickr2piwigo/admin/import.php	(revision 17476)
@@ -3,4 +3,6 @@
 
 set_time_limit(600);
+
+include_once(PICASA_WA_PATH . 'include/functions.inc.php');
 
 // check API parameters and connect to flickr
@@ -10,5 +12,5 @@
   $_GET['action'] = 'error';
 }
-else if ( !function_exists('curl_init') and !ini_get('allow_url_fopen') )
+else if ( !test_remote_download() )
 {
   array_push($page['errors'], l10n('No download method available'));
@@ -154,5 +156,5 @@
 ;';
     $existing_photos = simple_hash_from_query($query, 'id', 'file');
-    $existing_photos = array_map(create_function('$p', '$p=preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p); return $p;'), $existing_photos);
+    $existing_photos = array_map(create_function('$p', 'return preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p);'), $existing_photos);
     
     // remove existing photos
@@ -199,5 +201,4 @@
   FROM '.CATEGORIES_TABLE.'
 ;';
-    display_select_cat_wrapper($query, array(), 'associate_options');
     display_select_cat_wrapper($query, array(), 'category_parent_options');
     
@@ -223,16 +224,14 @@
     
     $all_photos = array();
-    foreach ($all_albums as &$album)
+    foreach ($all_albums as $album)
     {
       $album_photos = $flickr->photosets_getPhotos($album['id'], NULL, NULL, 500, NULL, 'photos');
       $album_photos = $album_photos['photoset']['photo'];
       
-      foreach ($album_photos as &$photo)
+      foreach ($album_photos as $photo)
       {
         $all_photos[ $photo['id'] ][] = $album['title'];
       }
-      unset($photo);
-    }
-    unset($album);
+    }
     
     // get existing photos
@@ -243,5 +242,5 @@
 ;';
     $existing_photos = simple_hash_from_query($query, 'id', 'file');
-    $existing_photos = array_map(create_function('$p', '$p=preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p); return $p;'), $existing_photos);
+    $existing_photos = array_map(create_function('$p', 'return preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p);'), $existing_photos);
     
     // remove existing photos
@@ -281,5 +280,4 @@
   FROM '.CATEGORIES_TABLE.'
 ;';
-    display_select_cat_wrapper($query, array(), 'associate_options', true);
     display_select_cat_wrapper($query, array(), 'category_parent_options');
     break;
Index: /extensions/flickr2piwigo/admin/template/import.list_all.tpl
===================================================================
--- /extensions/flickr2piwigo/admin/template/import.list_all.tpl	(revision 17475)
+++ /extensions/flickr2piwigo/admin/template/import.list_all.tpl	(revision 17476)
@@ -57,5 +57,5 @@
     $("#loader_import").fadeIn();
     
-    if ($("input[name='album_mode']").val() == 'identical') {
+    if ($("input[name='album_mode']:checked").val() == 'identical') {
       var album = 0;
     } else {
@@ -115,5 +115,5 @@
     <p id="albumSelectWrapper" style="display:none;">
       <select style="width:400px" name="associate" id="albumSelect" size="1">
-        {html_options options=$associate_options}
+        {html_options options=$category_parent_options}
       </select>
       {'... or '|@translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
Index: /extensions/flickr2piwigo/admin/template/import.list_photos.tpl
===================================================================
--- /extensions/flickr2piwigo/admin/template/import.list_photos.tpl	(revision 17475)
+++ /extensions/flickr2piwigo/admin/template/import.list_photos.tpl	(revision 17476)
@@ -405,5 +405,5 @@
       <label for="albumSelect"><b>{'Album'|@translate}:</b></label>
       <select style="width:400px" name="associate" id="albumSelect" size="1">
-        {html_options options=$associate_options}
+        {html_options options=$category_parent_options}
       </select>
       {'... or '|@translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
Index: /extensions/flickr2piwigo/admin/template/style.css
===================================================================
--- /extensions/flickr2piwigo/admin/template/style.css	(revision 17475)
+++ /extensions/flickr2piwigo/admin/template/style.css	(revision 17476)
@@ -6,2 +6,6 @@
   margin-top:20px;
 }
+UL.thumbnails span.wrap2 {
+  height: 128px;
+  width: 128px;
+}
Index: /extensions/flickr2piwigo/include/functions.inc.php
===================================================================
--- /extensions/flickr2piwigo/include/functions.inc.php	(revision 17475)
+++ /extensions/flickr2piwigo/include/functions.inc.php	(revision 17476)
@@ -1,4 +1,16 @@
 <?php
 if (!defined('FLICKR_PATH')) die('Hacking attempt!');
+
+/**
+ * test if a download method is available
+ * @return: bool
+ */
+if (!function_exists('test_remote_download'))
+{
+  function test_remote_download()
+  {
+    return function_exists('curl_init') || ini_get('allow_url_fopen');
+  }
+}
 
 /**
@@ -31,9 +43,10 @@
       
       curl_setopt($ch, CURLOPT_URL, $src);
-      curl_setopt($ch, CURLOPT_HEADER, 0);
+      curl_setopt($ch, CURLOPT_HEADER, false);
       curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-language: en"));
       curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
       curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
+      curl_setopt($ch, CURLOPT_TIMEOUT, 30);
       if (strpos($src, 'https://') !== false)
       {
@@ -50,12 +63,12 @@
       }
       
-      if (($out = curl_exec($ch)) === false)
+      $out = curl_exec($ch);
+      curl_close($ch);
+      
+      if ($out === false)
       {
         return 'file_error';
       }
-      
-      curl_close($ch);
-      
-      if (!$return)
+      else if (!$return)
       {
         fclose($newf);
Index: /extensions/flickr2piwigo/include/ws_functions.inc.php
===================================================================
--- /extensions/flickr2piwigo/include/ws_functions.inc.php	(revision 17475)
+++ /extensions/flickr2piwigo/include/ws_functions.inc.php	(revision 17476)
@@ -10,9 +10,9 @@
     'ws_images_addFlickr',
     array(
-      'category' => array('default' => null),   
-      'id' => array('default' => null),
+      'id' => array(),
+      'category' => array(),
       'fills' => array('default' =>null),
       ),
-    'Used by Flickr2Piwigo, fills € (fill_name,fill_posted,fill_taken,fill_author,fill_tags)'
+    'Used by Flickr2Piwigo'
     );
 }
@@ -30,5 +30,5 @@
   if ( empty($conf['flickr2piwigo']['api_key']) or empty($conf['flickr2piwigo']['secret_key']) )
   {
-    return new PwgError(500, l10n('Please fill your API keys on the configuration tab'));
+    return new PwgError(null, l10n('Please fill your API keys on the configuration tab'));
   }
   
@@ -36,4 +36,9 @@
   include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
   include_once(FLICKR_PATH . 'include/functions.inc.php');
+  
+  if (test_remote_download() === false)
+  {
+    return new PwgError(null, l10n('No download method available'));
+  }
   
   // init flickr API
@@ -58,5 +63,5 @@
   if (download_remote_file($photo['url'], $photo['path']) == false)
   {
-    return new PwgError(500, l10n('No download method available'));
+    return new PwgError(null, l10n('Can\'t download file'));
   }
   
@@ -125,5 +130,5 @@
   }
   
-  return sprintf(l10n('%s imported'), $photo['title']);
+  return sprintf(l10n('Photo "%s" imported'), $photo['title']);
 }
 
Index: /extensions/flickr2piwigo/language/en_UK/description.txt
===================================================================
--- /extensions/flickr2piwigo/language/en_UK/description.txt	(revision 17475)
+++ /extensions/flickr2piwigo/language/en_UK/description.txt	(revision 17476)
@@ -1,1 +1,1 @@
-Extension for importing pictures from your Flickr account
+Import pictures from your Flickr account
Index: /extensions/flickr2piwigo/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/flickr2piwigo/language/en_UK/plugin.lang.php	(revision 17475)
+++ /extensions/flickr2piwigo/language/en_UK/plugin.lang.php	(revision 17476)
@@ -9,5 +9,5 @@
 $lang['Import'] = 'Import';
 $lang['API not authenticated'] = 'API not authenticated';
-$lang['%s imported'] = '%s imported';
+$lang['Photo "%s" imported'] = 'Photo "%s" imported';
 $lang['Flickr logins'] = 'Flickr logins';
 $lang['API key'] = 'API key';
@@ -29,4 +29,5 @@
 $lang['No download method available'] = 'No download method available';
 $lang['Logued as'] = 'Logued as';
+$lang['Logued out'] = 'Logued out';
 $lang['%d elements ready for importation'] = '%d elements ready for importation';
 
Index: /extensions/flickr2piwigo/language/fr_FR/description.txt
===================================================================
--- /extensions/flickr2piwigo/language/fr_FR/description.txt	(revision 17475)
+++ /extensions/flickr2piwigo/language/fr_FR/description.txt	(revision 17476)
@@ -1,1 +1,1 @@
-Extension permettant d'importer des photos depuis votre compte Flickr.
+Importez des photos depuis votre compte Flickr.
Index: /extensions/flickr2piwigo/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/flickr2piwigo/language/fr_FR/plugin.lang.php	(revision 17475)
+++ /extensions/flickr2piwigo/language/fr_FR/plugin.lang.php	(revision 17476)
@@ -9,5 +9,5 @@
 $lang['Import'] = 'Importation';
 $lang['API not authenticated'] = 'API non authentifiée';
-$lang['%s imported'] = '%s importé';
+$lang['Photo "%s" imported'] = 'Photo "%s" importée';
 $lang['Flickr logins'] = 'Identifiants Flickr';
 $lang['API key'] = 'Clé API';
@@ -29,4 +29,5 @@
 $lang['No download method available'] = 'Aucune méthode de téléchargement n\'est disponible';
 $lang['Logued as'] = 'Indentifié en tant que';
+$lang['Logued out'] = 'Déconnecté';
 $lang['%d elements ready for importation'] = '%d elements prêts à l\'importation';
 
Index: /extensions/flickr2piwigo/main.inc.php
===================================================================
--- /extensions/flickr2piwigo/main.inc.php	(revision 17475)
+++ /extensions/flickr2piwigo/main.inc.php	(revision 17476)
@@ -3,5 +3,5 @@
 Plugin Name: Flickr2Piwigo
 Version: auto
-Description: Extension for importing pictures from your Flickr account
+Description: Import pictures from your Flickr account
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=612
 Author: Mistic
Index: /extensions/flickr2piwigo/maintain.inc.php
===================================================================
--- /extensions/flickr2piwigo/maintain.inc.php	(revision 17475)
+++ /extensions/flickr2piwigo/maintain.inc.php	(revision 17476)
@@ -37,4 +37,6 @@
 function plugin_uninstall() 
 {
+  global $conf;
+  
   pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "flickr2piwigo" LIMIT 1;');
   
