Index: /branches/2.1/picture.php
===================================================================
--- /branches/2.1/picture.php	(revision 6613)
+++ /branches/2.1/picture.php	(revision 6614)
@@ -313,5 +313,5 @@
     {
       check_pwg_token();
-  
+
       include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php');
 
@@ -319,5 +319,5 @@
 
       $author_id = get_comment_author_id($_GET['comment_to_edit']);
-      
+
       if (can_manage_comment('edit', $author_id))
       {
@@ -332,5 +332,5 @@
             $_POST['key']
             );
-          
+
           redirect($url_self);
         }
@@ -345,16 +345,16 @@
     {
       check_pwg_token();
-  
+
       include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php');
-      
+
       check_input_parameter('comment_to_delete', $_GET, false, PATTERN_ID);
 
       $author_id = get_comment_author_id($_GET['comment_to_delete']);
-      
+
       if (can_manage_comment('delete', $author_id))
       {
         delete_user_comment($_GET['comment_to_delete']);
       }
-      
+
       redirect($url_self);
     }
@@ -362,16 +362,16 @@
     {
       check_pwg_token();
-  
+
       include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php');
 
       check_input_parameter('comment_to_validate', $_GET, false, PATTERN_ID);
-      
+
       $author_id = get_comment_author_id($_GET['comment_to_validate']);
-      
+
       if (can_manage_comment('validate', $author_id))
       {
         validate_user_comment($_GET['comment_to_validate']);
       }
-      
+
       redirect($url_self);
     }
@@ -797,37 +797,20 @@
     AND user_id = '.$user['id'].'
 ;';
-  $result = pwg_query($query);
-  $row = pwg_db_fetch_assoc($result);
-
-  if ($row['nb_fav'] == 0)
-  {
-    $template->assign(
-      'favorite',
-      array(
-        'FAVORITE_IMG'  =>
-          get_root_url().get_themeconf('icon_dir').'/favorite.png',
-        'FAVORITE_HINT' => l10n('add this image to your favorites'),
-        'U_FAVORITE'    => add_url_params(
-          $url_self,
-          array('action'=>'add_to_favorites')
-          ),
-        )
-      );
-  }
-  else
-  {
-    $template->assign(
-      'favorite',
-      array(
-        'FAVORITE_IMG'  =>
-          get_root_url().get_themeconf('icon_dir').'/del_favorite.png',
-        'FAVORITE_HINT' => l10n('delete this image from your favorites'),
-        'U_FAVORITE'    => add_url_params(
-          $url_self,
-          array('action'=>'remove_from_favorites')
-          ),
-        )
-      );
-  }
+  $row = pwg_db_fetch_assoc( pwg_query($query) );
+	$is_favorite = $row['nb_fav'] != 0;
+
+  $template->assign(
+    'favorite',
+    array(
+			'IS_FAVORITE' => $is_favorite,
+      'FAVORITE_IMG'  =>
+        get_root_url().get_themeconf('icon_dir').(!$is_favorite ? '/favorite.png' : '/del_favorite.png' ),
+      'FAVORITE_HINT' => l10n( !$is_favorite ? 'add this image to your favorites' : 'delete this image from your favorites'),
+      'U_FAVORITE'    => add_url_params(
+        $url_self,
+        array('action'=> !$is_favorite ? 'add_to_favorites' : 'remove_from_favorites' )
+        ),
+      )
+    );
 }
 
Index: /branches/2.1/themes/default/template/index.tpl
===================================================================
--- /branches/2.1/themes/default/template/index.tpl	(revision 6613)
+++ /branches/2.1/themes/default/template/index.tpl	(revision 6614)
@@ -16,5 +16,5 @@
 
       {if isset($favorite) }
-      <li><a href="{$favorite.U_FAVORITE}" title="{'delete all images from your favorites'|@translate}"><img src="{$favorite.FAVORITE_IMG}" class="button" alt="favorite" title="{'delete all images from your favorites'|@translate}"></a></li>
+      <li><a href="{$favorite.U_FAVORITE}" title="{'delete all images from your favorites'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/del_all_favorites.png" class="button" alt="favorite" title="{'delete all images from your favorites'|@translate}"></a></li>
       {/if}
 
Index: /branches/2.1/themes/default/template/picture.tpl
===================================================================
--- /branches/2.1/themes/default/template/picture.tpl	(revision 6613)
+++ /branches/2.1/themes/default/template/picture.tpl	(revision 6614)
@@ -51,5 +51,5 @@
     {if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
     {if isset($favorite) }
-      <a href="{$favorite.U_FAVORITE}" title="{$favorite.FAVORITE_HINT}"><img src="{$favorite.FAVORITE_IMG}" class="button" alt="favorite" title="{$favorite.FAVORITE_HINT}"></a>
+      <a href="{$favorite.U_FAVORITE}" title="{if $favorite.IS_FAVORITE}{'delete this image from your favorites'|@translate}{else}{'add this image to your favorites'|@translate}{/if}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/{if $favorite.IS_FAVORITE}del_favorite{else}favorite{/if}.png" class="button" alt="favorite" title="{if $favorite.IS_FAVORITE}{'delete this image from your favorites'|@translate}{else}{'add this image to your favorites'|@translate}{/if}"></a>
     {/if}
     {if !empty($U_SET_AS_REPRESENTATIVE) }
