Index: /extensions/piwishack/include/class.inc.php
===================================================================
--- /extensions/piwishack/include/class.inc.php	(revision 16638)
+++ /extensions/piwishack/include/class.inc.php	(revision 16639)
@@ -85,4 +85,5 @@
     if (empty($list) and !empty($page['items']))
     {
+	  $rank_of = array_flip($page['items']);
       $query = '
 	  SELECT *
@@ -95,5 +96,5 @@
       while ($row = mysql_fetch_assoc($result))
       {
-        $row['rank'] = $page['rank_of'][ $row['id'] ];
+        $row['rank'] = $rank_of[ $row['id'] ];
         array_push($list, $row);
       }
@@ -119,5 +120,5 @@
               'image_file' => $row['file'],
               )).'\" target=_blank><img src=\"'.
-		  str_replace('/./', '/', get_thumbnail_url($row)).'\" /></a>';
+		  str_replace('/./', '/', DerivativeImage::thumb_url($row)).'\" /></a>';
 	    $S .= '\n\n';
       }
@@ -163,4 +164,5 @@
     if (empty($list) and !empty($page['items']))
     {
+	  $rank_of = array_flip($page['items']);
       $query = '
 	  SELECT *
@@ -173,5 +175,5 @@
       while ($row = mysql_fetch_assoc($result))
       {
-        $row['rank'] = $page['rank_of'][ $row['id'] ];
+        $row['rank'] = $rank_of[ $row['id'] ];
         array_push($list, $row);
       }
@@ -197,5 +199,5 @@
               'image_file' => $row['file'],
               )).'][img]'.
-		  str_replace('/./', '/', get_thumbnail_url($row)).'[/img][/url]';
+		  str_replace('/./', '/', DerivativeImage::thumb_url($row)).'[/img][/url]';
 	    $S .= '\n\n';
       }
