Index: /extensions/ThumbnailTooltip/include/class.inc.php
===================================================================
--- /extensions/ThumbnailTooltip/include/class.inc.php	(revision 27645)
+++ /extensions/ThumbnailTooltip/include/class.inc.php	(revision 27645)
@@ -0,0 +1,95 @@
+<?php
+
+class Thumbnail_Tooltip_IMG {
+  var $plugin_name, $plugin_path, $plugin_url;
+  var $my_config;
+
+  function Thumbnail_Tooltip_IMG ($plugin_name, $plugin_path, $plugin_url) {
+    $this->plugin_name = $plugin_name;
+    $this->plugin_path = $plugin_path;
+    $this->plugin_url = $plugin_url;
+    $this->initialize_event_handler($plugin_name, $plugin_path, $plugin_url);
+  }
+
+  function initialize_event_handler() {
+    add_event_handler('loc_end_index_thumbnails', array($this, 'thumbnail_tooltip_affich'), 50, 2);
+  }
+
+  function thumbnail_tooltip_affich($tpl_var) {
+    global $user;
+      
+	  $query = '
+		SELECT param, value, comment
+		FROM ' . CONFIG_TABLE . '
+		WHERE param="thumbnail_tooltip"
+		;';
+	  $row = pwg_db_fetch_assoc( pwg_query($query) );
+  
+      $params = unserialize($row['value']);
+
+      $values = array(
+		  'DISPLAY_NAME'         => $params['display_name'],
+		  'value1'           	 => $params['value1'],
+		  'value2'           	 => $params['value2'],
+		  'value3'          	 => $params['value3'],
+		  'value4'           	 => $params['value4'],
+		  'value5'           	 => $params['value5'],
+		  'value6'           	 => $params['value6'],
+		  'separator'         	 => $params['separator']
+      );
+	  
+    foreach($tpl_var as $cle=>$valeur) {
+      $query = "
+		SELECT name AS value1, hit AS value2, hit AS value3, comment AS value4, author AS value5, CONCAT('".l10n('Author').' : '."', author,'') AS value6, rating_score AS value7
+		FROM ".IMAGES_TABLE."
+		WHERE id = ".(int)$tpl_var[$cle]['id']."
+		;";
+	  $row = pwg_db_fetch_assoc( pwg_query($query) );
+
+      $details = array();
+      $details_param = array();
+	  
+      $details['tn_type1'] = $row['value1'];
+
+      if (!empty($row['value2']))
+      {
+		$details['tn_type2'] = $row['value2'].' '.strtolower(l10n('Visits'));
+      }
+	  if (!empty($row['value3']))
+      {
+		$details['tn_type3'] = '('.$row['value3'].' '.strtolower(l10n('Visits')).')';
+	    if (!empty($row['value7'])) { $type8 = ', '.strtolower(l10n('Rating score')).' '.$row['value7']; } else { $type8 = ''; }
+		$details['tn_type8'] = '('.$row['value3'].' '.strtolower(l10n('Visits')).$type8.')';
+	  }
+      if (!empty($row['value4']))
+      {
+		$details['tn_type4'] = $row['value4'];
+      }
+      if (!empty($row['value5']))
+      {
+		$details['tn_type5'] = $row['value5'];
+      }
+      if (!empty($row['value6']))
+      {
+		$details['tn_type6'] = $row['value6'];
+      }
+      if (!empty($row['value7']))
+      {
+		$details['tn_type7'] = strtolower(l10n('Rating score')).' '.$row['value7'];
+      }
+	  	  
+	  if ((!empty($details[$values['value1']])) && ($details[$values['value1']]!='none')) { $details_param[] = $details[$values['value1']]; }
+	  if ((!empty($details[$values['value2']])) && ($details[$values['value2']]!='none')) { $details_param[] = $details[$values['value2']]; }
+	  if ((!empty($details[$values['value3']])) && ($details[$values['value3']]!='none')) { $details_param[] = $details[$values['value3']]; }
+	  if ((!empty($details[$values['value4']])) && ($details[$values['value4']]!='none')) { $details_param[] = $details[$values['value4']]; }
+	  if ((!empty($details[$values['value5']])) && ($details[$values['value5']]!='none')) { $details_param[] = $details[$values['value5']]; }
+	  if ((!empty($details[$values['value6']])) && ($details[$values['value6']]!='none')) { $details_param[] = $details[$values['value6']]; }
+	  
+	  if ($params['separator']=='1') { $title = implode(' - ', $details_param); } else { $title = implode(' ', $details_param); }
+	  
+	  if ($params['display_name']==true) { $tpl_var[$cle]['TN_TITLE'] = $title; } else { $tpl_var[$cle]['TN_TITLE']=''; }
+    }
+    return $tpl_var;
+  }
+}
+?>
Index: /extensions/ThumbnailTooltip/include/index.php
===================================================================
--- /extensions/ThumbnailTooltip/include/index.php	(revision 27645)
+++ /extensions/ThumbnailTooltip/include/index.php	(revision 27645)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
