Index: extensions/meta/main.inc.php
===================================================================
--- extensions/meta/main.inc.php	(revision 7469)
+++ extensions/meta/main.inc.php	(revision 7518)
@@ -29,62 +29,76 @@
 
 //Gestion des meta dans le header
-add_event_handler('loc_begin_page_header', 'add_meta' );
+add_event_handler('loc_begin_page_header', 'add_meta',56 );
+add_event_handler('loc_begin_page_header', 'add_metacat',61 );
+add_event_handler('loc_begin_page_header', 'add_metaimg',71 );
+add_event_handler('loc_after_page_header', 'set_meta_back',81);
+
 function add_meta()
 {
-  global $template, $page, $meta_infos;
+		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');
+	$meta_infos['comment'] = $template->get_template_vars('COMMENT_IMG');
 
+	$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'].'">');
+	}
+
+ }
+function add_metacat()
+{
+	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');
+  $meta_infos['comment'] = $template->get_template_vars('COMMENT_IMG');
+  
 
-  $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
+	//meta categories
   if ( !empty($page['category']['id']) )   
   {
-
     $query = '
     select id,metaKeycat
@@ -111,10 +125,15 @@
 	  $template->clear_assign('INFO_FILE');
     }
-	
-	
-	
   }
+}
 
-
+function add_metaimg()
+{
+	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');
+  $meta_infos['comment'] = $template->get_template_vars('COMMENT_IMG');
   //meta images
   if ( !empty($page['image_id']) )   
@@ -148,13 +167,16 @@
 }
 
-add_event_handler('loc_after_page_header', 'set_meta_back');
+
 function set_meta_back()
 {
   global $template, $meta_infos;
   
-  $template->assign(array(
+  $template->assign
+  (array
+	(
     'INFO_AUTHOR'  => $meta_infos['author'],
     'related_tags' => $meta_infos['related_tags'],
-    'INFO_FILE'    => $meta_infos['info']
+    'INFO_FILE'    => $meta_infos['info'],
+	'COMMENT_IMG'  => $meta_infos['comment']
     )
   );