@@ -241,4 +243,5 @@
     if (empty($list) and !empty($page['items']))
     {
+	  $rank_of = array_flip($page['items']);
       $query = '
 	  SELECT *
@@ -251,5 +254,5 @@
       while ($row = mysql_fetch_assoc($result))
       {
-        $row['rank'] = $page['rank_of'][ $row['id'] ];
+        $row['rank'] = $rank_of[ $row['id'] ];
         array_push($list, $row);
       }
@@ -269,8 +272,9 @@
 	   <a href="{$ROOT_WAY}{$current.U_IMG}" target=_blank><img src="{$ROOT_WAY}{$SRC_IMG|@replace:'./':''}" /></a>
 	   */
-	   if (strpos(  get_image_url($row), get_absolute_root_url()  )  === false) {
-		 $abs_root_img= get_absolute_root_url(). str_replace('./', '', get_image_url($row)) ;
+	   $src_image = new SrcImage($row);
+	   if (strpos(  $image_url = DerivativeImage::url(IMG_MEDIUM, $src_image), get_absolute_root_url()  )  === false) {
+		 $abs_root_img= get_absolute_root_url(). str_replace('./', '', $image_url = DerivativeImage::url(IMG_MEDIUM, $src_image)) ;
 	   } else {
-	   $abs_root_img=  get_image_url($row) ;
+	   $abs_root_img= DerivativeImage::url(IMG_MEDIUM, $src_image) ;
 	   }       
 	    $S .= '<a href=\"'.
@@ -323,4 +327,5 @@
     if (empty($list) and !empty($page['items']))
     {
+	  $rank_of = array_flip($page['items']);
       $query = '
 	  SELECT *
@@ -333,5 +338,5 @@
       while ($row = mysql_fetch_assoc($result))
       {
-        $row['rank'] = $page['rank_of'][ $row['id'] ];
+        $row['rank'] = $rank_of[ $row['id'] ];
         array_push($list, $row);
       }
@@ -351,8 +356,9 @@
 	   [url={$ROOT_WAY}{$current.U_IMG}][img]{$ROOT_WAY}{$SRC_IMG|@replace:'./':''}[/img][/url]
 	   */
-	   if (strpos(  get_image_url($row), get_absolute_root_url()  )  === false) {
-		 $abs_root_img= get_absolute_root_url(). str_replace('./', '', get_image_url($row)) ;
+	   $src_image = new SrcImage($row);
+	   if (strpos(  $image_url = DerivativeImage::url(IMG_MEDIUM, $src_image), get_absolute_root_url()  )  === false) {
+		 $abs_root_img= get_absolute_root_url(). str_replace('./', '', $image_url = DerivativeImage::url(IMG_MEDIUM, $src_image)) ;
 	   } else {
-       $abs_root_img=  get_image_url($row) ;
+       $abs_root_img= DerivativeImage::url(IMG_MEDIUM, $src_image) ;
 	   }
 	    $S .= '[url='.
@@ -405,4 +411,5 @@
     if (empty($list) and !empty($page['items']))
     {
+	  $rank_of = array_flip($page['items']);
       $query = '
 	  SELECT *
@@ -415,5 +422,5 @@
       while ($row = mysql_fetch_assoc($result))
       {
-        $row['rank'] = $page['rank_of'][ $row['id'] ];
+        $row['rank'] = $rank_of[ $row['id'] ];
         array_push($list, $row);
       }
@@ -427,6 +434,4 @@
 	  
 	  $page_name = script_basename();
-	  if ( $page_name == 'picture') 
-	  {
         foreach ($list as $row)
         {
@@ -436,6 +441,6 @@
 	     {$ROOT_WAY}{$SRC_IMG|@replace:'./':''}
 	     */
-	      $S .= get_absolute_root_url().
-		    str_replace('./', '', get_image_url($row));
+		  $src_image = new SrcImage($row);
+	      $S .= $image_url = DerivativeImage::url(IMG_MEDIUM, $src_image);
 		  $S .= '\n\n';
         }
@@ -443,21 +448,4 @@
       unset_make_full_url();
       }
-	else
-	  {
-        foreach ($list as $row)
-        {
-	     /*
-	     Affichage du chemin en clair du lien vers la vue normale.
-	     EXEMPLE
-	     {$ROOT_WAY}{$SRC_IMG|@replace:'./':''}
-	     */
-	      $S .= get_image_url($row);
-		  $S .= '\n\n';
-        }
-	  }
-
-      unset_make_full_url();
-	}
-
 
     return $S;
@@ -498,4 +486,5 @@
     if (empty($list) and !empty($page['items']))
     {
+	  $rank_of = array_flip($page['items']);
       $query = '
 	  SELECT *
@@ -508,5 +497,5 @@
       while ($row = mysql_fetch_assoc($result))
       {
-        $row['rank'] = $page['rank_of'][ $row['id'] ];
+        $row['rank'] = $rank_of[ $row['id'] ];
         array_push($list, $row);
       }
@@ -527,4 +516,5 @@
 	   */
 	   
+	    $src_image = new SrcImage($row);
 		$S .= '<h6 style=\"text-align: center;\"><a href=\"'. // Arguments à transmettre
           duplicate_picture_url( // Lien Piwigo vers la page de la vue normale
@@ -534,5 +524,5 @@
               )).
 		  '\" target=\"_blank\"><img class=\"aligncenter\" style=\"width: 100%; height: 100%;\" src=\"'. // Arguments à transmettre
-		  get_absolute_root_url().str_replace('./', '', get_image_url($row)). // Liens direct vers la vue normale
+		  get_absolute_root_url().str_replace('./', '', $image_url = DerivativeImage::url(IMG_MEDIUM, $src_image)). // Liens direct vers la vue normale
 		  '\" alt=\"'. // Arguments à transmettre
 		  $row['file']. // Noms du fichier
@@ -583,4 +573,5 @@
     if (empty($list) and !empty($page['items']))
     {
+	  $rank_of = array_flip($page['items']);
       $query = '
 	  SELECT *
@@ -593,5 +584,5 @@
       while ($row = mysql_fetch_assoc($result))
       {
-        $row['rank'] = $page['rank_of'][ $row['id'] ];
+        $row['rank'] = $rank_of[ $row['id'] ];
         array_push($list, $row);
       }
@@ -610,5 +601,5 @@
         $S  .= '*** '.(!empty($row['name']) ? $row['name'] : $row['file']).' ***\n';
         $S  .= '[(('.
-          str_replace('/./', '/', get_thumbnail_url($row)).'))|'.
+          str_replace('/./', '/', DerivativeImage::thumb_url($row)).'))|'.
           duplicate_picture_url(
             array(
