Index: /extensions/see_photos_by_user/admin.php
===================================================================
--- /extensions/see_photos_by_user/admin.php	(revision 31459)
+++ /extensions/see_photos_by_user/admin.php	(revision 31460)
@@ -1,10 +1,25 @@
 <?php
-
+// +-----------------------------------------------------------------------+
+// | See photos by user plugin for piwigo                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2014 - 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.                                                                  |
+// +-----------------------------------------------------------------------+
 if (!defined('PHPWG_ROOT_PATH'))
     die('Hacking attempt!');
 global $template, $conf, $user;
-include_once(PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php');
-load_language('plugin.lang', SPBA_PATH);
-$my_base_url = get_admin_plugin_menu_link(__FILE__);
 
 // +-----------------------------------------------------------------------+
@@ -16,28 +31,28 @@
 
 $template->assign(
-        array(
-            'SPBU1' => $conf['see_photos_by_user_nbphotos'],
-            'SPBU2' => $conf['see_photos_by_user_limit'],
-            'SPBU3' => $conf['see_photos_by_user_order'],
-            'SPBU4' => $conf['see_photos_by_user_show'],
-            'SPBU5' => $conf['see_photos_by_user_color'],
-            'SPBU6' => $conf['see_photos_by_user_show_user_home'],
-            'SPBU7' => $conf['see_photos_by_user_shape'],
-            'SPBA_PATH2'=> get_root_url() . SPBA_PATH,
-        )
+  array(
+	'SPBU1' => $conf['see_photos_by_user_nbphotos'],
+	'SPBU2' => $conf['see_photos_by_user_limit'],
+	'SPBU3' => $conf['see_photos_by_user_order'],
+	'SPBU4' => $conf['see_photos_by_user_show'],
+	'SPBU5' => $conf['see_photos_by_user_color'],
+	'SPBU6' => $conf['see_photos_by_user_show_user_home'],
+	'SPBU7' => $conf['see_photos_by_user_shape'],
+	'SPBA_PATH2'=> get_root_url() . SPBA_PATH,
+  )
 );
 
 $SPBU3T = array(
-    l10n('users in alphabetical order'),
-    l10n('users by reverse alphabetical order'),
-    l10n('by increasing number of photos'),
-    l10n('by decreasing number of photos'),
+  l10n('users in alphabetical order'),
+  l10n('users by reverse alphabetical order'),
+  l10n('by increasing number of photos'),
+  l10n('by decreasing number of photos'),
 );
 
 $SPBU3 = array(
-    'username ASC',
-    'username DESC',
-    'PBU ASC',
-    'PBU DESC',
+  'username ASC',
+  'username DESC',
+  'PBU ASC',
+  'PBU DESC',
 );
 
@@ -46,12 +61,11 @@
 
 $PAPAB = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'Photo_add_by';"));
-if($PAPAB['state'] == 'active')
-{
-   $SPBU3T2 = array(
+if($PAPAB['state'] == 'active'){
+  $SPBU3T2 = array(
     l10n('nothing'),
     l10n('link Specials menu'),
     l10n('bloc menu users'),
-    );
-    $SPBU32 = array(
+  );
+  $SPBU32 = array(
     '-1',
     '1',
@@ -59,12 +73,12 @@
     ); 
 }else{
-    $SPBU3T2 = array(
+  $SPBU3T2 = array(
     l10n('link Specials menu'),
     l10n('bloc menu users'),
-    );
-    $SPBU32 = array(
-        '1',
-        '2',
-    );
+  );
+  $SPBU32 = array(
+	'1',
+	'2',
+  );
 }
 
@@ -73,15 +87,13 @@
 
 $SPBU4T2 = array(
-  //  l10n('nothing'),
-    l10n('users cloud'),
-    l10n('cumulus users cloud'),
-    l10n('select users box'),
+  l10n('users cloud'),
+  l10n('cumulus users cloud'),
+  l10n('select users box'),
 );
 
 $SPBU42 = array(
-  //  '-1',
-    '1',
-    '2',
-    '3'
+  '1',
+  '2',
+  '3'
 );
 
@@ -90,17 +102,17 @@
 
 $SPBU7 = array(
-    'sphere',
-    'vcylinder',
-    'hcylinder',
-    'vring',
-    'hring',
+  'sphere',
+  'vcylinder',
+  'hcylinder',
+  'vring',
+  'hring',
 );
 
 $SPBUT7 = array(
-    l10n('sphere'),
-    l10n('vertical cylinder'),
-    l10n('horizontal cylinder'),
-    l10n('vertical ring'),
-    l10n('horizontal ring'),
+  l10n('sphere'),
+  l10n('vertical cylinder'),
+  l10n('horizontal cylinder'),
+  l10n('vertical ring'),
+  l10n('horizontal ring'),
 );
 
@@ -109,34 +121,33 @@
 
 if (isset($_POST['submitspbu'])) {
-    if (is_numeric($_POST['insspbu1'])) {
-        conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']);
-    } else {
-        array_push($page['errors'], l10n('Maximal number users is incorrect !'));
-    }
-    if (is_numeric($_POST['insspbu2']))
-        conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']);
-    else {
-        array_push($page['errors'], l10n('Minimal number photos for show users is incorrect !'));
-    }
-    conf_update_param('see_photos_by_user_order', $_POST['insspbu3']);
-    conf_update_param('see_photos_by_user_show', $_POST['insspbu4']);
-    conf_update_param('see_photos_by_user_color', $_POST['insspbu5']);
-    conf_update_param('see_photos_by_user_show_user_home', $_POST['insspbu6']);
-    conf_update_param('see_photos_by_user_shape', $_POST['insspbu7']);
-    if (!$page['errors']) {
-        array_push($page['infos'], l10n('Update Complete'));
-    }
-
-    $template->assign(
-            array(
-                'SPBU1' => stripslashes($_POST['insspbu1']),
-                'SPBU2' => stripslashes($_POST['insspbu2']),
-                'SPBU3' => stripslashes($_POST['insspbu3']),
-                'SPBU4' => stripslashes($_POST['insspbu4']),
-                'SPBU5' => stripslashes($_POST['insspbu5']),
-                'SPBU6' => stripslashes($_POST['insspbu6']),
-                'SPBU7' => stripslashes($_POST['insspbu7']),
-            )
-    );
+  if (is_numeric($_POST['insspbu1'])) {
+    conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']);
+  } else {
+    array_push($page['errors'], l10n('Maximal number users is incorrect !'));
+  }
+  if (is_numeric($_POST['insspbu2']))
+    conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']);
+  else {
+    array_push($page['errors'], l10n('Minimal number photos for show users is incorrect !'));
+  }
+  conf_update_param('see_photos_by_user_order', $_POST['insspbu3']);
+  conf_update_param('see_photos_by_user_show', $_POST['insspbu4']);
+  conf_update_param('see_photos_by_user_color', $_POST['insspbu5']);
+  conf_update_param('see_photos_by_user_show_user_home', $_POST['insspbu6']);
+  conf_update_param('see_photos_by_user_shape', $_POST['insspbu7']);
+  if (!$page['errors']) {
+    array_push($page['infos'], l10n('Update Complete'));
+  }
+  $template->assign(
+	array(
+	  'SPBU1' => stripslashes($_POST['insspbu1']),
+	  'SPBU2' => stripslashes($_POST['insspbu2']),
+	  'SPBU3' => stripslashes($_POST['insspbu3']),
+	  'SPBU4' => stripslashes($_POST['insspbu4']),
+	  'SPBU5' => stripslashes($_POST['insspbu5']),
+	  'SPBU6' => stripslashes($_POST['insspbu6']),
+	  'SPBU7' => stripslashes($_POST['insspbu7']),
+	)
+  );
 }
 
Index: /extensions/see_photos_by_user/include/function.see.inc.php
===================================================================
--- /extensions/see_photos_by_user/include/function.see.inc.php	(revision 31459)
+++ /extensions/see_photos_by_user/include/function.see.inc.php	(revision 31460)
@@ -1,54 +1,60 @@
 <?php 
-
+// +-----------------------------------------------------------------------+
+// | See photos by user plugin for piwigo                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2014 - 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.                                                                  |
+// +-----------------------------------------------------------------------+
 function see_username($id_user){
-$query = '
-    SELECT id, username
-    FROM ' . USERS_TABLE . '
-    WHERE id = \'' . $id_user . '\'
-    ;';
-        $result = pwg_query($query);
-        $row = pwg_db_fetch_assoc($result);
-        $username = str_replace(' ','_',$row['username']);
-        $username = str_replace('.','_',$username);
-return $username;
+  $query = 'SELECT id, username FROM ' . USERS_TABLE . ' WHERE id = \'' . $id_user . '\';';
+  $result = pwg_query($query);
+  $row = pwg_db_fetch_assoc($result);
+  $username = str_replace(' ','_',$row['username']);
+  $username = str_replace('.','_',$username);
+  return $username;
 }
 
 function see_userlist_nb_photo(){
-    global $conf;
-            $query = '
-SELECT UT.id, UT.username, COUNT(DISTINCT(IT.id)) AS PBU
- FROM ' . USERS_TABLE . ' as UT
- INNER JOIN ' . IMAGES_TABLE . ' AS IT ON IT.added_by = UT.id
- INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic ON IT.id = ic.image_id
-  ' . get_sql_condition_FandF
-                        (
-                        array
-                    (
-                    'forbidden_categories' => 'category_id',
-                    'visible_categories' => 'category_id',
-                    'visible_images' => 'id'
-                        ), 'WHERE'
-                ) . '
- GROUP BY IT.added_by
- HAVING PBU >' . $conf['see_photos_by_user_nbphotos'] . '
- ORDER BY ' . $conf['see_photos_by_user_order'] . '
- LIMIT ' . $conf['see_photos_by_user_limit'] . ';';
+  global $conf;
+  $query = '
+	SELECT UT.id, UT.username, COUNT(DISTINCT(IT.id)) AS PBU
+	FROM ' . USERS_TABLE . ' as UT
+	INNER JOIN ' . IMAGES_TABLE . ' AS IT ON IT.added_by = UT.id
+	INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic ON IT.id = ic.image_id
+	' . get_sql_condition_FandF(
+      array(
+		'forbidden_categories' => 'category_id',
+		'visible_categories' => 'category_id',
+		'visible_images' => 'id'
+	  ), 'WHERE'
+    ) . '
+	GROUP BY IT.added_by
+	HAVING PBU >' . $conf['see_photos_by_user_nbphotos'] . '
+	ORDER BY ' . $conf['see_photos_by_user_order'] . '
+	LIMIT ' . $conf['see_photos_by_user_limit'] . ';';
 
-        $result = pwg_query($query);
-
-    return $result;
+  $result = pwg_query($query);
+  return $result;
 }
 
 function see_nb_photo(){
-$query = '
- SELECT COUNT(DISTINCT(id)) AS PBU
- FROM ' . IMAGES_TABLE . ';';
-
-$result = pwg_query($query);
-$row = pwg_db_fetch_assoc($result);
-
-    return $row['PBU'];
+  $query = 'SELECT COUNT(DISTINCT(id)) AS PBU FROM ' . IMAGES_TABLE . ';';
+  $result = pwg_query($query);
+  $row = pwg_db_fetch_assoc($result);
+  return $row['PBU'];
 }
 
-
 ?>
Index: /extensions/see_photos_by_user/index.php
===================================================================
--- /extensions/see_photos_by_user/index.php	(revision 31459)
+++ /extensions/see_photos_by_user/index.php	(revision 31460)
@@ -1,25 +1,3 @@
 <?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2014 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 = '../';
Index: /extensions/see_photos_by_user/language/en_UK/index.php
===================================================================
--- /extensions/see_photos_by_user/language/en_UK/index.php	(revision 31459)
+++ /extensions/see_photos_by_user/language/en_UK/index.php	(revision 31460)
@@ -1,25 +1,3 @@
 <?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2014 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 = '../';
Index: /extensions/see_photos_by_user/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/see_photos_by_user/language/en_UK/plugin.lang.php	(revision 31459)
+++ /extensions/see_photos_by_user/language/en_UK/plugin.lang.php	(revision 31460)
@@ -1,3 +1,22 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | See photos by user plugin for piwigo                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2014 - 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.                                                                  |
+// +-----------------------------------------------------------------------+
 $lang['See photos by user'] = 'See photos by user';
 $lang['select user'] = 'select user';
Index: /extensions/see_photos_by_user/language/fr_FR/index.php
===================================================================
--- /extensions/see_photos_by_user/language/fr_FR/index.php	(revision 31459)
+++ /extensions/see_photos_by_user/language/fr_FR/index.php	(revision 31460)
@@ -1,25 +1,3 @@
 <?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2014 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 = '../';
Index: /extensions/see_photos_by_user/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/see_photos_by_user/language/fr_FR/plugin.lang.php	(revision 31459)
+++ /extensions/see_photos_by_user/language/fr_FR/plugin.lang.php	(revision 31460)
@@ -1,3 +1,22 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | See photos by user plugin for piwigo                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2014 - 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.                                                                  |
+// +-----------------------------------------------------------------------+
 $lang['See photos by user'] = 'Voir les photos par utilisateur';
 $lang['select user'] = 'selectionner un utilisateur';
Index: /extensions/see_photos_by_user/language/index.php
===================================================================
--- /extensions/see_photos_by_user/language/index.php	(revision 31459)
+++ /extensions/see_photos_by_user/language/index.php	(revision 31460)
@@ -1,25 +1,3 @@
 <?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2014 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 = '../';
Index: /extensions/see_photos_by_user/main.inc.php
===================================================================
--- /extensions/see_photos_by_user/main.inc.php	(revision 31459)
+++ /extensions/see_photos_by_user/main.inc.php	(revision 31460)
@@ -1,4 +1,3 @@
 <?php
-
 /*
   Plugin Name: See photos by user
@@ -7,6 +6,25 @@
   Plugin URI: http://piwigo.org/ext/extension_view.php?eid=723
   Author: ddtddt
-  Author URI:
- */
+Author URI: http://temmii.com/piwigo/
+*/
+// +-----------------------------------------------------------------------+
+// | See photos by user plugin for piwigo                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2014 - 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.                                                                  |
+// +-----------------------------------------------------------------------+
 
 if (!defined('PHPWG_ROOT_PATH'))
@@ -16,17 +34,20 @@
 define('SPBA_PATH', PHPWG_PLUGINS_PATH . SPBA_DIR . '/');
 define('SPBA_ADMIN',get_root_url().'admin.php?page=plugin-'.SPBA_DIR);
-load_language('plugin.lang', SPBA_PATH);
 
 include_once(SPBA_PATH . 'include/function.see.inc.php');
+
+add_event_handler('loading_lang', 'see_photos_by_user_loading_lang');	  
+function see_photos_by_user_loading_lang(){
+  load_language('plugin.lang', SPBA_PATH);
+  load_language('lang', PHPWG_ROOT_PATH . 'local/', array('no_fallback' => true, 'local' => true));
+}
+
+
 global $conf;
 
 /*init plugin - filter http*/
 add_event_handler('loc_end_section_init', 'section_init_SPBA');
-function section_init_SPBA() {
-    /*init plugin lang*/
-    load_language('plugin.lang', SPBA_PATH);
-    load_language('lang', PHPWG_ROOT_PATH . 'local/', array('no_fallback' => true, 'local' => true));
-    
-    global $tokens, $conf, $template;
+function section_init_SPBA(){
+  global $tokens, $conf, $template;
   if(strpbrk('user-', $_SERVER['REQUEST_URI'])!=false){
     $testa = explode('user-', $_SERVER['REQUEST_URI']);
@@ -58,13 +79,7 @@
     }
   }
-  
-  //$template->assign('SPBA2', 'toto');
   $template->set_filename('SPBA', realpath(SPBA_PATH . 'pagespba.tpl'));
   $template->assign_var_from_handle('CONTENT', 'SPBA'); //2.6
-  
 }
-
-
-
 
 /*Schow link in menu*/
@@ -73,9 +88,8 @@
 }
 
-function add_link_SPBA($menu_ref_arr) {
+function add_link_SPBA($menu_ref_arr){
     global $conf, $user;
     $menu = & $menu_ref_arr[0];
     if (($block = $menu->get_block('mbSpecials')) != null) {
-        load_language('plugin.lang', SPBA_PATH);
         $position = (isset($conf['SPBA_position']) and is_numeric($conf['SPBA_position'])) ? $conf['SPBA_position'] : count($block->data) + 1;
         array_splice
@@ -92,5 +106,4 @@
     }
 }
-
 
 /*schow users menu*/
@@ -137,19 +150,9 @@
 
 function SPBA_admin_menu($menu) {
-    /*load_language('plugin.lang', SPBA_PATH);
-    array_push(
-            $menu, array(
-        'NAME' => l10n('Photos by user'),
-        'URL' => get_admin_plugin_menu_link(SPBA_PATH . 'admin.php')
-            )
-    );*/
-    load_language('plugin.lang', SPBA_PATH);
-    $menu[] = array(
+  $menu[] = array(
     'NAME' => l10n('Photos by user'),
     'URL' => SPBA_ADMIN,
     );
-
-  
-    return $menu;
+  return $menu;
 }
 
Index: /extensions/see_photos_by_user/maintain.class.php
===================================================================
--- /extensions/see_photos_by_user/maintain.class.php	(revision 31459)
+++ /extensions/see_photos_by_user/maintain.class.php	(revision 31460)
@@ -1,3 +1,22 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | See photos by user plugin for piwigo                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2014 - 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!');
 
Index: /extensions/see_photos_by_user/pagespba.php
===================================================================
--- /extensions/see_photos_by_user/pagespba.php	(revision 31459)
+++ /extensions/see_photos_by_user/pagespba.php	(revision 31460)
@@ -1,52 +1,65 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | See photos by user plugin for piwigo                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2014 - 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
 global $page, $conf, $user, $template;
 
  /*test URL*/
-
 $testa = explode('user-', $_SERVER['REQUEST_URI']);
 if(!empty($testa[1])){
-    $testd = explode('-', $testa[1]);
-    if(is_numeric($testd[0])){
-        
-        $username= see_username($testd[0]);
-        
-        
-        $me = 'user-' . $testd[0].'-'.$username;
-        
-        $page['section'] = $me;
-        $page['section_title'] = '<a href="' . get_absolute_root_url() . '">' . l10n('Home') . '</a>' . $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/user-">' . l10n('Users').'</a>'. $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/' . $me . '">'.$username. '</a>';
-
-        $template->assign(
-          'gestionB', array(
-          'USERUSBU' => $username,
-        ));
-
-        $query = '
-        SELECT DISTINCT(id)
-         FROM ' . IMAGES_TABLE . '
-        INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic ON id = ic.image_id
-        ' . get_sql_condition_FandF
-                        (
-                        array
-                    (
-                    'forbidden_categories' => 'category_id',
-                    'visible_categories' => 'category_id',
-                    'visible_images' => 'id'
-                        ), 'WHERE'
-                ) . '
+  $testd = explode('-', $testa[1]);
+  if(is_numeric($testd[0])){
+    $username= see_username($testd[0]);
+    $me = 'user-' . $testd[0].'-'.$username;
+    $page['section'] = $me;
+    $page['section_title'] = '<a href="' . get_absolute_root_url() . '">' . l10n('Home') . '</a>' . $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/user-">' . l10n('Users').'</a>'. $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/' . $me . '">'.$username. '</a>';
+    $template->assign(
+      'gestionB', array(
+      'USERUSBU' => $username,
+    ));
+    $query = '
+      SELECT DISTINCT(id)
+      FROM ' . IMAGES_TABLE . '
+      INNER JOIN ' . IMAGE_CATEGORY_TABLE . ' AS ic ON id = ic.image_id
+      ' . get_sql_condition_FandF
+        (
+          array
+        (
+          'forbidden_categories' => 'category_id',
+          'visible_categories' => 'category_id',
+          'visible_images' => 'id'
+        ), 'WHERE'
+        ) . '
         AND added_by = \'' . $testd[0] . '\'
         ' . $conf['order_by'] . '
         ;';
-        $page = array_merge
-                (
-                $page, array
-            (
+    $page = array_merge
+      (
+        $page, array
+           (
             'title' => '<a href="' . duplicate_index_url(array('start' => 0)) . '">' . $me . '</a>',
             'items' => array_from_query($query, 'id'),
-                )
-        );
-    }else{
-        show_users_home();
-    }
+            )
+      );
+  }else{
+    show_users_home();
+  }
 }else{
     show_users_home();
@@ -56,98 +69,81 @@
 
 function show_users_home(){
-    
-    /*users cloud*/
-// template vars
-    global $page, $conf, $user, $template;
-            
-     $me = 'user-';
-    $page['section'] = $me;
-    $page['section_title'] = '<a href="' . get_absolute_root_url() . '">' . l10n('Home') . '</a>' . $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/' . $me . '">' . l10n('Users') . '</a>';        
-    
-     $userslistecloud1 = see_userlist_nb_photo();
-     $level=see_nb_photo();
-     
-    if (pwg_db_num_rows($userslistecloud1)) {
-        while ($userslistecloud = pwg_db_fetch_assoc($userslistecloud1)) {
-            if($userslistecloud['PBU']>$level*4/5){$wheight=5;}
-            else if($userslistecloud['PBU']>$level*3/5){$wheight=4;}
-            else if($userslistecloud['PBU']>$level*2/5){$wheight=3;}
-            else if($userslistecloud['PBU']>$level*1/5){$wheight=2;}
-            else{$wheight=1;}
-            
-            $items = array(
-                'USERSSPBYLID' => $userslistecloud['id'],
-                'USERSSPBYL' => $userslistecloud['username'],
-                'USERSSPBYLC' => $userslistecloud['PBU'],
-                'USERSSPBYWEIGHT' => $wheight,
-            );
-
-            $template->append('userslistecloud1', $items);
-        }
+ /*users cloud*/
+ // template vars
+ global $page, $conf, $user, $template;
+ $me = 'user-';
+ $page['section'] = $me;
+ $page['section_title'] = '<a href="' . get_absolute_root_url() . '">' . l10n('Home') . '</a>' . $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/' . $me . '">' . l10n('Users') . '</a>';        
+ $userslistecloud1 = see_userlist_nb_photo();
+ $level=see_nb_photo();
+ if (pwg_db_num_rows($userslistecloud1)) {
+    while ($userslistecloud = pwg_db_fetch_assoc($userslistecloud1)) {
+      if($userslistecloud['PBU']>$level*4/5){$wheight=5;}
+      else if($userslistecloud['PBU']>$level*3/5){$wheight=4;}
+      else if($userslistecloud['PBU']>$level*2/5){$wheight=3;}
+      else if($userslistecloud['PBU']>$level*1/5){$wheight=2;}
+      else{$wheight=1;}
+		$items = array(
+			'USERSSPBYLID' => $userslistecloud['id'],
+			'USERSSPBYL' => $userslistecloud['username'],
+			'USERSSPBYLC' => $userslistecloud['PBU'],
+			'USERSSPBYWEIGHT' => $wheight,
+		);
+      $template->append('userslistecloud1', $items);
+      }
     }
     
-    
-    $linkusersliste = get_root_url() . 'index.php?/user-';
-    $template->assign(array(
-        'USERSSPBY'=> $linkusersliste,
-        'USERSSPBYCOLOR' => $conf['see_photos_by_user_color'],
-        'USERSSPBYSHAPE' => $conf['see_photos_by_user_shape'],
-            ));
-    
-    
-    if($conf['see_photos_by_user_show_user_home']==1){
-$template->assign(
-    'gestionD', array(
-    'SPBA_PATH'=> get_root_url() . SPBA_PATH,
+  $linkusersliste = get_root_url() . 'index.php?/user-';
+  $template->assign(array(
+	'USERSSPBY'=> $linkusersliste,
+	'USERSSPBYCOLOR' => $conf['see_photos_by_user_color'],
+	'USERSSPBYSHAPE' => $conf['see_photos_by_user_shape'],
   ));
-    }else if($conf['see_photos_by_user_show_user_home']==2){
-     $template->assign(
-   'gestionC', array(
-    'SPBA_PATH'=> get_root_url() . SPBA_PATH,
-  ));           
-        
-    }else if($conf['see_photos_by_user_show_user_home']==3){
-        $groups = array();
-        $result = see_userlist_nb_photo();
-        while ($row = pwg_db_fetch_assoc($result)) {
-            $groups[$row['id']] = $row['username'] . ' (' . $row['PBU'] . ')';
-        }
-        $selected = 0;
-            if (empty($testd[0])) {
-                $options['b'] = l10n('select user');
-            } else {
-                $options['b'] = l10n('select other user');
-            }
-        $options['a'] = '----------------------';
+   
+  if($conf['see_photos_by_user_show_user_home']==1){
+	$template->assign(
+      'gestionD', array(
+      'SPBA_PATH'=> get_root_url() . SPBA_PATH,
+	));
+  }else if($conf['see_photos_by_user_show_user_home']==2){
+    $template->assign(
+	  'gestionC', array(
+      'SPBA_PATH'=> get_root_url() . SPBA_PATH,
+	));           
+  }else if($conf['see_photos_by_user_show_user_home']==3){
+    $groups = array();
+    $result = see_userlist_nb_photo();
+    while ($row = pwg_db_fetch_assoc($result)) {
+      $groups[$row['id']] = $row['username'] . ' (' . $row['PBU'] . ')';
+    }
+    $selected = 0;
+	  if (empty($testd[0])) {
+		$options['b'] = l10n('select user');
+	  } else {
+		$options['b'] = l10n('select other user');
+	  }
+    $options['a'] = '----------------------';
 
-        foreach ($groups as $metalist => $metalist2) {
-            $options[$metalist] = $metalist2;
-        }
-        $template->assign(
-                'gestionA', array(
-            'OPTIONS' => $options,
-            'SELECTED' => $selected
-        ));
-        if (isset($_POST['submitchoixauteur'])) {
-            $redirect_url = get_root_url() . 'index.php?/user-';
-            if(is_numeric($_POST['metalist'])){
-             $query = '
-        SELECT id, username
-        FROM ' . USERS_TABLE . '
-        WHERE id = \'' . $_POST['metalist'] . '\'
-        ;';
-            $result = pwg_query($query);
-            $row = pwg_db_fetch_assoc($result);
-            $username = $row['username'];
-
-            $redirect_url .=($_POST['metalist']).'-'.$username;
-                 }
-            redirect($redirect_url);
-        } 
-    }else{}
-
-
+    foreach ($groups as $metalist => $metalist2) {
+      $options[$metalist] = $metalist2;
+    }
+    $template->assign(
+      'gestionA', array(
+      'OPTIONS' => $options,
+      'SELECTED' => $selected
+    ));
+	if (isset($_POST['submitchoixauteur'])) {
+	  $redirect_url = get_root_url() . 'index.php?/user-';
+	  if(is_numeric($_POST['metalist'])){
+		$query = 'SELECT id, username FROM ' . USERS_TABLE . ' WHERE id = \'' . $_POST['metalist'] . '\';';
+		$result = pwg_query($query);
+		$row = pwg_db_fetch_assoc($result);
+		$username = $row['username'];
+		$redirect_url .=($_POST['metalist']).'-'.$username;
+	  }
+	  redirect($redirect_url);
+    } 
+  }else{}
 }
 
-
 ?>
