Index: /extensions/Comments_on_Albums/admin.php
===================================================================
--- /extensions/Comments_on_Albums/admin.php	(revision 11266)
+++ /extensions/Comments_on_Albums/admin.php	(revision 11267)
@@ -6,22 +6,43 @@
 
 // +-----------------------------------------------------------------------+
-//        Tabsheet
+//                         Save configuration                              |
 // +-----------------------------------------------------------------------+
-include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
-$page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'config';
+if (isset($_POST['config_submit'])) 
+{
+  $conf['comments_on_albums'] = array(
+    'icon_color' => $_POST['icon_color'],
+    'icon_color_over' => $_POST['icon_color_over'],
+    );
   
-$tabsheet = new tabsheet();
-$tabsheet->add('config', l10n('Configuration'), COA_ADMIN . '-config');   // Configuration
-$tabsheet->select($page['tab']);
-$tabsheet->assign();
+  conf_update_param('comments_on_albums', serialize($conf['comments_on_albums']));
+  array_push($page['infos'], l10n('Information data registered in database'));
+}  
+
 
 // +-----------------------------------------------------------------------+
-//        Template
+//                               Template                                  |
 // +-----------------------------------------------------------------------+
-$template->assign(array(
-  'COA_PATH' => COA_PATH,
-  'COA_ADMIN' => COA_ADMIN,
-));
 
-include(COA_PATH.'admin/' . $page['tab'] . '.php');
+// available icons
+$dh = opendir(COA_PATH . 'template/s26');
+while (($file = readdir($dh)) !== false ) 
+{
+  if ($file !== '.' AND $file !== '..' AND in_array(strtolower(get_extension($file)), array('jpg', 'png', 'gif'))) 
+  {
+    $template->append('COLORS', $file);
+  }
+}
+closedir($dh);
+  
+$template->assign(
+  array(
+    'COA_PATH' => COA_PATH,
+    'ICON_COLOR' => $conf['comments_on_albums']['icon_color'],
+    'ICON_COLOR_OVER' => $conf['comments_on_albums']['icon_color_over'],
+    )
+  );
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
 ?>
Index: /extensions/Comments_on_Albums/include/coa_admin_comments.php
===================================================================
--- /extensions/Comments_on_Albums/include/coa_admin_comments.php	(revision 11266)
+++ /extensions/Comments_on_Albums/include/coa_admin_comments.php	(revision 11267)
@@ -3,8 +3,9 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
+global $template, $conf;
 load_language('plugin.lang', COA_PATH);
 
 // +-----------------------------------------------------------------------+
-//        Tabsheet
+// |                               tabsheet                                |
 // +-----------------------------------------------------------------------+
 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
@@ -14,26 +15,30 @@
     'code' => 'pictures',
     'label' => l10n('COA_comments_photos'),
-  ),
+    ),
   array(
     'code' => 'albums',
     'label' => l10n('COA_comments_albums'),
-  ),
-);
+    ),
+  );
 
 $tab_codes = array_map(create_function('$a', 'return $a["code"];'), $tabs);
 
