Index: /extensions/DownloadFromThumbnail/dst.tpl
===================================================================
--- /extensions/DownloadFromThumbnail/dst.tpl	(revision 31409)
+++ /extensions/DownloadFromThumbnail/dst.tpl	(revision 31410)
@@ -3,5 +3,5 @@
 jQuery('.dowpica').click(function(){
     var id= $(this).data('id');
-    jQuery.post("plugins/DownloadSinceThumbnail/save_history.php", {
+    jQuery.post("plugins/DownloadFromThumbnail/save_history.php", {
         dsp_his: id,
     });
Index: /extensions/DownloadFromThumbnail/index.php
===================================================================
--- /extensions/DownloadFromThumbnail/index.php	(revision 31409)
+++ /extensions/DownloadFromThumbnail/index.php	(revision 31410)
@@ -1,3 +1,23 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | Download From Thumbnail plugin for piwigo                             |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/DownloadFromThumbnail/language/en_UK/description.txt
===================================================================
--- /extensions/DownloadFromThumbnail/language/en_UK/description.txt	(revision 31409)
+++ /extensions/DownloadFromThumbnail/language/en_UK/description.txt	(revision 31410)
@@ -1,1 +1,1 @@
-Download since album page (thumbnail)
+Download photo from album page (link on thumbnail)
Index: /extensions/DownloadFromThumbnail/language/en_UK/index.php
===================================================================
--- /extensions/DownloadFromThumbnail/language/en_UK/index.php	(revision 31409)
+++ /extensions/DownloadFromThumbnail/language/en_UK/index.php	(revision 31410)
@@ -1,7 +1,7 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Plugin Piwigo -                                     |
+// | Download From Thumbnail plugin for piwigo                             |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2015 SAS TEMMII                  http://temmii.org |
+// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
Index: /extensions/DownloadFromThumbnail/main.inc.php
===================================================================
--- /extensions/DownloadFromThumbnail/main.inc.php	(revision 31409)
+++ /extensions/DownloadFromThumbnail/main.inc.php	(revision 31410)
@@ -6,6 +6,25 @@
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
 Author: ddtddt
-Author URI: http://temmii.com/
+Author URI: http://temmii.com/piwigo/
 */
+// +-----------------------------------------------------------------------+
+// | Download From Thumbnail plugin for piwigo                             |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
 
 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
@@ -47,6 +66,4 @@
   }
 
- // $image_ids = array_map(create_function('$i', 'return $i["id"];'), $pictures);
-
   $query = '
   SELECT enabled_high
Index: /extensions/DownloadFromThumbnail/maintain.class.php
===================================================================
--- /extensions/DownloadFromThumbnail/maintain.class.php	(revision 31409)
+++ /extensions/DownloadFromThumbnail/maintain.class.php	(revision 31410)
@@ -1,3 +1,23 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | Download From Thumbnail plugin for piwigo                             |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
 
@@ -14,7 +34,10 @@
 
   function activate($plugin_version, &$errors=array()){
-	$image_type = implode(",", get_enums(HISTORY_TABLE, 'image_type')).",dft_download";
-   	$query = "ALTER TABLE ". HISTORY_TABLE ." CHANGE `image_type` `image_type` ENUM( '".$image_type."' ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
-	$result = pwg_query($query);
+	if(!in_array("dft_download", get_enums(HISTORY_TABLE, 'image_type')))
+	  {
+	  $image_type = "'".implode("','", get_enums(HISTORY_TABLE, 'image_type'))."','dft_download'";
+   	  $query = "ALTER TABLE ". HISTORY_TABLE ." CHANGE `image_type` `image_type` ENUM( ".$image_type." ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
+	  $result = pwg_query($query);
+	  }
   }
 
Index: /extensions/DownloadFromThumbnail/save_history.php
===================================================================
--- /extensions/DownloadFromThumbnail/save_history.php	(revision 31409)
+++ /extensions/DownloadFromThumbnail/save_history.php	(revision 31410)
@@ -1,4 +1,22 @@
 <?php
-
+// +-----------------------------------------------------------------------+
+// | Download From Thumbnail plugin for piwigo                             |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
 
 define('PHPWG_ROOT_PATH','../../');
@@ -14,65 +32,2 @@
 
 pwg_log($_POST['dsp_his'], 'dft_download');
-/*
-
-$query = 'UPDATE '.IMAGES_TABLE.' SET hit=hit+1 WHERE id = '.$_POST['dsp_his'].';';
-pwg_query($query);
-
-$do_log = $conf['log'];
-if (is_admin())
-{
-  $do_log = $conf['history_admin'];
-}
-if (is_a_guest())
-{
-  $do_log = $conf['history_guest'];
-}
-
-if (!$do_log)
-{
-  exit();
-}
-
-if (!empty($_POST['section']))
-{
-  $page['section'] = pwg_db_real_escape_string($_POST['section']);
-}
-if (!empty($_POST['catid']))
-{
-  $page['category']['id'] = pwg_db_real_escape_string($_POST['catid']);
-}
-if ('tags'==@$page['section'] and !empty($_POST['tagids']))
-{
-  $tags_string = pwg_db_real_escape_string($_POST['tagids']);
-}
-
-  $query = '
-INSERT INTO '.HISTORY_TABLE.'
-  (
-    date,
-    time,
-    user_id,
-    IP,
-    section,
-    category_id,
-    image_id,
-    image_type,
-    tag_ids,
-    lightbox
-  )
-  VALUES
-  (
-    CURDATE(),
-    CURTIME(),
-    '.$user['id'].',
-    \''.$_SERVER['REMOTE_ADDR'].'\',
-    '.(isset($page['section']) ? "'".$page['section']."'" : 'NULL').',
-    '.(isset($page['category']['id']) ? $page['category']['id'] : 'NULL').',
-    '.$image_id.',
-    "picture",
-    '.(isset($tags_string) ? "'".$tags_string."'" : 'NULL').',
-    "true"
-  )
-;';
-
-pwg_query($query);*/
