Index: /extensions/meta/admin/admin.php
===================================================================
--- /extensions/meta/admin/admin.php	(revision 3978)
+++ /extensions/meta/admin/admin.php	(revision 3978)
@@ -0,0 +1,193 @@
+<?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', meta_PATH);
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+//-------------------------------------------------------- sections definitions
+// Gestion des onglets
+if (!isset($_GET['tab']))
+    $page['tab'] = 'gestion';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('gestion',
+               l10n('meta_onglet_gestion'),
+               $my_base_url.'&amp;tab=gestion');
+$tabsheet->add('categorie',
+               l10n('meta_onglet_categorie'),
+               $my_base_url.'&amp;tab=categorie');
+$tabsheet->add('description',
+               l10n('meta_onglet_description'),
+               $my_base_url.'&amp;tab=description');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// Onglet gestion des meta
+switch ($page['tab'])
+{
+  case 'gestion':
+
+//charge la liste des meta
+$groups = array();
+$query = '
+select id,metaname
+  FROM ' . meta_TABLE . '
+  ORDER BY metaname ASC;';
+$result = pwg_query($query);
+
+while ($row = mysql_fetch_array($result))
+	{
+  $groups[$row['id']] = $row['metaname'];
+	}
+
+    $selected = 0;
+	$options[] = l10n('meta_select2');
+	$options['a'] = '----------------------';
+
+
+  foreach ($groups as $metalist => $metalist2)
+	{
+    $options[$metalist] = $metalist2;
+	}
+  $template->assign(
+    'gestionA',
+    array(
+      'OPTIONS' => $options,
+      'SELECTED' => $selected
+      ));
+
+
+//edit de meta
+if (isset($_POST['submitchoixmeta']) and is_numeric($_POST['metalist']) and (!$_POST['metalist'])==0 and !is_adviser())
+	{
+$lire=$_POST['metalist'];
+	$query = '
+select id,metaname,metaval
+  FROM ' . meta_TABLE . '
+  WHERE id = \''.$lire.'\'
+  ;';
+$result = pwg_query($query);
+
+$row = mysql_fetch_array($result);
+$chname=$row['metaname'];
+$chval=$row['metaval'];
+
+  $selected2 = "";
+  
+  $template->assign(
+    'meta_edit',
+    array(
+      'VALUE' => $chname,
+      'CONTENT' => $chval,
+      'SELECTED' => $selected2
+      ));
+	}
+
+//insértion de meta dans la table
+if (isset($_POST['submitinsmeta']) and !is_adviser())
+	{
+	$query = '
+UPDATE ' . meta_TABLE . '
+  SET metaval= \''.$_POST['inser'].'\'
+  WHERE metaname = \''.$_POST['invisible'].'\'
+    ;';
+$result = pwg_query($query);
+	}
+
+    break;
+// Onglet gestion des meta categorie
+  case 'categorie':
+
+//charge la liste des catégories
+$groups = array();
+$query = '
+select id,name
+  FROM ' . CATEGORIES_TABLE . '
+  ORDER BY id ASC;';
+$result = pwg_query($query);
+
+while ($row = mysql_fetch_array($result))
+	{
+  $groups[$row['id']] = $row['id'].' : '.$row['name'];
+	}
+	
+	$selected = 0;
+	$options[] = l10n('meta_select3');
+	$options['a'] = '----------------------';
+	
+foreach($groups as $listid => $listid2)
+	{
+    $options[$listid] = $listid2;
+	}
+  $template->assign(
+    'gestionB',
+    array(
+	  'OPTIONS' => $options,
+      'SELECTED' => $selected
+      ));
+	
+	
+//edit de categorie
+if (isset($_POST['submitchoixcat'])and is_numeric($_POST['metacat']) and (!$_POST['metacat'])==0 and !is_adviser())
+	{
+$lire=$_POST['metacat'];
+	$query = '
+select id,name,metaKeywords
+  FROM ' . CATEGORIES_TABLE . '
+  WHERE id = \''.$lire.'\'
+  ;';
+$result = pwg_query($query);
+
+$row = mysql_fetch_array($result);
+$idcat=$row['id'];
+$chnamecat=$row['name'];
+$chvalcat=$row['metaKeywords'];
+
+  $selected3 = 0;
+  
+  $template->assign(
+    'cat_edit',
+    array(
+      'VALUE' => $idcat,
+	  'VALUEN' => $chnamecat,
+      'CONTENT' => $chvalcat,
+      'SELECTED' => $selected3
+      ));
+	}
+
+//insértion de meta de cat dans la table cat
+if (isset($_POST['submitinscat']) and !is_adviser())
+	{
+	$query = '
+UPDATE ' . CATEGORIES_TABLE . '
+  SET metaKeywords= \''.$_POST['inser'].'\'
+  WHERE id = \''.$_POST['invisible'].'\'
+    ;';
+$result = pwg_query($query);
+	}
+ 
+    break;
+// Onglet  description
+  case 'description':
+
+$blockdesc = 'description';
+$template->assign(
+	$blockdesc,
+	array(
+	  'meta'=>l10n('meta_name'),
+	  ));
+	break;
+} 
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/meta/admin/admin.tpl
===================================================================
--- /extensions/meta/admin/admin.tpl	(revision 3978)
+++ /extensions/meta/admin/admin.tpl	(revision 3978)
@@ -0,0 +1,90 @@
+<div class="titrePage">
+  <h2>meta</h2>
+</div>
+
+{if isset ($gestionA)}
+		  <h3>{'meta_desh3'|@translate}</h3>
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'meta_select'|@translate}</legend>
+				{'meta_list'|@translate}	
+		{html_options name="metalist" options=$gestionA.OPTIONS selected=$gestionA.SELECTED}
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submitchoixmeta" type="submit" value="{'meta_choix'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+	{if isset ($meta_edit)}
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'meta_comp'|@translate}</legend>
+					<input type="hidden" name="invisible" value="{$meta_edit.VALUE}">
+					{$meta_edit.VALUE}&nbsp;&nbsp;<input type="text" name="inser" value="{$meta_edit.CONTENT}" size="100" maxlenght="100">
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submitinsmeta" type="submit" value="{'meta_insmeta'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+	{/if}
+{/if}
+
+{if isset ($gestionB)}
+	  <h3>{'meta_cath3'|@translate}</h3>
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'meta_selectcat'|@translate}</legend>
+				{'meta_listcat'|@translate}	
+		{html_options name="metacat" options=$gestionB.OPTIONS selected=$gestionB.SELECTED}
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submitchoixcat" type="submit" value="{'meta_choixcat'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+	{if isset ($cat_edit)}
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'meta_compcat'|@translate}</legend>
+					<input type="hidden" name="invisible" value="{$cat_edit.VALUE}">
+					id&nbsp;:&nbsp;{$cat_edit.VALUE}&nbsp;->&nbsp;{$cat_edit.VALUEN}&nbsp;&nbsp;<input type="text" name="inser" value="{$cat_edit.CONTENT}" size="110" maxlenght="110">
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submitinscat" type="submit" value="{'meta_inscat'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+	{/if}
+{/if}
+
+{if isset ($description)}
+	<div class="comment">
+		<h3>{'meta_author'|@translate}</h3>
+			{'meta_author_help'|@translate}
+	</div>
+	<div class="comment">
+		<h3>{'meta_keywords'|@translate}</h3>
+			{'meta_keywords_help'|@translate}
+	</div>
+	<div class="comment">
+		<h3>{'meta_Description'|@translate}</h3>
+			{'meta_Description_help'|@translate}
+	</div>
+	<div class="comment">
+		<h3>{'meta_robots'|@translate}</h3>
+			{'meta_robots_help'|@translate}
+	</div>
+{/if}
Index: /extensions/meta/admin/index.php
===================================================================
--- /extensions/meta/admin/index.php	(revision 3978)
+++ /extensions/meta/admin/index.php	(revision 3978)
@@ -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/meta/index.php
===================================================================
--- /extensions/meta/index.php	(revision 3978)
+++ /extensions/meta/index.php	(revision 3978)
@@ -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/meta/language/en_UK/index.php
===================================================================
--- /extensions/meta/language/en_UK/index.php	(revision 3978)
+++ /extensions/meta/language/en_UK/index.php	(revision 3978)
@@ -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/meta/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/meta/language/en_UK/plugin.lang.php	(revision 3978)
+++ /extensions/meta/language/en_UK/plugin.lang.php	(revision 3978)
@@ -0,0 +1,52 @@
+<?php
+
+//onglet gestion
+$lang['meta_onglet_gestion'] = 'Metadata';
+$lang['meta_desh3'] = 'Add meta to all the pages';
+$lang['meta_name'] = 'Name of metadata';
+$lang['meta_select'] = 'Select metadata to be edit';
+$lang['meta_choix'] = 'Edit metadata';
+$lang['meta_list'] = 'Metadata :';
+$lang['meta_select2'] = 'Select metadata';
+$lang['meta_description'] = 'description';
+$lang['meta_diff_val'] = 'Possible value';
+$lang['meta_comp'] = 'Metadata to be supplemented';
+$lang['meta_insmeta'] = 'insert the metadata in the table';
+
+//onglet description categorie
+$lang['meta_onglet_categorie'] = 'Categorie\'s Metadata';
+$lang['meta_cath3'] = 'Add meta keywords to the categories';
+$lang['meta_select3'] = 'Select the category';
+$lang['meta_selectcat'] = 'Select the name of the category to be edit';
+$lang['meta_listcat'] = 'List categories :';
+$lang['meta_choixcat'] = 'Edit the category';
+$lang['meta_compcat'] = 'Keywords of the category to be completed';
+$lang['meta_inscat'] = 'Insert Keywords into the base ';
+
+//onglet description
+$lang['meta_onglet_description'] = 'Description Metadata';
+$lang['meta_author'] = 'Description meta author';
+$lang['meta_author_help'] = 'Information on the author <br>
+Information on the author of the site ';
+$lang['meta_keywords'] = 'Description meta keywords';
+$lang['meta_keywords_help'] = '"Keyword, keyword, etc."<br>
+Keywords describing the web page. (Separated by a comma)';
+$lang['meta_Description'] = 'Description meta Description';
+$lang['meta_Description_help'] = 'Description of your site<br>
+Allows to give an information to post during the result of a search';
+$lang['meta_robots'] = 'Description meta robots';
+$lang['meta_robots_help'] = '
+all : Allows the robot to reference all the page (by default)<br>
+follow : Allows the robot to follow the links of the page<br>
+index : Allows the robot to index the page<br>
+nofollow : Forbidden the robot to follow the links<br>
+noindex : Forbidden the robot to index the page<br>
+none : Prevent the robot from pursuing the indexation of the site<br>
+';
+
+
+
+
+
+
+?>
Index: /extensions/meta/language/fr_FR/index.php
===================================================================
--- /extensions/meta/language/fr_FR/index.php	(revision 3978)
+++ /extensions/meta/language/fr_FR/index.php	(revision 3978)
@@ -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/meta/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/meta/language/fr_FR/plugin.lang.php	(revision 3978)
+++ /extensions/meta/language/fr_FR/plugin.lang.php	(revision 3978)
@@ -0,0 +1,52 @@
+<?php
+
+//onglet gestion
+$lang['meta_onglet_gestion'] = 'Métadonnées';
+$lang['meta_desh3'] = 'Ajouter des métadonnées à toutes les pages';
+$lang['meta_name'] = 'Nom de la métadonnée';
+$lang['meta_select'] = 'Sélectionnez la metadonnée à éditer';
+$lang['meta_choix'] = 'Editer la metadonnée';
+$lang['meta_list'] = 'Metadonnée :';
+$lang['meta_select2'] = 'Sélectionnez la metadonnée';
+$lang['meta_description'] = 'description';
+$lang['meta_diff_val'] = 'Valeur possible';
+$lang['meta_comp'] = 'Metadonnée à complèter';
+$lang['meta_insmeta'] = 'inserer la metadonnée dans la table';
+
+//onglet description categorie
+$lang['meta_onglet_categorie'] = 'Metadonnée des Catégories';
+$lang['meta_cath3'] = 'Ajouter des meta keywords aux catégories';
+$lang['meta_select3'] = 'Sélectionnez la catégorie';
+$lang['meta_selectcat'] = 'Sélectionnez le nom de la catégorie à éditer';
+$lang['meta_listcat'] = 'Liste des catégories :';
+$lang['meta_choixcat'] = 'Éditer la catégorie';
+$lang['meta_compcat'] = 'Mots clés de la catégorie à complèter';
+$lang['meta_inscat'] = 'Insérer les Mots clés dans la base';
+
+//onglet description
+$lang['meta_onglet_description'] = 'Description des Metadonnées';
+$lang['meta_author'] = 'Description de meta author';
+$lang['meta_author_help'] = 'Informations sur l\'auteur<br>
+Informations sur l\'auteur du site';
+$lang['meta_keywords'] = 'Description de meta keywords';
+$lang['meta_keywords_help'] = '"mot clé, mot clé, etc."<br>
+Mots clés décrivant la page Web.(séparé par une virgule)';
+$lang['meta_Description'] = 'Description de meta Description';
+$lang['meta_Description_help'] = 'Description de votre site<br>
+Permet de donner une information à afficher lors du résultat d\'une recherche.';
+$lang['meta_robots'] = 'Description de meta robots';
+$lang['meta_robots_help'] = '
+all : Permet au robot de référencer toute la page (par défaut)<br>
+follow : Permet au robot de suivre les liens de la page<br>
+index : Permet au robot d\'indexer la page<br>
+nofollow : Interdit au robot de suivre les liens<br>
+noindex : Interdit au robot d\'indexer la page<br>
+none : Empêche le robot de poursuivre l\'indexation du site<br>
+';
+
+
+
+
+
+
+?>
Index: /extensions/meta/language/index.php
===================================================================
--- /extensions/meta/language/index.php	(revision 3978)
+++ /extensions/meta/language/index.php	(revision 3978)
@@ -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/meta/main.inc.php
===================================================================
--- /extensions/meta/main.inc.php	(revision 3978)
+++ /extensions/meta/main.inc.php	(revision 3978)
@@ -0,0 +1,116 @@
+<?php
+/*
+Plugin Name: meta
+Version: 2.0.0.c
+Description: Allows to add metadata
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=220
+Author: ddtddt
+Author URI: http://piwigo.org/
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+define('meta_DIR' , basename(dirname(__FILE__)));
+define('meta_PATH' , PHPWG_PLUGINS_PATH . meta_DIR . '/');
+define('meta_TABLE' , $prefixeTable . 'meta');
+
+add_event_handler('get_admin_plugin_menu_links', 'meta_admin_menu');
+function meta_admin_menu($menu)
+{
+  array_push($menu, array(
+		'NAME' => 'Meta',
+    'URL' => get_admin_plugin_menu_link(meta_PATH . 'admin/admin.php')));
+  return $menu;
+}
+
+//Gestion des meta dans le header
+add_event_handler('loc_begin_page_header', 'add_meta' );
+function add_meta()
+{
+  global $template, $page, $meta_infos;
+
+  $meta_infos = array();
+  $meta_infos['author'] = $template->get_template_vars('INFO_AUTHOR');
+  $meta_infos['related_tags'] = $template->get_template_vars('related_tags');
+  $meta_infos['info'] = $template->get_template_vars('INFO_FILE');
+
+  $query = '
+  select id,metaname,metaval
+    FROM ' . meta_TABLE . '
+    WHERE metaname IN (\'author\', \'keywords\', \'Description\', \'robots\')
+    ;';
+  $result = pwg_query($query);
+  $meta = array();
+  while ($row = mysql_fetch_assoc($result))
+  {
+    $meta[$row['metaname']] = $row['metaval'];
+  }
+
+  // Authors
+  if (!empty($meta_infos['author']) and !empty($meta['author']))
+  {
+    $template->assign('INFO_AUTHOR', $meta_infos['author'] . ' - ' . $meta['author']);
+  }
+  elseif (!empty($meta['author']))
+  {
+    $template->assign('INFO_AUTHOR', $meta['author']);
+  }
+  
+  // Keywords
+  if (!empty($meta['keywords']))
+  {
+    $template->append('related_tags', array('name' => $meta['keywords']));
+  }
+
+  // Description
+  if (!empty($meta_infos['info']) and !empty($meta['Description']))
+  {
+    $template->assign('INFO_FILE', $meta_infos['info'] . ', ' . $meta['Description']);
+  }
+  elseif (!empty($meta['Description']))
+  {
+    $template->assign('INFO_FILE', $meta['Description']);
+  }
+
+  // Robots
+  if (!empty($meta['robots']))
+  {
+    $template->append('head_elements', '<meta name="robots" content="'.$meta['robots'].'">');
+  }
+
+  //meta categories
+  if ( !empty($page['category']['name']) )   
+  {
+    $page['category']['info'] = get_cat_info($page['category']['id']);
+    $page['category']['name'] = $page['category']['info']['name'];
+
+    $query = '
+    select id,name,metakeywords,comment
+      FROM ' . CATEGORIES_TABLE . '
+      WHERE id = \''.$page['category']['id'].'\'
+      ;';
+    $result = pwg_query($query);
+    $row = mysql_fetch_array($result);
+    if (!empty($row['metakeywords']))
+    {
+      $template->append('related_tags', array('name' => $row['metakeywords']));
+    }
+  }
+}
+
+
+add_event_handler('loc_after_page_header', 'set_meta_back');
+function set_meta_back()
+{
+  global $template, $meta_infos;
+  
+  $template->assign(array(
+    'INFO_AUTHOR'  => $meta_infos['author'],
+    'related_tags' => $meta_infos['related_tags'],
+    'INFO_FILE'    => $meta_infos['info']
+    )
+  );
+}
+?>
Index: /extensions/meta/maintain.inc.php
===================================================================
--- /extensions/meta/maintain.inc.php	(revision 3978)
+++ /extensions/meta/maintain.inc.php	(revision 3978)
@@ -0,0 +1,54 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+function plugin_install()
+{
+    global $prefixeTable;
+
+    $q = 'CREATE TABLE ' . $prefixeTable . 'meta(
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+metaname VARCHAR( 255 ) NOT NULL ,
+metaval lONGTEXT NOT NULL ,
+metatype VARCHAR( 255 ) NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;';
+    pwg_query($q);
+	
+	$q = '
+INSERT INTO ' . $prefixeTable . 'meta(id,metaname,metaval,metatype)VALUES (1,"author","","name");';
+    pwg_query($q);
+	
+	$q = '
+INSERT INTO ' . $prefixeTable . 'meta(id,metaname,metaval,metatype)VALUES (2,"keywords","","name");';
+    pwg_query($q);
+	
+	$q = '
+INSERT INTO ' . $prefixeTable . 'meta(id,metaname,metaval,metatype)VALUES (3,"Description","","name");';
+    pwg_query($q);
+	
+		$q = '
+INSERT INTO ' . $prefixeTable . 'meta(id,metaname,metaval,metatype)VALUES (4,"robots","follow","name");';
+    pwg_query($q);
+
+	$q = '
+ALTER TABLE '. CATEGORIES_TABLE.' ADD COLUMN `metaKeywords` VARCHAR( 255 )';	
+    pwg_query($q);
+	
+}
+
+function plugin_uninstall()
+{
+    global $prefixeTable;
+
+	$q = 'DROP TABLE ' . $prefixeTable . 'meta;';
+    pwg_query($q);
+
+	$q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="meta" LIMIT 1;';
+    pwg_query($q);
+	
+	$q = ' ALTER TABLE '. CATEGORIES_TABLE .' DROP COLUMN `metaKeywords`';
+	pwg_query( $q );
+}
+
+
+?>