-if (isset($_GET['section']) and in_array($_GET['section'], $tab_codes)) {
+if (isset($_GET['section']) and in_array($_GET['section'], $tab_codes)) 
+{
   $page['tab'] = $_GET['section'];
-} else {
+} 
+else 
+{
   $page['tab'] = $tabs[0]['code'];
 }
 
 $tabsheet = new tabsheet();
-foreach ($tabs as $tab) {
+foreach ($tabs as $tab) 
+{
   $tabsheet->add(
     $tab['code'],
     $tab['label'],
     get_root_url().'admin.php?page=comments&amp;section='.$tab['code']
-  );
+    );
 }
 $tabsheet->select($page['tab']);
@@ -41,38 +46,60 @@
 
 
-if ($page['tab'] == 'albums') {
+if ($page['tab'] == 'albums') 
+{
+  // clear template sended by original page
   $template->clear_assign(array('ADMIN_CONTENT', 'comments', 'LIST', 'F_ACTION'));
 
   // +-----------------------------------------------------------------------+
-  //        Actions
+  // |                                actions                                |
   // +-----------------------------------------------------------------------+
-  if (!empty($_POST)) {
-    if (!empty($_POST['comments'])) {
+  if (!empty($_POST)) 
+  {
+    if (empty($_POST['comments']))
+    {
+      array_push(
+        $page['errors'],
+        l10n('Select at least one comment')
+        );
+    }
+    else
+    {
       check_input_parameter('comments', $_POST, true, PATTERN_ID);
 
-      if (isset($_POST['validate_albums'])) {
-        $query = 'UPDATE '.COA_TABLE.' SET 
-            validated = \'true\',
-            validation_date = NOW()
-          WHERE id IN ('.implode(',', $_POST['comments']).')
-        ;';
+      if (isset($_POST['validate_albums'])) 
+      {
+        $query = '
+UPDATE '.COA_TABLE.' 
+  SET validated = \'true\',
+      validation_date = NOW()
+  WHERE id IN ('.implode(',', $_POST['comments']).')
+;';
         pwg_query($query);
 
-        array_push($page['infos'], l10n_dec(
-          '%d user comment validated', '%d user comments validated',
-          count($_POST['comments'])
-        ));
+        array_push(
+          $page['infos'], 
+          l10n_dec(
+            '%d user comment validated', '%d user comments validated',
+            count($_POST['comments'])
+            )
+          );
       }
 
-      if (isset($_POST['reject_albums'])) {
-        $query = 'DELETE FROM '.COA_TABLE.'
-          WHERE id IN ('.implode(',', $_POST['comments']).')
-        ;';
+      if (isset($_POST['reject_albums'])) 
+      {
+        $query = '
+DELETE 
+  FROM '.COA_TABLE.'
+  WHERE id IN ('.implode(',', $_POST['comments']).')
+;';
         pwg_query($query);
 
-        array_push($page['infos'], l10n_dec(
-          '%d user comment rejected', '%d user comments rejected',
-          count($_POST['comments'])
-        ));
+        array_push(
+          $page['infos'], 
+          l10n_dec(
+            '%d user comment rejected', '%d user comments rejected',
+            count($_POST['comments'])
+            )
+          );
       }
     }
@@ -80,61 +107,80 @@
 
   // +-----------------------------------------------------------------------+
-  //        Infos (re-assignation needed)
+  // |                             template init                             |
   // +-----------------------------------------------------------------------+
-  if (count($page['infos']) != 0) {
+
+  $template->set_filename('comments', dirname(__FILE__) .'/../template/admin_comments.tpl');
+
+  $template->assign(
+    array(
+      'F_ACTION' => get_root_url().'admin.php?page=comments&amp;section=albums'
+      )
+    );
+    
+  if (count($page['infos']) != 0) 
+  {
     $template->assign('infos', $page['infos']);
   }
 
   // +-----------------------------------------------------------------------+
-  //        Comments display
+  // |                           comments display                            |
   // +-----------------------------------------------------------------------+
   $list = array();
 
-  $query = 'SELECT 
-      com.id, 
-      com.category_id, 
-      com.date, 
-      com.author,
-      '.$conf['user_fields']['username'].' AS username, 
-      com.content, 
-      cat.name
-    FROM '.COA_TABLE.' AS com
+  $query = '
+SELECT 
+    com.id, 
+    com.category_id, 
+    com.date, 
+    com.author,
+    '.$conf['user_fields']['username'].' AS username, 
+    com.content, 
+    cat.name
+  FROM '.COA_TABLE.' AS com
     INNER JOIN '.CATEGORIES_TABLE.' AS cat
-    ON cat.id = com.category_id
+      ON cat.id = com.category_id
     LEFT JOIN '.USERS_TABLE.' AS u
-    ON u.'.$conf['user_fields']['id'].' = com.author_id
-    WHERE validated = \'false\'
-    ORDER BY com.date DESC
-  ;';
+      ON u.'.$conf['user_fields']['id'].' = com.author_id
+  WHERE validated = \'false\'
+  ORDER BY com.date DESC
+;';
   $result = pwg_query($query);
 
-  while ($row = pwg_db_fetch_assoc($result)) {
+  while ($row = pwg_db_fetch_assoc($result)) 
+  {
     // author
-    if (empty($row['author_id'])) {
+    if (empty($row['author_id'])) 
+    {
       $author_name = $row['author'];
-    } else {
+    } 
+    else 
+    {
       $author_name = stripslashes($row['username']);
     }
     
     // comment content
-    $template->append('comments', array(
-      'CAT_URL' => PHPWG_ROOT_PATH.'admin.php?page=cat_modify&amp;cat_id='.$row['category_id'],
-      'CAT_NAME' => $row['name'],
-      'ID' => $row['id'],
-      'AUTHOR' => trigger_event('render_comment_author', $author_name),
-      'DATE' => format_date($row['date'], true),
-      'CONTENT' => trigger_event('render_comment_content',$row['content']),
-    ));
+    $template->append(
+      'comments', 
+      array(
+        'CAT_URL' => PHPWG_ROOT_PATH.'admin.php?page=cat_modify&amp;cat_id='.$row['category_id'],
+        'CAT_NAME' => $row['name'],
+        'ID' => $row['id'],
+        'AUTHOR' => trigger_event('render_comment_author', $author_name),
+        'DATE' => format_date($row['date'], true),
+        'CONTENT' => trigger_event('render_comment_content',$row['content']),
+        )
+      );
 
     array_push($list, $row['id']);
   }
 
-  // template
-  $template->set_filename('comments', dirname(__FILE__) .'/../template/coa_admin_comments.tpl');
-  $template->assign(array(
-    'F_ACTION' => get_root_url().'admin.php?page=comments&amp;section=albums',
-    'LIST' => implode(',', $list),
-  ));
+  $template->assign('LIST', implode(',', $list));
+
+  // +-----------------------------------------------------------------------+
+  // |                           sending html code                           |
+  // +-----------------------------------------------------------------------+
+
   $template->assign_var_from_handle('ADMIN_CONTENT', 'comments');
+
 }
 
Index: /extensions/Comments_on_Albums/include/coa_admin_intro.php
===================================================================
--- /extensions/Comments_on_Albums/include/coa_admin_intro.php	(revision 11266)
+++ /extensions/Comments_on_Albums/include/coa_admin_intro.php	(revision 11267)
@@ -2,4 +2,6 @@
 /* adds info about comments count on main admin page, uses javascript */
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $template;
 
 // comments count
@@ -10,5 +12,8 @@
 list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
 
-$template->assign('DB_COMMENTS_ALBUMS', l10n_dec('%d comment', '%d comments', $nb_comments));
+$template->assign(
+  'DB_COMMENTS_ALBUMS', 
+  l10n_dec('%d comment', '%d comments', $nb_comments)
+  );
 
 // unvalidated comments
@@ -20,14 +25,35 @@
 list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
 
-if ($nb_comments > 0) {
-  $template->assign('unvalidated_albums', array(
-    'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments&amp;section=albums',
-    'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments)
-  ));
+if ($nb_comments > 0) 
+{
+  $template->assign(
+    'unvalidated_albums', 
+    array(
+      'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments&amp;section=albums',
+      'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments)
+      )
+    );
 }
 
-// template
-$template->set_filename('comments_on_albums', dirname(__FILE__) .'/../template/coa_admin_intro.tpl');
-$template->concat('ADMIN_CONTENT', $template->parse('comments_on_albums', true));
+$template->set_prefilter('intro', 'coa_admin_intro_prefilter');
+
+function coa_admin_intro_prefilter($content, &$smarty)
+{
+  $search = '(<a href="{$unvalidated.URL}">{$unvalidated.INFO}</a>)';
+        
+  $replace = $search.'
+        {/if}
+        [{\'Photos\'|@translate}]
+      </li>
+      <li>
+        {$DB_COMMENTS_ALBUMS}
+        {if isset($unvalidated_albums)}
+        (<a href="{$unvalidated_albums.URL}">{$unvalidated_albums.INFO}</a>)
+        {/if}
+        [{\'Albums\'|@translate}]
+      {if true}';
+
+  return str_replace($search, $replace, $content);
+}
 
 ?>
Index: /extensions/Comments_on_Albums/include/coa_albums.php
===================================================================
--- /extensions/Comments_on_Albums/include/coa_albums.php	(revision 11266)
+++ /extensions/Comments_on_Albums/include/coa_albums.php	(revision 11267)
@@ -4,5 +4,5 @@
 
 // +-----------------------------------------------------------------------+
-//        Category's infos
+// |                            category infos                             |
 // +-----------------------------------------------------------------------+
 $category = $page['category'];
@@ -10,25 +10,33 @@
 $url_self = duplicate_index_url(array(
   'category' => array(
-    'id'=>$category['id'], 
-    'name'=>$category['name'], 
-    'permalink'=>$category['permalink']
-  ), 
+    'id' => $category['id'], 
+    'name' => $category['name'], 
+    'permalink' => $category['permalink']
+    ), 
   array('start')
-));
-
-
-// +-----------------------------------------------------------------------+
-//        Actions
-// +-----------------------------------------------------------------------+
-if (isset($_GET['action'])) {
-  switch ($_GET['action']) {
-    case 'edit_comment' : {
+  ));
+
+
+// +-----------------------------------------------------------------------+
+// |                                actions                                |
+// +-----------------------------------------------------------------------+
+if (isset($_GET['action'])) 
+{
+  switch ($_GET['action']) 
+  {
+    case 'edit_comment' : 
+    {
       check_pwg_token();
+      
       include_once(COA_PATH.'include/functions_comment.inc.php'); // custom fonctions
+      
       check_input_parameter('comment_to_edit', $_GET, false, PATTERN_ID);
+      
       $author_id = get_comment_author_id_albums($_GET['comment_to_edit']);
 
-      if (can_manage_comment('edit', $author_id)) {
-        if (!empty($_POST['content'])) {
+      if (can_manage_comment('edit', $author_id)) 
+      {
+        if (!empty($_POST['content'])) 
+        {
           $comment_action = update_user_comment_albums(
             array(
@@ -36,7 +44,7 @@
               'image_id' => $category['id'],
               'content' => $_POST['content']
-            ),
+              ),
             $_POST['key']
-          );
+            );
           
           $infos = array();
@@ -58,11 +66,13 @@
 
           $template->assign(
-            ($comment_action=='reject') ? 'errors' : 'infos',
-            $infos
-          );
+              ($comment_action=='reject') ? 'errors' : 'infos',
+              $infos
+            );
 
           unset($_POST['content']);
           break;
-        } else {
+        } 
+        else 
+        {
           $edit_comment = $_GET['comment_to_edit'];
           break;
@@ -70,11 +80,16 @@
       }
     }
-    case 'delete_comment' : {
+    case 'delete_comment' : 
+    {
       check_pwg_token();
+      
       include_once(COA_PATH.'include/functions_comment.inc.php');
+      
       check_input_parameter('comment_to_delete', $_GET, false, PATTERN_ID);
+      
       $author_id = get_comment_author_id_albums($_GET['comment_to_delete']);
 
-      if (can_manage_comment('delete', $author_id)) {
+      if (can_manage_comment('delete', $author_id)) 
+      {
         delete_user_comment_albums($_GET['comment_to_delete']);
       }
@@ -82,11 +97,16 @@
       redirect($url_self);
     }
-    case 'validate_comment' : {
+    case 'validate_comment' : 
+    {
       check_pwg_token();
+      
       include_once(COA_PATH.'include/functions_comment.inc.php');
+      
       check_input_parameter('comment_to_validate', $_GET, false, PATTERN_ID);
+      
       $author_id = get_comment_author_id_albums($_GET['comment_to_validate']);
 
-      if (can_manage_comment('validate', $author_id)) {
+      if (can_manage_comment('validate', $author_id)) 
+      {
         validate_user_comment_albums($_GET['comment_to_validate']);
       }
@@ -97,10 +117,11 @@
 }
 
-
-// +-----------------------------------------------------------------------+
-//        Insert comment
-// +-----------------------------------------------------------------------+
-if ($category['commentable'] and isset($_POST['content'])) {
-  if (is_a_guest() and !$conf['comments_forall']) {
+// +-----------------------------------------------------------------------+
+// |                            insert comment                             |
+// +-----------------------------------------------------------------------+
+if ($category['commentable'] and isset($_POST['content'])) 
+{
+  if (is_a_guest() and !$conf['comments_forall']) 
+  {
     die('Session expired');
   }
@@ -113,7 +134,9 @@
 
   include_once(COA_PATH.'include/functions_comment.inc.php');
+  
   $comment_action = insert_user_comment_albums($comm, @$_POST['key'], $infos);
 
-  switch ($comment_action) {
+  switch ($comment_action) 
+  {
     case 'moderate':
       array_push($infos, l10n('An administrator must authorize your comment before it is visible.'));
@@ -129,8 +152,17 @@
   }
 
-  $template->assign(($comment_action=='reject') ? 'errors' : 'infos', $infos);
-  trigger_action('user_comment_insertion', array_merge($comm, array('action'=>$comment_action)));
-  
-} elseif (isset($_POST['content'])) {
+  $template->assign(
+      ($comment_action=='reject') ? 'errors' : 'infos',
+      $infos
+    );
+    
+  // allow plugins to notify what's going on
+  trigger_action( 'user_comment_insertion',
+      array_merge($comm, array('action'=>$comment_action) )
+    );
+  
+} 
+else if (isset($_POST['content'])) 
+{
   set_status_header(403);
   die('ugly spammer');
@@ -139,25 +171,34 @@
 
 // +-----------------------------------------------------------------------+
-//        Display comments
-// +-----------------------------------------------------------------------+
-if ($category['commentable']) {
-  if (!is_admin()) {
+// |                           display comments                            |
+// +-----------------------------------------------------------------------+
+if ($category['commentable']) 
+{
+  if (!is_admin()) 
+  {
     $validated_clause = " AND validated = 'true'";
-  } else {
+  } 
+  else 
+  {
     $validated_clause = null;
   }
 
   // number of comments for this category
-  $query = 'SELECT COUNT(*) AS nb_comments
-    FROM '.COA_TABLE.'
-    WHERE category_id = '.$category['id']
-    .$validated_clause.'
-  ;';
+  $query = '
+SELECT 
+    COUNT(*) AS nb_comments
+  FROM '.COA_TABLE.'
+  WHERE category_id = '.$category['id']
+  .$validated_clause.'
+;';
   $row = pwg_db_fetch_assoc(pwg_query($query));
 
   // navigation bar creation, custom again
-  if (isset($_GET['start_comments'])) {
+  if (isset($_GET['start_comments'])) 
+  {
     $page['start_comments'] = $_GET['start_comments'];
-  } else {
+  } 
+  else 
+  {
     $page['start_comments'] = 0;
   }
@@ -169,40 +210,49 @@
     $page['start_comments'],
     $conf['nb_comment_page']
-  );
-
-  $template->assign(array(
-    'COMMENT_COUNT' => $row['nb_comments'],
-    'comment_navbar' => $navigation_bar,
-  ));
-
-  if ($row['nb_comments'] > 0) {
+    );
+
+  $template->assign(
+    array(
+      'COMMENT_COUNT' => $row['nb_comments'],
+      'comment_navbar' => $navigation_bar,
+      )
+    );
+
+  if ($row['nb_comments'] > 0) 
+  {
     // get comments
-    $query = 'SELECT
-        com.id,
-        com.author,
-        com.author_id,
-        '.$conf['user_fields']['username'].' AS username,
-        com.date,
-        com.category_id,
-        com.content,
-        com.validated
-      FROM '.COA_TABLE.' AS com
-      LEFT JOIN '.USERS_TABLE.' AS u
-      ON u.'.$conf['user_fields']['id'].' = author_id
-      WHERE category_id = '.$category['id'].'
-      '.$validated_clause.'
-      ORDER BY date ASC
-      LIMIT '.$conf['nb_comment_page'].' OFFSET '.$page['start_comments'].'
-    ;';
+    $query = '
+SELECT
+    com.id,
+    com.author,
+    com.author_id,
+    '.$conf['user_fields']['username'].' AS username,
+    com.date,
+    com.category_id,
+    com.content,
+    com.validated
+  FROM '.COA_TABLE.' AS com
+  LEFT JOIN '.USERS_TABLE.' AS u
+    ON u.'.$conf['user_fields']['id'].' = author_id
+  WHERE category_id = '.$category['id'].'
+    '.$validated_clause.'
+  ORDER BY date ASC
+  LIMIT '.$conf['nb_comment_page'].' OFFSET '.$page['start_comments'].'
+;';
     $result = pwg_query($query);
 
-    while ($row = pwg_db_fetch_assoc($result)) {
+    while ($row = pwg_db_fetch_assoc($result)) 
+    {
       // author
-      if (!empty($row['author'])) {
+      if (!empty($row['author'])) 
+      {
         $author = $row['author'];
-        if ($author == 'guest') {
+        if ($author == 'guest') 
+        {
           $author = l10n('guest');
         }
-      } else {
+      } 
+      else 
+      {
         $author = stripslashes($row['username']);
       }
@@ -214,21 +264,30 @@
         'DATE' => format_date($row['date'], true),
         'CONTENT' => trigger_event('render_comment_content', $row['content']),
-      );
+        );
       
       // rights
-      if (can_manage_comment('delete', $row['author_id'])) {
-        $tpl_comment['U_DELETE'] = add_url_params($url_self, array(
-          'action' => 'delete_comment',
-          'comment_to_delete' => $row['id'],
-          'pwg_token' => get_pwg_token(),
-        ));
-      }
-      if (can_manage_comment('edit', $row['author_id'])) {
-        $tpl_comment['U_EDIT'] = add_url_params($url_self, array(
-          'action' => 'edit_comment',
-          'comment_to_edit' => $row['id'],
-          'pwg_token' => get_pwg_token(),
-        ));
-        if (isset($edit_comment) and ($row['id'] == $edit_comment)) {
+      if (can_manage_comment('delete', $row['author_id'])) 
+      {
+        $tpl_comment['U_DELETE'] = add_url_params(
+          $url_self, 
+          array(
+            'action' => 'delete_comment',
+            'comment_to_delete' => $row['id'],
+            'pwg_token' => get_pwg_token(),
+            )
+          );
+      }
+      if (can_manage_comment('edit', $row['author_id'])) 
+      {
+        $tpl_comment['U_EDIT'] = add_url_params(
+          $url_self, 
+          array(
+            'action' => 'edit_comment',
+            'comment_to_edit' => $row['id'],
+            'pwg_token' => get_pwg_token(),
+            )
+          );
+        if (isset($edit_comment) and ($row['id'] == $edit_comment)) 
+        {
           $key = get_ephemeral_key(2, $category['id']);
           $tpl_comment['IN_EDIT'] = true;
@@ -237,13 +296,16 @@
         }
       }
-      if (is_admin() AND $row['validated'] != 'true') {
-        $tpl_comment['U_VALIDATE'] = add_url_params($url_self, array(
-          'action' => 'validate_comment',
-          'comment_to_validate' => $row['id'],
-          'pwg_token' => get_pwg_token(),
-        ));
-      }
-      
-      // template
+      if (is_admin() AND $row['validated'] != 'true') 
+      {
+        $tpl_comment['U_VALIDATE'] = add_url_params(
+          $url_self, 
+          array(
+            'action' => 'validate_comment',
+            'comment_to_validate' => $row['id'],
+            'pwg_token' => get_pwg_token(),
+            )
+          );
+      }
+      
       $template->append('comments', $tpl_comment);
     }
@@ -252,36 +314,74 @@
   // comment form
   $show_add_comment_form = true;
-  if (isset($edit_comment)) {
+  if (isset($edit_comment)) 
+  {
     $show_add_comment_form = false;
   }
-  if (is_a_guest() and !$conf['comments_forall']) {
+  if (is_a_guest() and !$conf['comments_forall']) 
+  {
     $show_add_comment_form = false;
   }
 
-  if ($show_add_comment_form) {
+  if ($show_add_comment_form) 
+  {
     $key = get_ephemeral_key(3, $category['id']);
     $content = null;
-    if ('reject'===@$comment_action) {
+    if ('reject'===@$comment_action) 
+    {
       $content = htmlspecialchars(stripslashes($comm['content']));
     }
-    $template->assign('comment_add', array(
-      'F_ACTION' => $url_self,
-      'KEY' => $key,
-      'CONTENT' => $content,
-      'SHOW_AUTHOR' => !is_classic_user(),
-    ));
+    $template->assign(
+      'comment_add', 
+      array(
+        'F_ACTION' => $url_self,
+        'KEY' => $key,
+        'CONTENT' => $content,
+        'SHOW_AUTHOR' => !is_classic_user(),
+        )
+      );
   }
   
   // template
-  $template->assign(array(
-    'COA_PATH' => COA_PATH, // for css
-    'COA_ABSOLUTE_PATH' => dirname(__FILE__) .'/../', // for template
-  ));
-  
-  $template->set_filename('comments_on_albums', dirname(__FILE__) .'/../template/coa_albums.tpl');
+  $template->assign(
+    array(
+      'COA_PATH' => COA_PATH, // for css
+      'COA_ABSOLUTE_PATH' => dirname(__FILE__) .'/../', // for template
+      )
+    );
+  
+  $template->set_filename('comments_on_albums', dirname(__FILE__) .'/../template/albums.tpl');
   $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('comments_on_albums', true));
   
-  $template->set_filename('comments_on_albums_messages', dirname(__FILE__) .'/../template/coa_messages.tpl');
-  $template->concat('PLUGIN_INDEX_CONTENT_BEFORE', $template->parse('comments_on_albums_messages', true));
+  if (isset($infos))
+  {
+    $template->set_prefilter('index', 'coa_messages');
+    
+    function coa_messages($content, &$smarty) 
+    {
+      $search = '{if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if}';
+
+  $replacement = $search.'
+{if isset($errors)}
+<div class="errors">
+  <ul>
+    {foreach from=$errors item=error}
+    <li>{$error}</li>
+    {/foreach}
+  </ul>
+</div>
+{/if}
+{if isset($infos)}
+<div class="infos">
+  <ul>
+    {foreach from=$infos item=info}
+    <li>{$info}</li>
+    {/foreach}
+  </ul>
+</div>
+{/if}';
+
+      return str_replace($search, $replacement, $content);
+    }
+  }
 }
 
Index: /extensions/Comments_on_Albums/include/coa_comments_page.php
===================================================================
--- /extensions/Comments_on_Albums/include/coa_comments_page.php	(revision 11266)
+++ /extensions/Comments_on_Albums/include/coa_comments_page.php	(revision 11267)
@@ -1,4 +1,4 @@
 <?php 
-/* inspired by include/comments.php */
+/* inspired by comments.php */
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
@@ -6,19 +6,24 @@
 $conf['comments_on_albums'] = unserialize($conf['comments_on_albums']);
 
-$template->assign(array(
-  'COA_PATH' => COA_PATH,
-  'ICON_COLOR' => $conf['comments_on_albums']['icon_color'],
-  'ICON_COLOR_OVER' => $conf['comments_on_albums']['icon_color_over'],
-));
+$template->assign(
+  array(
+    'COA_PATH' => COA_PATH,
+    'ICON_COLOR' => $conf['comments_on_albums']['icon_color'],
+    'ICON_COLOR_OVER' => $conf['comments_on_albums']['icon_color_over'],
+    )
+  );
 
 
 // +-----------------------------------------------------------------------+
-//        Main page (comments on photos)
+// |                             main page                                 |
 // +-----------------------------------------------------------------------+
 
-if (!isset($_GET['display_mode'])) {  
+if (!isset($_GET['display_mode'])) 
+{  
   // adds a button for switch page
   $template->set_prefilter('comments', 'coa_add_button');
-  function coa_add_button($content, &$smarty) {
+  
+  function coa_add_button($content, &$smarty) 
+  {
     $search = '<ul class="categoryActions">';
 
@@ -37,5 +42,5 @@
 {/html_head}
 
-  <ul class="categoryActions">
+  '.$search.'
     <li><a href="comments.php?display_mode=albums" title="' . l10n('COA_comments_albums') . '" class="pwg-state-default pwg-button">
       <span class="pwg-icon pwg-icon-comments-albums">&nbsp;</span><span class="pwg-button-text">' . l10n('COA_comments_albums') . '</span>
@@ -47,8 +52,10 @@
   
 // +-----------------------------------------------------------------------+
-//        Second page (comments on albums)
+//                        comments on albums page                          |
 // +-----------------------------------------------------------------------+
 
-} else if ($_GET['display_mode'] == 'albums') {
+} 
+else if ($_GET['display_mode'] == 'albums') 
+{
   // reset some template vars
   $template->clear_assign(array('comments', 'navbar', 'sort_by_options'));
@@ -58,5 +65,5 @@
     'date' => l10n('comment date'),
     'category_id' => l10n('album')
-  );
+    );
   $template->assign('sort_by_options', $sort_by);
 
@@ -68,6 +75,8 @@
 
   $actions = array('delete_albums', 'validate_albums', 'edit_albums'); // different indexes to not interfer with the main process
-  foreach ($actions as $loop_action) {
-    if (isset($_GET[$loop_action])) {
+  foreach ($actions as $loop_action) 
+  {
+    if (isset($_GET[$loop_action])) 
+    {
       $action = $loop_action;
       check_input_parameter($action, $_GET, false, PATTERN_ID);
@@ -77,36 +86,55 @@
   }
 
-  if (isset($action)) {
+  if (isset($action)) 
+  {
     include_once(COA_PATH.'include/functions_comment.inc.php');
+    
     check_pwg_token();
+    
     $comment_author_id = get_comment_author_id_albums($comment_id);
+    
     $true_action = str_replace('_albums', null, $action); // but we must check true action names
 
-    if (can_manage_comment($true_action, $comment_author_id)) {
+    if (can_manage_comment($true_action, $comment_author_id)) 
+    {
       $perform_redirect = false;
 
-      if ('delete_albums' == $action) {
+      if ('delete_albums' == $action) 
+      {
         delete_user_comment_albums($comment_id);
         $perform_redirect = true;
       }
-      if ('validate_albums' == $action) {
+      if ('validate_albums' == $action) 
+      {
         validate_user_comment_albums($comment_id);
         $perform_redirect = true;
       }
-      if ('edit_albums' == $action) {
-        if (!empty($_POST['content'])) {
-          update_user_comment_albums(array(
-            'comment_id' => $_GET['edit_albums'],
-            'image_id' => $_POST['image_id'],
-            'content' => $_POST['content']
-            ), $_POST['key']
-          );
-          $perform_redirect = true;
-        } else {
+      if ('edit_albums' == $action) 
+      {
+        if (!empty($_POST['content'])) 
+        {
+          update_user_comment_albums(
+            array(
+              'comment_id' => $_GET['edit_albums'],
+              'image_id' => $_POST['image_id'],
+              'content' => $_POST['content']
+              ), 
+            $_POST['key']
+            );
+          //$perform_redirect = true;
+          $edit_comment = null;
+        } 
+        else 
+        {
           $edit_comment = $_GET['edit_albums'];
         }
       }
-      if ($perform_redirect) {
-        $redirect_url = PHPWG_ROOT_PATH.'comments.php'.get_query_string_diff(array('delete_albums','validate_albums','edit_albums','pwg_token'));
+      if ($perform_redirect) 
+      {
+        $redirect_url = 
+          PHPWG_ROOT_PATH
+          .'comments.php'
+          .get_query_string_diff(array('delete_albums','validate_albums','edit_albums','pwg_token'));
+        
         redirect($redirect_url);
       }
@@ -117,21 +145,36 @@
   // |                            navigation bar                             |
   // +-----------------------------------------------------------------------+
-  if (isset($_GET['start']) and is_numeric($_GET['start'])) {
+  if (isset($_GET['start']) and is_numeric($_GET['start'])) 
+  {
     $start = $_GET['start'];
-  } else {
+  } 
+  else 
+  {
     $start = 0;
   }
 
-  $query = 'SELECT COUNT(DISTINCT(com.id))
-    FROM '.COA_TABLE.' AS com
-    LEFT JOIN '.USERS_TABLE.' As u
+  $query = '
+SELECT 
+    COUNT(DISTINCT(com.id))
+  FROM '.COA_TABLE.' AS com
+  LEFT JOIN '.USERS_TABLE.' As u
     ON u.'.$conf['user_fields']['id'].' = com.author_id
-    WHERE '.implode('
+  WHERE '.implode('
     AND ', $page['where_clauses']).'
-  ;';
+;';
   list($counter) = pwg_db_fetch_row(pwg_query($query));
 
-  $url = PHPWG_ROOT_PATH . 'comments.php' . get_query_string_diff(array('start','delete_albums','validate_albums','edit_albums','pwg_token'));
-  $navbar = create_navigation_bar($url, $counter, $start, $page['items_number'], '');
+  $url = 
+    PHPWG_ROOT_PATH
+    .'comments.php'
+    .get_query_string_diff(array('start','delete_albums','validate_albums','edit_albums','pwg_token'));
+    
+  $navbar = create_navigation_bar(
+    $url, 
+    $counter, 
+    $start, 
+    $page['items_number'], 
+    ''
+    );
   $template->assign('navbar', $navbar);
 
@@ -143,69 +186,81 @@
   $category_ids = array();
 
-  $query = 'SELECT
-      com.id AS comment_id,
-      com.category_id,
-      com.author,
-      com.author_id,
-      '.$conf['user_fields']['username'].' AS username,
-      com.date,
-      com.content,
-      com.validated
-    FROM '.COA_TABLE.' AS com
-    LEFT JOIN '.USERS_TABLE.' As u
+  $query = '
+SELECT
+    com.id AS comment_id,
+    com.category_id,
+    com.author,
+    com.author_id,
+    '.$conf['user_fields']['username'].' AS username,
+    com.date,
+    com.content,
+    com.validated
+  FROM '.COA_TABLE.' AS com
+  LEFT JOIN '.USERS_TABLE.' As u
     ON u.'.$conf['user_fields']['id'].' = com.author_id
-    WHERE '.implode('
+  WHERE '.implode('
     AND ', $page['where_clauses']).'
-    GROUP BY
-      comment_id,
-      com.category_id,
-      com.author,
-      com.author_id,
-      com.date,
-      com.content,
-      com.validated
-    ORDER BY '.$page['sort_by'].' '.$page['sort_order'];
-    if ('all' != $page['items_number']) {
-      $query.= '
-      LIMIT '.$page['items_number'].' OFFSET '.$start;
-    }
+  GROUP BY
+    comment_id,
+    com.category_id,
+    com.author,
+    com.author_id,
+    com.date,
+    com.content,
+    com.validated
+  ORDER BY '.$page['sort_by'].' '.$page['sort_order'];
+  if ('all' != $page['items_number']) 
+  {
     $query.= '
-  ;';
+  LIMIT '.$page['items_number'].' OFFSET '.$start;
+  }
+  $query.= '
+;';
   $result = pwg_query($query);
 
-  while ($row = pwg_db_fetch_assoc($result)) {
+  while ($row = pwg_db_fetch_assoc($result)) 
+  {
     array_push($comments, $row);
     array_push($element_ids, $row['category_id']);
   }
 
-  if (count($comments) > 0) {
+  if (count($comments) > 0) 
+  {
     // retrieving category informations
-    $query = 'SELECT 
-        cat.id, 
-        cat.name, 
-        cat.permalink, 
-        cat.uppercats, 
-        com.id as comment_id
-      FROM '.CATEGORIES_TABLE.' AS cat
-      LEFT JOIN '.COA_TABLE.' AS com
-      ON cat.id=com.category_id
-      '.get_sql_condition_FandF(array(
-        'forbidden_categories' => 'cat.id',
-        'visible_categories' => 'cat.id'
-      ), 'WHERE').'
-      AND cat.id IN ('.implode(',', $element_ids).')
-    ;';
+    $query = '
+SELECT 
+    cat.id, 
+    cat.name, 
+    cat.permalink, 
+    cat.uppercats, 
+    com.id as comment_id
+  FROM '.CATEGORIES_TABLE.' AS cat
+  LEFT JOIN '.COA_TABLE.' AS com
+    ON cat.id=com.category_id
+  '.get_sql_condition_FandF(
+    array(
+      'forbidden_categories' => 'cat.id',
+      'visible_categories' => 'cat.id'
+      ), 
+    'WHERE'
+    ).'
+    AND cat.id IN ('.implode(',', $element_ids).')
+;';
     $categories = hash_from_query($query, 'comment_id');
 
-    foreach ($comments as $comment) {
+    foreach ($comments as $comment) 
+    {
       // category
       $name = $categories[$comment['comment_id']]['name'];
-      $url = duplicate_index_url(array(
-        'category' => array(
-          'id' => $categories[$comment['comment_id']]['id'], 
-          'name' => $categories[$comment['comment_id']]['name'], 
-          'permalink' => $categories[$comment['comment_id']]['permalink'],
-        ),array('start')
-      ));
+      $url = duplicate_index_url(
+        array(
+          'category' => array(
+            'id' => $categories[$comment['comment_id']]['id'], 
+            'name' => $categories[$comment['comment_id']]['name'], 
+            'permalink' => $categories[$comment['comment_id']]['permalink'],
+            ),
+          array('start')
+          )
+        );
       
       // comment content
@@ -217,24 +272,39 @@
         'DATE' => format_date($comment['date'], true),
         'CONTENT' => trigger_event('render_comment_content',$comment['content']),
-      );
+        );
 
       // rights
-      if (can_manage_comment('delete', $comment['author_id'])) {
-        $url = get_root_url().'comments.php'.get_query_string_diff(array('delete','validate','edit', 'pwg_token'));
-
-        $tpl_comment['U_DELETE'] = add_url_params($url, array(
-          'delete_albums' => $comment['comment_id'],
-          'pwg_token' => get_pwg_token(),
-        ));
-      }
-      if (can_manage_comment('edit', $comment['author_id'])) {
-        $url = get_root_url().'comments.php'.get_query_string_diff(array('edit', 'delete','validate', 'pwg_token'));
-
-        $tpl_comment['U_EDIT'] = add_url_params($url, array(
-          'edit_albums' => $comment['comment_id'],
-          'pwg_token' => get_pwg_token(),
-        ));
-
-        if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment)) {
+      if (can_manage_comment('delete', $comment['author_id'])) 
+      {
+        $url = 
+          get_root_url()
+          .'comments.php'
+          .get_query_string_diff(array('delete','validate','edit', 'pwg_token'));
+
+        $tpl_comment['U_DELETE'] = add_url_params(
+          $url, 
+          array(
+            'delete_albums' => $comment['comment_id'],
+            'pwg_token' => get_pwg_token(),
+            )
+          );
+      }
+      if (can_manage_comment('edit', $comment['author_id'])) 
+      {
+        $url = 
+          get_root_url()
+          .'comments.php'
+          .get_query_string_diff(array('edit', 'delete','validate', 'pwg_token'));
+
+        $tpl_comment['U_EDIT'] = add_url_params(
+          $url, 
+          array(
+            'edit_albums' => $comment['comment_id'],
+            'pwg_token' => get_pwg_token(),
+            )
+          );
+
+        if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment)) 
+        {
           $key = get_ephemeral_key(2, $comment['category_id']);
           $tpl_comment['IN_EDIT'] = true;
@@ -244,10 +314,15 @@
         }
       }
-      if (can_manage_comment('validate', $comment['author_id'])) {
-        if ('true' != $comment['validated']) {
-          $tpl_comment['U_VALIDATE'] = add_url_params($url, array(
-            'validate_albums'=> $comment['comment_id'],
-            'pwg_token' => get_pwg_token(),
-          ));
+      if (can_manage_comment('validate', $comment['author_id'])) 
+      {
+        if ('true' != $comment['validated']) 
+        {
+          $tpl_comment['U_VALIDATE'] = add_url_params(
+            $url, 
+            array(
+              'validate_albums'=> $comment['comment_id'],
+              'pwg_token' => get_pwg_token(),
+              )
+            );
         }
       }
@@ -258,17 +333,18 @@
 
   // +-----------------------------------------------------------------------+
-  // |                        template                                       |
-  // +-----------------------------------------------------------------------+
-  $template->set_filenames(array('comments'=> dirname(__FILE__).'/../template/coa_comments_page.tpl'));
-  
-  // add a layer for display category name
+  // |                            template                                   |
+  // +-----------------------------------------------------------------------+
+  $template->set_filenames(array('comments'=> dirname(__FILE__).'/../template/comments_page.tpl'));
+  
+  // add a line to display category name
   $template->set_prefilter('comments', 'coa_change_comments_list');
+  
   function coa_change_comments_list($content, &$smarty) {
     $search = '<div class="description"{if isset($comment.IN_EDIT)} style="height:200px"{/if}>';
 
-$replacement = '<div class="category-title">
+    $replacement = '<div class="category-title">
   <a href="{$comment.CAT_URL}">{$comment.CAT_NAME}</a>
 </div>
-<div class="description"{if isset($comment.IN_EDIT)} style="height:220px"{/if}>';
+'.$search;
 
     return str_replace($search, $replacement, $content);
Index: /extensions/Comments_on_Albums/include/functions_comment.inc.php
===================================================================
--- /extensions/Comments_on_Albums/include/functions_comment.inc.php	(revision 11266)
+++ /extensions/Comments_on_Albums/include/functions_comment.inc.php	(revision 11267)
@@ -3,5 +3,6 @@
 
 //returns string action to perform on a new comment: validate, moderate, reject
-if (!function_exists('user_comment_check')) {
+if (!function_exists('user_comment_check')) 
+{
   function user_comment_check($action, $comment)
   {
@@ -187,5 +188,6 @@
  * @param comment_id
  */
-function delete_user_comment_albums($comment_id) {
+function delete_user_comment_albums($comment_id) 
+{
   $user_where_clause = '';
   if (!is_admin())
@@ -300,5 +302,6 @@
 }
 
-if (!function_exists('email_admin')) {
+if (!function_exists('email_admin')) 
+{
   function email_admin($action, $comment)
   {
Index: /extensions/Comments_on_Albums/main.inc.php
===================================================================
--- /extensions/Comments_on_Albums/main.inc.php	(revision 11266)
+++ /extensions/Comments_on_Albums/main.inc.php	(revision 11267)
@@ -25,7 +25,8 @@
 //          Triggers
 // +-----------------------------------------------------------------------+
-add_event_handler('loc_end_index', 'COA_index');
+add_event_handler('loc_end_index', 'COA_albums');
 add_event_handler('loc_after_page_header', 'COA_comments_page');
-add_event_handler('loc_end_admin', 'COA_admin');
+add_event_handler('loc_begin_admin_page', 'COA_admin_intro');
+add_event_handler('loc_end_admin', 'COA_admin_comments');
 add_event_handler('get_admin_plugin_menu_links', 'COA_admin_menu');
 
@@ -35,13 +36,21 @@
 // +-----------------------------------------------------------------------+
 
-function COA_index() {
+function COA_albums() 
+{
   global $template, $page, $conf, $pwg_loaded_plugins;
   
-  if ($page['section'] == 'categories' AND isset($page['category']) 
-    AND (!isset($pwg_loaded_plugins['rv_tscroller']) OR count($page['navigation_bar']) == 0)) 
-  {  
-    
-    if (isset($pwg_loaded_plugins['bbcode_bar']) AND !isset($_GET['comment_to_edit'])) set_bbcode_bar();
-    else if (isset($pwg_loaded_plugins['SmiliesSupport']) AND !isset($_GET['comment_to_edit'])) set_smiliessupport();
+  if (
+    $page['section'] == 'categories' AND isset($page['category']) AND 
+    ( !isset($pwg_loaded_plugins['rv_tscroller']) OR count($page['navigation_bar']) == 0 )
+    ) 
+  {   
+    if (isset($pwg_loaded_plugins['bbcode_bar']) AND !isset($_GET['comment_to_edit'])) 
+    {
+      set_bbcode_bar();
+    }
+    else if (isset($pwg_loaded_plugins['SmiliesSupport']) AND !isset($_GET['comment_to_edit'])) 
+    {
+      set_smiliessupport();
+    }
     
     include(COA_PATH . 'include/coa_albums.php');
@@ -49,23 +58,36 @@
 }
 
-function COA_comments_page() {
+function COA_comments_page() 
+{
   global $template, $page, $conf;
   
-  if (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') {
+  if (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') 
+  {
     include(COA_PATH . 'include/coa_comments_page.php');
   }
 }
 
-function COA_admin() {
-  global $template, $page, $conf;
+function COA_admin_intro() 
+{
+  global $page;
   
-  if ($page['page'] == 'comments') {  
-    include(COA_PATH . 'include/coa_admin_comments.php');
-  } else if ($page['page'] == 'intro') {  
+  if ($page['page'] == 'intro') 
+  {  
     include(COA_PATH . 'include/coa_admin_intro.php');
   } 
 }
 
-function COA_admin_menu($menu) {
+function COA_admin_comments() 
+{
+  global $page;
+  
+  if ($page['page'] == 'comments') 
+  {  
+    include(COA_PATH . 'include/coa_admin_comments.php');
+  }
+}
+
+function COA_admin_menu($menu) 
+{
   array_push($menu, array(
     'NAME' => 'Comments on Albums',
Index: /extensions/Comments_on_Albums/maintain.inc.php
===================================================================
--- /extensions/Comments_on_Albums/maintain.inc.php	(revision 11266)
+++ /extensions/Comments_on_Albums/maintain.inc.php	(revision 11267)
@@ -3,30 +3,44 @@
 
 // Default configuration
-define('default_config', serialize(array(
-  'icon_color' => 'outline_ff3363.png',
-  'icon_color_over' => 'outline_ff7700.png',
-)));
+define(
+  'default_config', 
+  serialize(array(
+    'icon_color' => 'outline_ff3363.png',
+    'icon_color_over' => 'outline_ff7700.png',
+    ))
+  );
 
 // Installation
-function plugin_install() {
+function plugin_install() 
+{
   global $prefixeTable;
 
-  pwg_query("CREATE TABLE `" . $prefixeTable . "comments_categories` (
-    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
-    `category_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
-    `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-    `author` varchar(255) DEFAULT NULL,
-    `author_id` smallint(5) DEFAULT NULL,
-    `content` longtext,
-    `validated` enum('true','false') NOT NULL DEFAULT 'false',
-    `validation_date` datetime DEFAULT NULL,
-    PRIMARY KEY (`id`)
-  ) DEFAULT CHARSET=utf8;");
+  pwg_query("
+CREATE TABLE `" . $prefixeTable . "comments_categories` (
+  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+  `category_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
+  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `author` varchar(255) DEFAULT NULL,
+  `author_id` smallint(5) DEFAULT NULL,
+  `content` longtext,
+  `validated` enum('true','false') NOT NULL DEFAULT 'false',
+  `validation_date` datetime DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) DEFAULT CHARSET=utf8
+;");
   
-  pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('comments_on_albums', '" . default_config . "', 'Parametres du plugin Comments on Albums');");
+  pwg_query("
+INSERT INTO " . CONFIG_TABLE . "(param,value,comment) 
+VALUES(
+  'comments_on_albums', 
+  '" . default_config . "', 
+  'Comments on Albums plugin'
+)
+;");
 }
 
 // Uninstallation
-function plugin_uninstall() {
+function plugin_uninstall() 
+{
   global $prefixeTable;
 
Index: /extensions/Comments_on_Albums/template/admin_comments.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/admin_comments.tpl	(revision 11267)
+++ /extensions/Comments_on_Albums/template/admin_comments.tpl	(revision 11267)
@@ -0,0 +1,69 @@
+{* this is a copy of admin/theme/defaults/template/comments.tpl a bit modified *}
+  
+{literal}
+<script type="text/javascript">
+  $(document).ready(function(){
+    $(".checkComment").click(function(event) {
+      if (event.target.type !== 'checkbox') {
+        var checkbox = $(this).children("input[type=checkbox]");
+        $(checkbox).attr('checked', !$(checkbox).is(':checked'));
+      }
+    });
+    $("#commentSelectAll").click(function () {
+      $(".checkComment input[type=checkbox]").attr('checked', true);
+      return false;
+    });
+    $("#commentSelectNone").click(function () {
+      $(".checkComment input[type=checkbox]").attr('checked', false);
+      return false;
+    });
+    $("#commentSelectInvert").click(function () {
+      $(".checkComment input[type=checkbox]").each(function() {
+        $(this).attr('checked', !$(this).is(':checked'));
+      });
+      return false;
+    });
+  });
+</script>
+{/literal}
+
+<div class="titrePage">
+  <h2>{'Waiting'|@translate}</h2>
+</div>
+
+<h3>{'User comments validation'|@translate}</h3>
+
+{if !empty($comments) }
+<form method="post" action="{$F_ACTION}">
+
+  <table width="99%">
+  {foreach from=$comments item=comment name=comment}
+    <tr valign="top" class="{if $smarty.foreach.comment.index is odd}row2{else}row1{/if}">
+      <td style="width:50px;" class="checkComment">
+        <input type="checkbox" name="comments[]" value="{$comment.ID}">
+      </td>
+      <td>
+        <div class="comment">
+          <a class="illustration" href="{$comment.CAT_URL}">{$comment.CAT_NAME}</a>
+          <p class="commentHeader"><strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
+          <blockquote>{$comment.CONTENT}</blockquote>
+        </div>
+      </td>
+    </tr>
+  {/foreach}
+  </table>
+
+  <p class="checkActions">
+    {'Select:'|@translate}
+    <a href="#" id="commentSelectAll">{'All'|@translate}</a>,
+    <a href="#" id="commentSelectNone">{'None'|@translate}</a>,
+    <a href="#" id="commentSelectInvert">{'Invert'|@translate}</a>
+  </p>
+
+  <p class="bottomButtons">
+    <input class="submit" type="submit" name="validate_albums" value="{'Validate'|@translate}">
+    <input class="submit" type="submit" name="reject_albums" value="{'Reject'|@translate}">
+  </p>
+
+</form>
+{/if}
Index: /extensions/Comments_on_Albums/template/albums.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/albums.tpl	(revision 11267)
+++ /extensions/Comments_on_Albums/template/albums.tpl	(revision 11267)
@@ -0,0 +1,33 @@
+{* this is inspired by theme/defaults/template/picture.tpl *}
+  
+{combine_css path=$COA_PATH|@cat:'template/style_albums.css'}
+{if $themeconf.name == 'Sylvia'}{combine_css path=$COA_PATH|@cat:'template/style_albums_sylvia.css'}{/if}
+
+<a name="comments"></a>
+{if isset($COMMENT_COUNT)}
+<div id="comments">
+  {if $COMMENT_COUNT > 0}
+    <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
+  {/if}
+
+  {if isset($comments)}
+    {include file='comment_list.tpl'}
+  {/if}
+  
+  {if !empty($comment_navbar)}{include file=$COA_ABSOLUTE_PATH|@cat:'template/navigation_bar.tpl'}{/if}
+
+  {if isset($comment_add)}
+  <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
+    <fieldset>
+      <legend>{'Add a comment'|@translate}</legend>
+      {if $comment_add.SHOW_AUTHOR}
+        <label>{'Author'|@translate}<input type="text" name="author"></label>
+      {/if}
+      <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
+      <input type="hidden" name="key" value="{$comment_add.KEY}">
+      <input type="submit" value="{'Submit'|@translate}">
+    </fieldset>
+  </form>
+  {/if}
+</div>
+{/if}{*comments*}
Index: tensions/Comments_on_Albums/template/coa_admin_comments.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/coa_admin_comments.tpl	(revision 11266)
+++ 	(revision )
@@ -1,69 +1,0 @@
-{* this is a copy of admin/theme/defaults/template/comments.tpl a bit modified *}
-  
-{literal}
-<script type="text/javascript">
-  $(document).ready(function(){
-    $(".checkComment").click(function(event) {
-      if (event.target.type !== 'checkbox') {
-        var checkbox = $(this).children("input[type=checkbox]");
-        $(checkbox).attr('checked', !$(checkbox).is(':checked'));
-      }
-    });
-    $("#commentSelectAll").click(function () {
-      $(".checkComment input[type=checkbox]").attr('checked', true);
-      return false;
-    });
-    $("#commentSelectNone").click(function () {
-      $(".checkComment input[type=checkbox]").attr('checked', false);
-      return false;
-    });
-    $("#commentSelectInvert").click(function () {
-      $(".checkComment input[type=checkbox]").each(function() {
-        $(this).attr('checked', !$(this).is(':checked'));
-      });
-      return false;
-    });
-  });
-</script>
-{/literal}
-
-<div class="titrePage">
-  <h2>{'Waiting'|@translate}</h2>
-</div>
-
-<h3>{'User comments validation'|@translate}</h3>
-
-{if !empty($comments) }
-<form method="post" action="{$F_ACTION}">
-
-  <table width="99%">
-  {foreach from=$comments item=comment name=comment}
-    <tr valign="top" class="{if $smarty.foreach.comment.index is odd}row2{else}row1{/if}">
-      <td style="width:50px;" class="checkComment">
-        <input type="checkbox" name="comments[]" value="{$comment.ID}">
-      </td>
-      <td>
-        <div class="comment">
-          <a class="illustration" href="{$comment.CAT_URL}">{$comment.CAT_NAME}</a>
-          <p class="commentHeader"><strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
-          <blockquote>{$comment.CONTENT}</blockquote>
-        </div>
-      </td>
-    </tr>
-  {/foreach}
-  </table>
-
-  <p class="checkActions">
-    {'Select:'|@translate}
-    <a href="#" id="commentSelectAll">{'All'|@translate}</a>,
-    <a href="#" id="commentSelectNone">{'None'|@translate}</a>,
-    <a href="#" id="commentSelectInvert">{'Invert'|@translate}</a>
-  </p>
-
-  <p class="bottomButtons">
-    <input class="submit" type="submit" name="validate_albums" value="{'Validate'|@translate}">
-    <input class="submit" type="submit" name="reject_albums" value="{'Reject'|@translate}">
-  </p>
-
-</form>
-{/if}
Index: tensions/Comments_on_Albums/template/coa_admin_intro.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/coa_admin_intro.tpl	(revision 11266)
+++ 	(revision )
@@ -1,13 +1,0 @@
-{* this code add a line to the database infos list *}
-
-{footer_script require='jquery'}
-  jQuery('dl[style="padding-top: 30px;"] dd:last-child ul li:last-child').append('[{'Photos'|@translate}]');
-  jQuery('<li>'+
-    '{$DB_COMMENTS_ALBUMS}'+
-    {if isset($unvalidated_albums)}
-      ' (<a href="{$unvalidated_albums.URL}">{$unvalidated_albums.INFO}</a>)'+
-    {/if}
-    ' [{'Albums'|@translate}]'+
-  '</li>')
-  .appendTo('dl[style="padding-top: 30px;"] dd:last-child ul');
-{/footer_script}
Index: tensions/Comments_on_Albums/template/coa_albums.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/coa_albums.tpl	(revision 11266)
+++ 	(revision )
@@ -1,33 +1,0 @@
-{* this is inspired by theme/defaults/template/picture.tpl *}
-  
-{combine_css path=$COA_PATH|@cat:'template/style_albums.css'}
-{if $themeconf.name == 'Sylvia'}{combine_css path=$COA_PATH|@cat:'template/style_albums_sylvia.css'}{/if}
-
-<a name="comments"></a>
-{if isset($COMMENT_COUNT)}
-<div id="comments">
-  {if $COMMENT_COUNT > 0}
-    <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
-  {/if}
-
-  {if isset($comments)}
-    {include file='comment_list.tpl'}
-  {/if}
-  
-  {if !empty($comment_navbar)}{include file=$COA_ABSOLUTE_PATH|@cat:'template/navigation_bar.tpl'}{/if}
-
-  {if isset($comment_add)}
-  <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
-    <fieldset>
-      <legend>{'Add a comment'|@translate}</legend>
-      {if $comment_add.SHOW_AUTHOR}
-        <label>{'Author'|@translate}<input type="text" name="author"></label>
-      {/if}
-      <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
-      <input type="hidden" name="key" value="{$comment_add.KEY}">
-      <input type="submit" value="{'Submit'|@translate}">
-    </fieldset>
-  </form>
-  {/if}
-</div>
-{/if}{*comments*}
Index: tensions/Comments_on_Albums/template/coa_comments_page.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/coa_comments_page.tpl	(revision 11266)
+++ 	(revision )
@@ -1,101 +1,0 @@
-{* this is a copy of theme/defaults/template/comments.tpl a bit modified *}
-  
-{html_head}
-<style type="text/css">
-  .thumbnailCategory .category-title {ldelim}
-    font-size:1.1em;
-    font-weight:bold;
-  }
-  .pwg-icon-comments-images {ldelim}
-    background-image: url({$COA_PATH}template/s26/{$ICON_COLOR});
-    background-position: 0 0;
-  }
-  a:hover .pwg-icon-comments-images {ldelim}
-    background-image: url({$COA_PATH}template/s26/{$ICON_COLOR_OVER});
-    background-position: 0 0;
-  }
-</style>
-{/html_head}
-
-<div id="content" class="content">
-
-<div class="titrePage">
-  <ul class="categoryActions">
-    <li><a href="comments.php" title="{'COA_comments_photos'|@translate}" class="pwg-state-default pwg-button">
-      <span class="pwg-icon pwg-icon-comments-images">&nbsp;</span><span class="pwg-button-text">{'COA_comments_photos'|@translate}</span>
-    </a></li>
-    <li><a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button">
-      <span class="pwg-icon pwg-icon-home">&nbsp;</span><span class="pwg-button-text">{'Home'|@translate}</span>
-    </a></li>
-  </ul>
-  <h2>{'User comments'|@translate}</h2>
-</div>
-
-<form class="filter" action="{$F_ACTION}?display_mode=albums" method="get">
-
-  <fieldset>
-    <legend>{'Filter'|@translate}</legend>
-
-    <label>{'Keyword'|@translate}<input type="text" name="keyword" value="{$F_KEYWORD}"></label>
-
-    <label>{'Author'|@translate}<input type="text" name="author" value="{$F_AUTHOR}"></label>
-
-    <label>
-      {'Album'|@translate}
-      <select name="cat">
-        <option value="0">------------</option>
-        {html_options options=$categories selected=$categories_selected}
-      </select>
-    </label>
-
-    <label>
-      {'Since'|@translate}
-      <select name="since">
-        {html_options options=$since_options selected=$since_options_selected}
-      </select>
-    </label>
-
-  </fieldset>
-
-  <fieldset>
-
-    <legend>{'Display'|@translate}</legend>
-
-    <label>
-      {'Sort by'|@translate}
-      <select name="sort_by">
-        {html_options options=$sort_by_options selected=$sort_by_options_selected}
-      </select>
-    </label>
-
-    <label>
-      {'Sort order'|@translate}
-      <select name="sort_order">
-        {html_options options=$sort_order_options selected=$sort_order_options_selected}
-      </select>
-    </label>
-
-    <label>
-      {'Number of items'|@translate}
-      <select name="items_number">
-        {html_options options=$item_number_options selected=$item_number_options_selected}
-      </select>
-    </label>
-
-  </fieldset>
-
-  <input type="hidden" name="display_mode" value="albums"/>
-  <p><input class="submit" type="submit" value="{'Filter and display'|@translate}"></p>
-
-</form>
- 
-{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
-
-{if isset($comments)}
-<div id="comments">
-  {include file='comment_list.tpl'}
-</div>
-{/if}
-
-</div> <!-- content -->
-
Index: tensions/Comments_on_Albums/template/coa_messages.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/coa_messages.tpl	(revision 11266)
+++ 	(revision )
@@ -1,18 +1,0 @@
-{if isset($errors)}
-<div class="errors">
-  <ul>
-    {foreach from=$errors item=error}
-    <li>{$error}</li>
-    {/foreach}
-  </ul>
-</div>
-{/if}
-{if isset($infos)}
-<div class="infos">
-  <ul>
-    {foreach from=$infos item=info}
-    <li>{$info}</li>
-    {/foreach}
-  </ul>
-</div>
-{/if}
Index: /extensions/Comments_on_Albums/template/comments_page.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/comments_page.tpl	(revision 11267)
+++ /extensions/Comments_on_Albums/template/comments_page.tpl	(revision 11267)
@@ -0,0 +1,101 @@
+{* this is a copy of theme/defaults/template/comments.tpl a bit modified *}
+  
+{html_head}
+<style type="text/css">
+  .thumbnailCategory .category-title {ldelim}
+    font-size:1.1em;
+    font-weight:bold;
+  }
+  .pwg-icon-comments-images {ldelim}
+    background-image: url({$COA_PATH}template/s26/{$ICON_COLOR});
+    background-position: 0 0;
+  }
+  a:hover .pwg-icon-comments-images {ldelim}
+    background-image: url({$COA_PATH}template/s26/{$ICON_COLOR_OVER});
+    background-position: 0 0;
+  }
+</style>
+{/html_head}
+
+<div id="content" class="content">
+
+<div class="titrePage">
+  <ul class="categoryActions">
+    <li><a href="comments.php" title="{'COA_comments_photos'|@translate}" class="pwg-state-default pwg-button">
+      <span class="pwg-icon pwg-icon-comments-images">&nbsp;</span><span class="pwg-button-text">{'COA_comments_photos'|@translate}</span>
+    </a></li>
+    <li><a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button">
+      <span class="pwg-icon pwg-icon-home">&nbsp;</span><span class="pwg-button-text">{'Home'|@translate}</span>
+    </a></li>
+  </ul>
+  <h2>{'User comments'|@translate}</h2>
+</div>
+
+<form class="filter" action="{$F_ACTION}?display_mode=albums" method="get">
+
+  <fieldset>
+    <legend>{'Filter'|@translate}</legend>
+
+    <label>{'Keyword'|@translate}<input type="text" name="keyword" value="{$F_KEYWORD}"></label>
+
+    <label>{'Author'|@translate}<input type="text" name="author" value="{$F_AUTHOR}"></label>
+
+    <label>
+      {'Album'|@translate}
+      <select name="cat">
+        <option value="0">------------</option>
+        {html_options options=$categories selected=$categories_selected}
+      </select>
+    </label>
+
+    <label>
+      {'Since'|@translate}
+      <select name="since">
+        {html_options options=$since_options selected=$since_options_selected}
+      </select>
+    </label>
+
+  </fieldset>
+
+  <fieldset>
+
+    <legend>{'Display'|@translate}</legend>
+
+    <label>
+      {'Sort by'|@translate}
+      <select name="sort_by">
+        {html_options options=$sort_by_options selected=$sort_by_options_selected}
+      </select>
+    </label>
+
+    <label>
+      {'Sort order'|@translate}
+      <select name="sort_order">
+        {html_options options=$sort_order_options selected=$sort_order_options_selected}
+      </select>
+    </label>
+
+    <label>
+      {'Number of items'|@translate}
+      <select name="items_number">
+        {html_options options=$item_number_options selected=$item_number_options_selected}
+      </select>
+    </label>
+
+  </fieldset>
+
+  <input type="hidden" name="display_mode" value="albums"/>
+  <p><input class="submit" type="submit" value="{'Filter and display'|@translate}"></p>
+
+</form>
+ 
+{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+
+{if isset($comments)}
+<div id="comments">
+  {include file='comment_list.tpl'}
+</div>
+{/if}
+
+</div> <!-- content -->
+
Index: /extensions/Comments_on_Albums/template/config.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/config.tpl	(revision 11267)
+++ /extensions/Comments_on_Albums/template/config.tpl	(revision 11267)
@@ -0,0 +1,65 @@
+{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
+{combine_css path=$COA_PATH|@cat:'template/style_admin.css'}
+
+{footer_script require='jquery'}
+{literal}
+  jQuery().ready(function(){
+    // Cluetip
+    jQuery('.cluetip').cluetip({
+      width: 550,
+      splitTitle: '|'
+    });
+{/literal}    
+    jQuery('select').change(function() {ldelim}
+      jQuery('#' + jQuery(this).attr('name') + '_live').attr('src', '{$COA_PATH}template/s26/' + jQuery(this).val());
+    });
+  });
+{/footer_script}
+
+{html_head}
+<style type="text/css">
+  .cluetip:after {ldelim}
+    content:url('{$themeconf.admin_icon_dir}/help.png');
+  }
+</style>
+{/html_head}
+
+<div class="titrePage">
+  <h2>Comments on Albums</h2>
+</div>
+
+<form method="post" action="" class="properties" id="CR_config">
+  <fieldset>
+    <legend><span class="title cluetip" title="{'COA_icon_pack'|@translate}|{'COA_help_icon_pack'|@translate}">{'COA_icon_pack'|@translate}</span></legend>
+    <table>  
+      <tr>
+        <td><span class="title">{'COA_icon_normal'|@translate}</span></td>
+        <td>
+          <select name="icon_color">
+          {foreach from=$COLORS item=COLOR}
+            <option value="{$COLOR}" {if $COLOR == $ICON_COLOR}selected="selected"{/if}>{$COLOR}</option>
+          {/foreach}
+          </select>
+          
+          <img id="icon_color_live" class="pwg-icon" src="{$COA_PATH}template/s26/{$ICON_COLOR}"/>
+        </td>
+      </tr>
+      <tr>
+        <td><span class="title">{'COA_icon_over'|@translate}</span></td>
+        <td>
+          <select name="icon_color_over">
+          {foreach from=$COLORS item=COLOR}
+            <option value="{$COLOR}" style="color:#{$COLOR};" {if $COLOR == $ICON_COLOR_OVER}selected="selected"{/if}>{$COLOR}</option>
+          {/foreach}
+          </select>
+          
+          <img id="icon_color_over_live" class="pwg-icon" src="{$COA_PATH}template/s26/{$ICON_COLOR_OVER}"/>
+        </td>
+      </tr>
+    </table>
+  </fieldset>
+
+  <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="config_submit"/></p>
+</form>
+
+<p>{'COA_comment_validation_link'|@translate}</p>
Index: /extensions/Comments_on_Albums/template/style_admin.css
===================================================================
--- /extensions/Comments_on_Albums/template/style_admin.css	(revision 11267)
+++ /extensions/Comments_on_Albums/template/style_admin.css	(revision 11267)
@@ -0,0 +1,25 @@
+.titrePage {
+  clear:right;
+}
+
+table {
+  width:80%;
+}
+td {
+  width:50%;
+  white-space: nowrap;
+}
+.title {
+  display:block;
+  font-weight:bold;
+  text-align:right;
+  margin-right:10px;
+}
+.title.cluetip:after {
+  margin-left:5px;
+  vertical-align:top;
+}
+
+.pwg-icon {
+  margin:-5px 0;
+}
