Index: /extensions/title/admin.php
===================================================================
--- /extensions/title/admin.php	(revision 32301)
+++ /extensions/title/admin.php	(revision 32302)
@@ -1,7 +1,7 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Title plugin for piwigo                                               |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
+// | Title plugin for piwigo by TEMMII                                     |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
@@ -21,5 +21,5 @@
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-global $template, $conf, $user;
+global $template, $conf, $user, $pwg_loaded_plugins;
 include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
 $my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugin-';
@@ -38,10 +38,8 @@
 $tabsheet = new tabsheet();
   $tabsheet->add('plugtitle', l10n('title_tab_plgtitle'), TITLE_ADMIN . '-plugtitle');
-  $PAC = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ContactForm';"));
-  if($PAC['state'] == 'active'){
+  if (isset($pwg_loaded_plugins['ContactForm'])){
 	$tabsheet->add('contacttitle', l10n('Contact Title'), TITLE_ADMIN . '-contacttitle');
   }
-  $PAAP = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'AdditionalPages';"));
-  if($PAAP['state'] == 'active'){
+  if (isset($pwg_loaded_plugins['AdditionalPages'])){
 	$tabsheet->add('AdditionalPagestitle', l10n('Additional Pages Title'), TITLE_ADMIN . '-AdditionalPagestitle');
   }			   
Index: /extensions/title/index.php
===================================================================
--- /extensions/title/index.php	(revision 32301)
+++ /extensions/title/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/initadmin.php
===================================================================
--- /extensions/title/initadmin.php	(revision 32301)
+++ /extensions/title/initadmin.php	(revision 32302)
@@ -1,5 +1,5 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Title plugin for piwigo                                               |
+// | Title plugin for piwigo by TEMMII                                     |
 // +-----------------------------------------------------------------------+
 // | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
@@ -38,14 +38,11 @@
 add_event_handler('loc_begin_admin_page', 'titlePadminA',60);
 
-function titlePadminf()
-	{
-	global $template;
-	$template->set_prefilter('picture_modify', 'titlePadminfT');
-	}
+function titlePadminf(){
+  global $template;
+  $template->set_prefilter('picture_modify', 'titlePadminfT');
+}
 
-function titlePadminfT($content, &$smarty)
-	{
+function titlePadminfT($content, &$smarty){
   $search = '#<p style="margin:40px 0 0 0">#';
-  
   $replacement = '
     <p>
@@ -58,15 +55,14 @@
 
   return preg_replace($search, $replacement, $content);
-	}
+}
  
 function titlePadminA(){
   if (isset($_GET['image_id'])){
-	global $template, $prefixeTable;
+	global $template, $prefixeTable, $pwg_loaded_plugins;
 	$query = 'select id,title FROM ' . TITLE_PHOTO_TABLE . ' WHERE id = '.$_GET['image_id'].';';
 	$result = pwg_query($query);
 	$row = pwg_db_fetch_assoc($result);
     $titleP=$row['title'];
-    $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
-	if($PAED['state'] == 'active'){
+	if (isset($pwg_loaded_plugins['ExtendedDescription'])){
 	  $template->assign('useED',1);
     }else{
@@ -119,11 +115,10 @@
 function titleAadminA(){ 
   if (isset($_GET['cat_id'])){
- 	global $template, $prefixeTable;
+ 	global $template, $prefixeTable, $pwg_loaded_plugins;
 	$query = 'select id,title FROM ' . TITLE_ALBUM_TABLE . ' WHERE id = '.$_GET['cat_id'].';';
 	$result = pwg_query($query);
 	$row = pwg_db_fetch_assoc($result);
 	$titleA=$row['title'];
-    $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
-	if($PAED['state'] == 'active'){
+	if (isset($pwg_loaded_plugins['ExtendedDescription'])){
 	  $template->assign('useED',1);
     }else{
Index: /extensions/title/language/ca_ES/index.php
===================================================================
--- /extensions/title/language/ca_ES/index.php	(revision 32301)
+++ /extensions/title/language/ca_ES/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/cs_CZ/index.php
===================================================================
--- /extensions/title/language/cs_CZ/index.php	(revision 32301)
+++ /extensions/title/language/cs_CZ/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/language/da_DK/index.php
===================================================================
--- /extensions/title/language/da_DK/index.php	(revision 32301)
+++ /extensions/title/language/da_DK/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/de_DE/index.php
===================================================================
--- /extensions/title/language/de_DE/index.php	(revision 32301)
+++ /extensions/title/language/de_DE/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/language/el_GR/index.php
===================================================================
--- /extensions/title/language/el_GR/index.php	(revision 32301)
+++ /extensions/title/language/el_GR/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/en_UK/index.php
===================================================================
--- /extensions/title/language/en_UK/index.php	(revision 32301)
+++ /extensions/title/language/en_UK/index.php	(revision 32302)
@@ -1,3 +1,10 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
 // Recursive call
 $url = '../';
Index: /extensions/title/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/title/language/en_UK/plugin.lang.php	(revision 32301)
+++ /extensions/title/language/en_UK/plugin.lang.php	(revision 32302)
@@ -1,7 +1,7 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Title plugin for piwigo                                               |
+// | Title plugin for piwigo by TEMMII                                     |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
+// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
Index: /extensions/title/language/eo_EO/index.php
===================================================================
--- /extensions/title/language/eo_EO/index.php	(revision 32301)
+++ /extensions/title/language/eo_EO/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/fa_IR/index.php
===================================================================
--- /extensions/title/language/fa_IR/index.php	(revision 32301)
+++ /extensions/title/language/fa_IR/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/fr_CA/index.php
===================================================================
--- /extensions/title/language/fr_CA/index.php	(revision 32301)
+++ /extensions/title/language/fr_CA/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/language/fr_FR/index.php
===================================================================
--- /extensions/title/language/fr_FR/index.php	(revision 32301)
+++ /extensions/title/language/fr_FR/index.php	(revision 32302)
@@ -1,3 +1,10 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
 // Recursive call
 $url = '../';
Index: /extensions/title/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/title/language/fr_FR/plugin.lang.php	(revision 32301)
+++ /extensions/title/language/fr_FR/plugin.lang.php	(revision 32302)
@@ -1,7 +1,7 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Title plugin for piwigo                                               |
+// | Title plugin for piwigo by TEMMII                                     |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
+// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
Index: /extensions/title/language/hu_HU/index.php
===================================================================
--- /extensions/title/language/hu_HU/index.php	(revision 32301)
+++ /extensions/title/language/hu_HU/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/language/index.php
===================================================================
--- /extensions/title/language/index.php	(revision 32301)
+++ /extensions/title/language/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/language/it_IT/index.php
===================================================================
--- /extensions/title/language/it_IT/index.php	(revision 32301)
+++ /extensions/title/language/it_IT/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo gallery                                    |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2011 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/language/lv_LV/index.php
===================================================================
--- /extensions/title/language/lv_LV/index.php	(revision 32301)
+++ /extensions/title/language/lv_LV/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/language/nb_NO/index.php
===================================================================
--- /extensions/title/language/nb_NO/index.php	(revision 32301)
+++ /extensions/title/language/nb_NO/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/pt_PT/index.php
===================================================================
--- /extensions/title/language/pt_PT/index.php	(revision 32301)
+++ /extensions/title/language/pt_PT/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/sk_SK/index.php
===================================================================
--- /extensions/title/language/sk_SK/index.php	(revision 32301)
+++ /extensions/title/language/sk_SK/index.php	(revision 32302)
@@ -1,23 +1,8 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 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 file is part of Piwigo.                                          |
 // |                                                                       |
-// | 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.                                                                  |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
 // +-----------------------------------------------------------------------+
 
Index: /extensions/title/language/sr_RS/index.php
===================================================================
--- /extensions/title/language/sr_RS/index.php	(revision 32301)
+++ /extensions/title/language/sr_RS/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/sv_SE/index.php
===================================================================
--- /extensions/title/language/sv_SE/index.php	(revision 32301)
+++ /extensions/title/language/sv_SE/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/language/tr_TR/index.php
===================================================================
--- /extensions/title/language/tr_TR/index.php	(revision 32301)
+++ /extensions/title/language/tr_TR/index.php	(revision 32302)
@@ -1,3 +1,11 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | This file is part of Piwigo.                                          |
+// |                                                                       |
+// | For copyright and license information, please view the COPYING.txt    |
+// | file that was distributed with this source code.                      |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
 $url = '../';
 header( 'Request-URI: '.$url );
Index: /extensions/title/main.inc.php
===================================================================
--- /extensions/title/main.inc.php	(revision 32301)
+++ /extensions/title/main.inc.php	(revision 32302)
@@ -10,7 +10,7 @@
 
 // +-----------------------------------------------------------------------+
-// | Title plugin for piwigo                                               |
+// | Title plugin for piwigo by TEMMII                                     |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
+// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
@@ -48,26 +48,21 @@
 add_event_handler('loc_begin_page_header', 'plug_Title', 56 );
 
-function plug_Title()
- {
-	global $template;
-	$template->set_prefilter('header', 'plug_TitleP');
-	
-	$PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
-	if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc');
- }
+function plug_Title(){
+  global $template, $pwg_loaded_plugins;
+  $template->set_prefilter('header', 'plug_TitleP');
+  if (isset($pwg_loaded_plugins['ExtendedDescription'])){
+	add_event_handler('AP_render_content', 'get_user_language_desc');
+  }  
+}
 
-function plug_TitleP($content, &$smarty)
- {
+function plug_TitleP($content, &$smarty){
   $search = '#<title>.*?</title>#';
-  
   $replacement = '<title>{$PERSO_TITLE}</title>
   ';
-
   return preg_replace($search, $replacement, $content);
- }
+}
 
 // Plugin for admin
-if (script_basename() == 'admin')   
-{
+if (script_basename() == 'admin'){
   include_once(dirname(__FILE__).'/initadmin.php');
 }
@@ -75,25 +70,17 @@
 // no empty !
 add_event_handler('loc_begin_page_header', 'plugTitle', 61 );
-function plugTitle()
- {
-	global $template, $conf;
-
-				$titlegen = & $conf['gallery_title'];
-		 if (!empty($titlegen))
-			{				
-				$template->assign('PERSO_TITLE', $titlegen);
-			}
-
- } 
-
+function plugTitle(){
+  global $template, $conf;
+  $titlegen = & $conf['gallery_title'];
+  if (!empty($titlegen)){				
+	$template->assign('PERSO_TITLE', $titlegen);
+  }
+} 
 
 //use title on photo page
 add_event_handler('loc_begin_page_header', 'TitlePhoto', 76 );
-function TitlePhoto()
- {
-		global $template, $page;
-
-			  if ( !empty($page['image_id']) )   
-				{
+function TitlePhoto(){
+  global $template, $page;
+  if ( !empty($page['image_id']) ){
     $query = '
 select id,title
@@ -104,21 +91,16 @@
 $row = pwg_db_fetch_assoc($result);
 $titleP=$row['title'];
-
 $titlePED=trigger_change('AP_render_content', $titleP);
-	
-		if (!empty($titlePED))
-			{
-				$template->assign('PERSO_TITLE', $titlePED);
-			}
-				}
- }
+	if (!empty($titlePED)){
+	  $template->assign('PERSO_TITLE', $titlePED);
+	}
+  }
+}
 
 // use title on album page
 add_event_handler('loc_begin_page_header', 'Titlealbum', 71 );
-function Titlealbum()
- {
-	global $template, $page;
-		 if (!empty($page['category']['id']) )   
-				{
+function Titlealbum(){
+  global $template, $page;
+  if (!empty($page['category']['id']) ){
     $query = '
 select id,title
@@ -129,21 +111,16 @@
 $row = pwg_db_fetch_assoc($result);
 $titleA=$row['title'];
+$titleAED=trigger_change('AP_render_content', $titleA);
+	if (!empty($titleAED)){
+				$template->assign('PERSO_TITLE', $titleAED);
+	}
+  }
+}
 
-$titleAED=trigger_change('AP_render_content', $titleA);
-
-		if (!empty($titleAED))
-			{
-				$template->assign('PERSO_TITLE', $titleAED);
-			}
-				}
- }
-
- //other pages
- add_event_handler('loc_begin_page_header', 'Titleother', 66 );
- function Titleother()
- {
-	global $template, $page, $conf;
-	
-		$query = '
+//other pages
+add_event_handler('loc_begin_page_header', 'Titleother', 66 );
+function Titleother(){
+  global $template, $page, $conf, $pwg_loaded_plugins;
+  $query = '
 select id,page,title
   FROM ' . TITLE_TABLE . '
@@ -151,78 +128,55 @@
   
   ;';
-$result = pwg_query($query);
-$titlespecial = array();
-		while ($row = pwg_db_fetch_assoc($result))
-			{
-			$titlespecial[$row['page']] = $row['title'];
-			$titlespecialED[$row['page']]=trigger_change('AP_render_content', $titlespecial[$row['page']]);
-			}
-	
-	  if (isset($page['section']) and $page['section'] == 'categories' and empty($page['category']['id']) and !empty($titlespecialED['home']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['home']);
-		}
-	  if (isset($page['section']) and $page['section'] == 'best_rated' and !empty($titlespecialED['best_rated']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['best_rated']);
-		}
-	  if (isset($page['section']) and $page['section'] == 'most_visited' and !empty($titlespecialED['most_visited']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['most_visited']);
-		}
-	  if (isset($page['section']) and $page['section'] == 'recent_pics' and !empty($titlespecialED['recent_pics']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['recent_pics']);
-		}
-	  if (isset($page['section']) and $page['section'] == 'recent_cats' and !empty($titlespecialED['recent_cats']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['recent_cats']);
-		}
-	  if (isset($page['section']) and $page['section'] == 'favorites' and !empty($titlespecialED['favorites']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['favorites']);
-		}
-	  if (script_basename() == 'tags' and !empty($titlespecialED['tags']))   
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['tags']);
-		}
-	  if (script_basename() == 'comments' and !empty($titlespecialED['comments']))   
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['comments']);
-		}
-	  if (script_basename() == 'about' and !empty($titlespecialED['about']))   
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['about']);
-		}
-	  if (script_basename() == 'search' and !empty($titlespecialED['search']))   
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['search']);
-		}
-	  if (isset($page['section']) and $page['section'] == 'list' and !empty($titlespecialED['random']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['random']);
-		}
-	  if (script_basename() == 'notification' and !empty($titlespecialED['notification']))   
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['notification']);
-		}
-	
-	$PAC = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ContactForm';"));
-	if($PAC['state'] == 'active')
-	{
-		$titlespecialED['contact']=trigger_change('AP_render_content', $conf['contacttitle']);
-	  if (isset($page['section']) and $page['section'] == 'contact' and !empty($titlespecialED['contact']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['contact']);
-		}
+  $result = pwg_query($query);
+  $titlespecial = array();
+  while ($row = pwg_db_fetch_assoc($result)){
+	$titlespecial[$row['page']] = $row['title'];
+	$titlespecialED[$row['page']]=trigger_change('AP_render_content', $titlespecial[$row['page']]);
+  }
+  if (isset($page['section']) and $page['section'] == 'categories' and empty($page['category']['id']) and !empty($titlespecialED['home'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['home']);
+  }
+  if (isset($page['section']) and $page['section'] == 'best_rated' and !empty($titlespecialED['best_rated'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['best_rated']);
+  }
+  if (isset($page['section']) and $page['section'] == 'most_visited' and !empty($titlespecialED['most_visited'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['most_visited']);
+  }
+  if (isset($page['section']) and $page['section'] == 'recent_pics' and !empty($titlespecialED['recent_pics'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['recent_pics']);
+  }
+  if (isset($page['section']) and $page['section'] == 'recent_cats' and !empty($titlespecialED['recent_cats'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['recent_cats']);
+  }
+  if (isset($page['section']) and $page['section'] == 'favorites' and !empty($titlespecialED['favorites'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['favorites']);
+  }
+  if (script_basename() == 'tags' and !empty($titlespecialED['tags'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['tags']);
+  }
+  if (script_basename() == 'comments' and !empty($titlespecialED['comments'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['comments']);
+  }
+  if (script_basename() == 'about' and !empty($titlespecialED['about'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['about']);
+  }
+  if (script_basename() == 'search' and !empty($titlespecialED['search'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['search']);
+  }
+  if (isset($page['section']) and $page['section'] == 'list' and !empty($titlespecialED['random'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['random']);
+  }
+  if (script_basename() == 'notification' and !empty($titlespecialED['notification'])){
+	$template->assign('PERSO_TITLE', $titlespecialED['notification']);
+  }
+  if (isset($pwg_loaded_plugins['ContactForm'])){
+  	$titlespecialED['contact']=trigger_change('AP_render_content', $conf['contacttitle']);
+	if (isset($page['section']) and $page['section'] == 'contact' and !empty($titlespecialED['contact'])){
+	  $template->assign('PERSO_TITLE', $titlespecialED['contact']);
 	}
-	
-	$PAAP = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'AdditionalPages';"));
-	if($PAAP['state'] == 'active')
-	{
-	
+  }
+  if (isset($pwg_loaded_plugins['AdditionalPages'])){	
 	global $prefixeTable;
-			if ( !empty($page['additional_page']['id']) )   
-				{
+	if ( !empty($page['additional_page']['id']) ){
 		if (!defined('TITLE_AP_TABLE')) define('TITLE_AP_TABLE', $prefixeTable.'title_ap');	
 	$lire=$page['additional_page']['id'];
@@ -236,11 +190,10 @@
 	$titleap=$row['title'];
 	$titlespecialED['AdditionalPages']=trigger_change('AP_render_content', $titleap);	
-				}
-	  if (isset($page['section']) and $page['section'] == 'additional_page' and !empty($titlespecialED['AdditionalPages']))
-		{
-			$template->assign('PERSO_TITLE', $titlespecialED['AdditionalPages']);
-		}
 	}
- }
+	if (isset($page['section']) and $page['section'] == 'additional_page' and !empty($titlespecialED['AdditionalPages'])){
+	  $template->assign('PERSO_TITLE', $titlespecialED['AdditionalPages']);
+	}
+  }
+}
  
 ?>
Index: /extensions/title/maintain.class.php
===================================================================
--- /extensions/title/maintain.class.php	(revision 32301)
+++ /extensions/title/maintain.class.php	(revision 32302)
@@ -1,7 +1,7 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Title plugin for piwigo                                               |
+// | Title plugin for piwigo by TEMMII                                     |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
+// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
