Index: trunk/picture.php
===================================================================
--- trunk/picture.php	(revision 1086)
+++ trunk/picture.php	(revision 1090)
@@ -277,7 +277,4 @@
   $file_wo_ext = get_filename_wo_extension($row['file']);
 
-  $icon = get_themeconf('mime_icon_dir');
-  $icon.= strtolower(get_extension($row['file'])).'.png';
-
   if (isset($row['representative_ext']) and $row['representative_ext'] != '')
   {
@@ -288,4 +285,6 @@
   else
   {
+    $icon = get_themeconf('mime_icon_dir');
+    $icon.= strtolower(get_extension($row['file'])).'.png';
     $picture[$i]['src'] = $icon;
   }
@@ -301,7 +300,16 @@
       {
         $url_high=$cat_directory.'/pwg_high/'.$row['file'];
-        $picture[$i]['high'] = $url_high;
+        $picture[$i]['high_file_system'] = $picture[$i]['high'] = $url_high;
+        if ( ! url_is_remote($picture[$i]['high']) )
+        {
+          $picture[$i]['high'] = get_root_url().$picture[$i]['high'];
+        }
       }
     }
+  }
+  $picture[$i]['src_file_system'] = $picture[$i]['src'];
+  if ( ! url_is_remote($picture[$i]['src']) )
+  {
+    $picture[$i]['src'] = get_root_url(). $picture[$i]['src'];
   }
 
@@ -309,5 +317,6 @@
   if (!$picture[$i]['is_picture'])
   {
-    $picture[$i]['download'] = $row['path'];
+    $picture[$i]['download'] = url_is_remote($row['path']) ? '' : get_root_url();
+    $picture[$i]['download'].= $row['path'];
   }
 
@@ -326,4 +335,5 @@
     array(
       'image_id' => $row['id'],
+      'image_file' => $row['file'],
       ),
     array(
@@ -343,13 +353,12 @@
 
 $url_admin =
-  PHPWG_ROOT_PATH.'admin.php?page=picture_modify'
+  get_root_url().'admin.php?page=picture_modify'
   .'&amp;cat_id='.(isset($page['category']) ? $page['category'] : '')
   .'&amp;image_id='.$page['image_id']
 ;
 
-$url_slide =
-  $picture['current']['url']
-  .'&amp;slideshow='.$conf['slideshow_period']
-;
+$url_slide = add_url_param(
+  $picture['current']['url'],
+  'slideshow='.$conf['slideshow_period'] );
 
 $title =  $picture['current']['name'];
@@ -358,5 +367,5 @@
 {
   $refresh= $_GET['slideshow'];
-  $url_link = $picture['next']['url'].'&amp;slideshow='.$refresh;
+  $url_link = add_url_param($picture['next']['url'], 'slideshow='.$refresh);
 }
 
@@ -378,5 +387,5 @@
 if (empty($picture['current']['width']))
 {
-  $taille_image = @getimagesize($picture['current']['src']);
+  $taille_image = @getimagesize($picture['current']['src_file_system']);
   $original_width = $taille_image[0];
   $original_height = $taille_image[1];
@@ -511,6 +520,6 @@
     'download',
     array(
-      'U_DOWNLOAD' => PHPWG_ROOT_PATH.'action.php?dwn='
-      .$picture['current']['high']
+      'U_DOWNLOAD' => get_root_url().'action.php?dwn='
+      .$picture['current']['high_file_system']
       )
     );
@@ -523,5 +532,5 @@
     'representative',
     array(
-      'URL' => $url_self.'&amp;action=set_as_representative'
+      'URL' => add_url_param($url_self, 'action=set_as_representative')
       )
     );
@@ -534,5 +543,5 @@
     'caddie',
     array(
-      'URL' => $url_self.'&amp;action=add_to_caddie'
+      'URL' => add_url_param($url_self, 'action=add_to_caddie')
       )
     );
@@ -554,13 +563,11 @@
   if ($row['nb_fav'] == 0)
   {
-    $url = $url_self.'&amp;action=add_to_favorites';
-
     $template->assign_block_vars(
       'favorite',
       array(
-        'FAVORITE_IMG'  => get_themeconf('icon_dir').'/favorite.png',
+        'FAVORITE_IMG'  => get_root_url().get_themeconf('icon_dir').'/favorite.png',
         'FAVORITE_HINT' => $lang['add_favorites_hint'],
         'FAVORITE_ALT'  => $lang['add_favorites_alt'],
-        'U_FAVORITE'    => $url_self.'&amp;action=add_to_favorites',
+        'U_FAVORITE'    => add_url_param($url_self, 'action=add_to_favorites'),
         )
       );
@@ -571,8 +578,8 @@
       'favorite',
       array(
-        'FAVORITE_IMG'  => get_themeconf('icon_dir').'/del_favorite.png',
+        'FAVORITE_IMG'  => get_root_url().get_themeconf('icon_dir').'/del_favorite.png',
         'FAVORITE_HINT' => $lang['del_favorites_hint'],
         'FAVORITE_ALT'  => $lang['del_favorites_alt'],
-        'U_FAVORITE'    => $url_self.'&amp;action=remove_from_favorites',
+        'U_FAVORITE'    => add_url_param($url_self, 'action=remove_from_favorites'),
         )
       );
@@ -622,14 +629,11 @@
   $val = format_date($picture['current']['date_creation']);
   $url = make_index_URL(
-          array(
-            'chronology' =>
-              array(
-                'field'=>'created',
-                'style'=>'monthly',
-                'view'=>'list',
-              ),
-             'chronology_date' => explode('-', $picture['current']['date_creation'])
-           )
-         );
+        array(
+          'chronology_field'=>'created',
+          'chronology_style'=>'monthly',
+          'chronology_view'=>'list',
+          'chronology_date' => explode('-', $picture['current']['date_creation'])
+        )
+      );
   $infos['INFO_CREATION_DATE'] = '<a href="'.$url.'">'.$val.'</a>';
 }
@@ -642,14 +646,11 @@
 $val = format_date($picture['current']['date_available'], 'mysql_datetime');
 $url = make_index_URL(
-        array(
-          'chronology' =>
-            array(
-              'field'=>'posted',
-              'style'=>'monthly',
-              'view'=>'list',
-            ),
-           'chronology_date' => explode('-', substr($picture['current']['date_available'],0,10))
-         )
-       );
+      array(
+        'chronology_field'=>'posted',
+        'chronology_style'=>'monthly',
+        'chronology_view'=>'list',
+        'chronology_date'=>explode('-', substr($picture['current']['date_available'],0,10))
+      )
+    );
 $infos['INFO_POSTED_DATE'] = '<a href="'.$url.'">'.$val.'</a>';
 
