Index: /extensions/title/admin/admin.php
===================================================================
--- /extensions/title/admin/admin.php	(revision 9407)
+++ /extensions/title/admin/admin.php	(revision 9407)
@@ -0,0 +1,116 @@
+<?php
+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', TITLE_PATH);
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+// Gestion des onglets
+if (!isset($_GET['tab']))
+    $page['tab'] = 'plugtitle';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('plugtitle',
+               l10n('title_tab_plgtitle'),
+               $my_base_url.'&amp;tab=plugtitle');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// Tab Title on specials pages
+switch ($page['tab'])
+{
+  case 'plugtitle':
+
+$titlepagelistT = array(
+    l10n('title_select'),
+	'----------------------',
+    l10n('Home'),
+    l10n('Best rated'),
+    l10n('Most visited'),
+	l10n('Recent pictures'),
+	l10n('Recent categories'),
+	l10n('Favorites'),
+	l10n('Tags'),
+	l10n('Comments'),
+	l10n('About'),
+	l10n('search'),
+	l10n('Random pictures'),
+	l10n('Notification'),
+  );
+  
+$titlepagelist = array(
+    '',
+    '',
+    'home',
+    'best_rated',
+    'most_visited',
+	'recent_pics',
+	'recent_cats',
+	'favorites',
+	'tags',
+	'comments',
+	'about',
+	'search',
+	'random',
+	'notification',
+  );
+  
+    $template->assign(
+    'gestionA',
+    array(
+      ));
+
+$template->assign('titlepagelist', $titlepagelist);
+$template->assign('titlepagelistT', $titlepagelistT);
+
+//edit title
+if (isset($_POST['subtitlespecialET']) and (!$_POST['titlelist'])==0 and !is_adviser())
+	{
+$lire=$_POST['titlelist'];
+	$query = '
+select id,page,title
+  FROM ' . TITLE_TABLE . '
+  WHERE page = \''.$lire.'\'
+  ;';
+$result = pwg_query($query);
+
+$row = mysql_fetch_array($result);
+$titlepage=$row['page'];
+$titletitle=$row['title'];
+
+  $selected2 = "";
+  
+  $template->assign(
+    'title_edit',
+    array(
+      'VALUE' => $titlepage,
+      'CONTENT' => $titletitle,
+      'SELECTED' => $selected2
+      ));
+	}
+
+//insert title in database
+if (isset($_POST['subtitlespecial']) and !is_adviser())
+	{
+	$query = '
+UPDATE ' . TITLE_TABLE . '
+  SET title= \''.$_POST['inser'].'\'
+  WHERE page = \''.$_POST['invisible'].'\'
+    ;';
+$result = pwg_query($query);
+	}
+
+    break;
+	
+} 
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/title/admin/admin.tpl
===================================================================
--- /extensions/title/admin/admin.tpl	(revision 9407)
+++ /extensions/title/admin/admin.tpl	(revision 9407)
@@ -0,0 +1,36 @@
+<div class="titrePage">
+  <h2>Title</h2>
+</div>
+{if isset ($gestionA)}
+		  <h3>{'title_pre'|@translate}</h3>
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'title_select'|@translate}</legend>
+					{'title_list'|@translate}	
+					{html_options name="titlelist" values=$titlepagelist output=$titlepagelistT selected=$title_edit.VALUE}
+				<br>	
+				<br>
+				<div style="text-align:center;">
+					<input class="submit" name="subtitlespecialET" type="submit" value="{'title_choix'|@translate}" {$TAG_INPUT_ENABLED} />
+				</div>
+			</fieldset>
+		</form>
+	</div>
+	{if isset ($title_edit)}
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'title_page'|@translate}</legend>
+					<input type="hidden" name="invisible" value="{$title_edit.VALUE}">
+					<input type="text" name="inser" value="{$title_edit.CONTENT}" size="100" maxlenght="100">
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="subtitlespecial" type="submit" value="{'title_insbase'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+	{/if}
+{/if}
Index: /extensions/title/admin/index.php
===================================================================
--- /extensions/title/admin/index.php	(revision 9407)
+++ /extensions/title/admin/index.php	(revision 9407)
@@ -0,0 +1,30 @@
+<?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 program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/title/index.php
===================================================================
--- /extensions/title/index.php	(revision 9407)
+++ /extensions/title/index.php	(revision 9407)
@@ -0,0 +1,30 @@
+<?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 program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/title/initadmin.php
===================================================================
--- /extensions/title/initadmin.php	(revision 9407)
+++ /extensions/title/initadmin.php	(revision 9407)
@@ -0,0 +1,165 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+
+//Add link menu
+add_event_handler('get_admin_plugin_menu_links', 'title_admin_menu');
+function title_admin_menu($menu)
+{
+  array_push($menu, array(
+	'NAME' => 'Title',
+    'URL' => get_admin_plugin_menu_link(TITLE_PATH . 'admin/admin.php')));
+  return $menu;
+}
+
+
+//add prefiltre photo
+add_event_handler('loc_begin_admin', 'titlePadminf',60);
+add_event_handler('loc_begin_admin', 'titlePadminA',60);
+
+function titlePadminf()
+	{
+	global $template;
+	$template->set_prefilter('picture_modify', 'titlePadminfT');
+	}
+
+function titlePadminfT($content, &$smarty)
+	{
+  $search = '#<form id="associations"#';
+  
+  $replacement = '
+	<div>
+		<form method="post" >
+			<fieldset>
+			  <br>
+				<legend>{\'Title - Plugin title\'|@translate}</legend>
+					{\'title_photo\'|@translate}&nbsp;:&nbsp;<input type="text" name="inser" value="{$titleCONTENT}" size="110" maxlenght="110">
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="subtitlephoto" type="submit" value="{\'title_insbase\'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>  
+  <form id="associations"';
+
+  return preg_replace($search, $replacement, $content);
+	}
+ 
+function titlePadminA()
+	{ 
+		load_language('plugin.lang', TITLE_PATH);
+if (isset($_GET['image_id']))
+ {
+ 	global $template, $prefixeTable;
+$query = '
+select id,title
+  FROM ' . TITLE_PHOTO_TABLE . '
+  WHERE id = '.$_GET['image_id'].'
+  ;';
+$result = pwg_query($query);
+$row = mysql_fetch_array($result);
+$titleP=$row['title'];
+
+  $template->assign(
+    array(
+      'titleCONTENT' => $titleP,
+      ));
+ }
+ 
+if (isset($_POST['subtitlephoto']))
+ {
+ 	$query = '
+DELETE 
+  FROM ' . TITLE_PHOTO_TABLE . '
+  WHERE id = '.$_GET['image_id'].'
+  ;';
+$result = pwg_query($query);
+	$q = '
+INSERT INTO ' . $prefixeTable . 'title_photo(id,title)VALUES ('.$_GET['image_id'].',"'.$_POST['inser'].'");';
+    pwg_query($q);
+  
+  $template->assign(
+    array(
+      'titleCONTENT' => $_POST['inser'],
+      ));
+  }
+	}
+	
+//add prefiltre album
+add_event_handler('loc_end_cat_modify', 'titleAadminf', 60);
+add_event_handler('loc_end_cat_modify', 'titleAadminA', 60);
+
+function titleAadminf()
+ {
+	global $template;
+	$template->set_prefilter('categories', 'titleAadminfT');
+ }
+
+function titleAadminfT($content, &$smarty)
+ {
+  $search = '#<fieldset id="options">#';
+  
+  $replacement = '
+	<div>
+		<form method="post" >
+			<fieldset>
+			  <br>
+				<legend>{\'Title - Plugin title\'|@translate}</legend>
+					{\'title_album\'|@translate}&nbsp;:&nbsp;<input type="text" name="inser" value="{$titleCONTENT}" size="110" maxlenght="110">
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="subtitlealbum" type="submit" value="{\'title_insbase\'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>  
+  <fieldset id="options">
+  ';
+
+  return preg_replace($search, $replacement, $content);
+ }
+
+ function titleAadminA()
+	{ 
+		load_language('plugin.lang', meta_PATH);
+if (isset($_GET['cat_id']))
+ {
+ 	global $template, $prefixeTable;
+$query = '
+select id,title
+  FROM ' . TITLE_ALBUM_TABLE . '
+  WHERE id = '.$_GET['cat_id'].'
+  ;';
+$result = pwg_query($query);
+$row = mysql_fetch_array($result);
+$titleA=$row['title'];
+
+  $template->assign(
+    array(
+      'titleCONTENT' => $titleA,
+      ));
+ }
+ 
+if (isset($_POST['subtitlealbum']))
+ {
+	$query = '
+DELETE 
+  FROM ' . TITLE_ALBUM_TABLE . '
+  WHERE id = '.$_GET['cat_id'].'
+  ;';
+$result = pwg_query($query);
+	$q = '
+INSERT INTO ' . $prefixeTable . 'title_album(id,title)VALUES ('.$_GET['cat_id'].',"'.$_POST['inser'].'");';
+    pwg_query($q);
+		
+  $template->assign(
+    array(
+      'titleCONTENT' => $_POST['inser'],
+      ));
+  }
+	}
+
+?>
Index: /extensions/title/language/en_UK/description.txt
===================================================================
--- /extensions/title/language/en_UK/description.txt	(revision 9407)
+++ /extensions/title/language/en_UK/description.txt	(revision 9407)
@@ -0,0 +1,1 @@
+hhhhhhh
Index: /extensions/title/language/en_UK/index.php
===================================================================
--- /extensions/title/language/en_UK/index.php	(revision 9407)
+++ /extensions/title/language/en_UK/index.php	(revision 9407)
@@ -0,0 +1,30 @@
+<?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 program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/title/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/title/language/en_UK/plugin.lang.php	(revision 9407)
+++ /extensions/title/language/en_UK/plugin.lang.php	(revision 9407)
@@ -0,0 +1,4 @@
+<?php
+
+
+?>
Index: /extensions/title/language/fr_FR/description.txt
===================================================================
--- /extensions/title/language/fr_FR/description.txt	(revision 9407)
+++ /extensions/title/language/fr_FR/description.txt	(revision 9407)
@@ -0,0 +1,1 @@
+Permet de personaliser la balise title pour toutes les pages
Index: /extensions/title/language/fr_FR/index.php
===================================================================
--- /extensions/title/language/fr_FR/index.php	(revision 9407)
+++ /extensions/title/language/fr_FR/index.php	(revision 9407)
@@ -0,0 +1,30 @@
+<?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 program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/title/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/title/language/fr_FR/plugin.lang.php	(revision 9407)
+++ /extensions/title/language/fr_FR/plugin.lang.php	(revision 9407)
@@ -0,0 +1,14 @@
+<?php
+
+$lang['Title - Plugin title'] = 'Titre de la page - Plugin title';
+$lang['title_insbase'] = 'Enregistre le titre dans la base';
+$lang['title_photo'] = 'Titre de la page pour la photo';
+$lang['title_album'] = 'Titre de la page pour l\'album';
+$lang['title_tab_plgtitle'] = 'Gestion des titres';
+$lang['title_pre'] = 'Personnaliser le titre des pages spéciales';
+$lang['title_select'] = 'Sélectionner une page';
+$lang['title_list'] = 'Liste des pages';
+$lang['title_choix'] = 'éditer le titre';
+$lang['title_page'] = 'Titre pour la page';
+
+?>
Index: /extensions/title/language/index.php
===================================================================
--- /extensions/title/language/index.php	(revision 9407)
+++ /extensions/title/language/index.php	(revision 9407)
@@ -0,0 +1,30 @@
+<?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 program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/title/main.inc.php
===================================================================
--- /extensions/title/main.inc.php	(revision 9407)
+++ /extensions/title/main.inc.php	(revision 9407)
@@ -0,0 +1,185 @@
+<?php
+/*
+Plugin Name: Title
+Version: auto
+Description: Allows to title
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
+Author: ddtddt
+Author URI: http://piwigo.org/
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable, $template;
+
+define('TITLE_DIR' , basename(dirname(__FILE__)));
+define('TITLE_PATH' , PHPWG_PLUGINS_PATH . TITLE_DIR . '/');
+define('TITLE_TABLE' , $prefixeTable . 'title');
+define('TITLE_PHOTO_TABLE' , $prefixeTable . 'title_photo');
+define('TITLE_ALBUM_TABLE' , $prefixeTable . 'title_album');
+
+//prefiltre for change <title>
+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_TitleP($content, &$smarty)
+ {
+  $search = '#<title>.*?</title>#';
+  
+  $replacement = '<title>{$PERSO_TITLE}</title>
+  ';
+
+  return preg_replace($search, $replacement, $content);
+ }
+
+// Plugin for admin
+if (script_basename() == 'admin')   
+{
+  include_once(dirname(__FILE__).'/initadmin.php');
+}
+
+// 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);
+			}
+
+ } 
+
+
+//use title on photo page
+add_event_handler('loc_begin_page_header', 'TitlePhoto', 76 );
+function TitlePhoto()
+ {
+		global $template, $page;
+
+			  if ( !empty($page['image_id']) )   
+				{
+    $query = '
+select id,title
+  FROM ' . TITLE_PHOTO_TABLE . '
+  WHERE id = \''.$page['image_id'].'\'
+  ;';
+$result = pwg_query($query);
+$row = mysql_fetch_array($result);
+$titleP=$row['title'];
+
+$titlePED=trigger_event('AP_render_content', $titleP);
+	
+		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']) )   
+				{
+    $query = '
+select id,title
+  FROM ' . TITLE_ALBUM_TABLE . '
+  WHERE id = \''.$page['category']['id'].'\'
+  ;';
+$result = pwg_query($query);
+$row = mysql_fetch_array($result);
+$titleA=$row['title'];
+
+$titleAED=trigger_event('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;
+	
+		$query = '
+select id,page,title
+  FROM ' . TITLE_TABLE . '
+  WHERE page IN (\'home\', \'best_rated\', \'most_visited\', \'recent_pics\', \'recent_cats\', \'favorites\', \'tags\', \'comments\', \'about\', \'search\', \'random\', \'notification\')
+  
+  ;';
+$result = pwg_query($query);
+$titlespecial = array();
+		while ($row = mysql_fetch_assoc($result))
+			{
+			$titlespecial[$row['page']] = $row['title'];
+			$titlespecialED[$row['page']]=trigger_event('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']);
+		}		
+ }
+ 
+?>
Index: /extensions/title/maintain.inc.php
===================================================================
--- /extensions/title/maintain.inc.php	(revision 9407)
+++ /extensions/title/maintain.inc.php	(revision 9407)
@@ -0,0 +1,85 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+function plugin_install()
+{
+    global $prefixeTable;
+
+    $q = 'CREATE TABLE ' . $prefixeTable . 'title(
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+page VARCHAR( 255 ) NOT NULL ,
+title lONGTEXT NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;';
+    pwg_query($q);
+	
+	$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (1,"home","");';
+    pwg_query($q);
+	$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (2,"best_rated","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (3,"most_visited","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (4,"recent_pics","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (5,"recent_cats","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (6,"favorites","");';
+    pwg_query($q);	
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (7,"tags","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (8,"comments","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (9,"about","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (10,"search","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (11,"random","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (12,"notification","");';
+    pwg_query($q);	
+	
+if (!defined('TITLE_PHOTO_TABLE')) define('TITLE_PHOTO_TABLE', $prefixeTable.'title_photo');
+	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_PHOTO_TABLE ." (
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+title VARCHAR( 255 ) NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
+	$result = pwg_query($query);
+
+if (!defined('TITLE_ALBUM_TABLE')) define('TITLE_ALBUM_TABLE', $prefixeTable.'title_album');	
+	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_ALBUM_TABLE ." (
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+title VARCHAR( 255 ) NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
+	$result = pwg_query($query);
+	
+}
+
+function plugin_uninstall()
+{
+    
+	global $prefixeTable;
+
+	$q = 'DROP TABLE ' . $prefixeTable . 'title;';
+    pwg_query($q);
+	
+	$q = 'DROP TABLE ' . $prefixeTable . 'title_photo;';
+    pwg_query($q);
+
+	$q = 'DROP TABLE ' . $prefixeTable . 'title_album;';
+    pwg_query($q);
+}
+
+
+?>
