Index: /trunk/admin.php
===================================================================
--- /trunk/admin.php	(revision 25083)
+++ /trunk/admin.php	(revision 25084)
@@ -207,5 +207,18 @@
 if ($conf['activate_comments'])
 {
-  $template->assign('U_PENDING_COMMENTS', $link_start.'comments');
+  $template->assign('U_COMMENTS', $link_start.'comments');
+  
+  // pending comments
+  $query = '
+SELECT COUNT(*)
+  FROM '.COMMENTS_TABLE.'
+  WHERE validated=\'false\'
+;';
+  list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
+
+  if ($nb_comments > 0)
+  {
+    $template->assign('NB_PENDING_COMMENTS', $nb_comments);
+  }
 }
 
Index: /trunk/admin/comments.php
===================================================================
--- /trunk/admin/comments.php	(revision 25083)
+++ /trunk/admin/comments.php	(revision 25084)
@@ -98,9 +98,65 @@
 // +-----------------------------------------------------------------------+
 
-$list = array();
+$nb_total = 0;
+$nb_pending = 0;
 
 $query = '
-SELECT c.id, c.image_id, c.date, c.author, '.
-$conf['user_fields']['username'].' AS username, c.content, i.path, i.representative_ext
+SELECT
+    COUNT(*) AS counter,
+    validated
+  FROM '.COMMENTS_TABLE.'
+  GROUP BY validated
+;';
+$result = pwg_query($query);
+while ($row = pwg_db_fetch_assoc($result))
+{
+  $nb_total+= $row['counter'];
+
+  if ('false' == $row['validated'])
+  {
+    $nb_pending = $row['counter'];
+  }
+}
+
+if (!isset($_GET['filter']) and $nb_pending > 0)
+{
+  $page['filter'] = 'pending';
+}
+else
+{
+  $page['filter'] = 'all';
+}
+
+if (isset($_GET['filter']) and 'pending' == $_GET['filter'])
+{
+  $page['filter'] = $_GET['filter'];
+}
+
+$template->assign(
+  array(
+    'nb_total' => $nb_total,
+    'nb_pending' => $nb_pending,
+    'filter' => $page['filter'],
+    )
+  );
+
+$where_clauses = array('1=1');
+
+if ('pending' == $page['filter'])
+{
+  $where_clauses[] = 'validated=\'false\'';
+}
+
+$query = '
+SELECT
+    c.id,
+    c.image_id,
+    c.date,
+    c.author,
+    '.$conf['user_fields']['username'].' AS username,
+    c.content,
+    i.path,
+    i.representative_ext,
+    validated
   FROM '.COMMENTS_TABLE.' AS c
     INNER JOIN '.IMAGES_TABLE.' AS i
@@ -108,5 +164,5 @@
     LEFT JOIN '.USERS_TABLE.' AS u
       ON u.'.$conf['user_fields']['id'].' = c.author_id
-  WHERE validated = \'false\'
+  WHERE '.implode(' AND ', $where_clauses).'
   ORDER BY c.date DESC
 ;';
@@ -136,5 +192,6 @@
       'AUTHOR' => trigger_event('render_comment_author', $author_name),
       'DATE' => format_date($row['date'], true),
-      'CONTENT' => trigger_event('render_comment_content',$row['content'])
+      'CONTENT' => trigger_event('render_comment_content',$row['content']),
+      'IS_PENDING' => ('false' == $row['validated']),
       )
     );
@@ -143,6 +200,4 @@
 }
 
-$template->assign('LIST', implode(',', $list) );
-
 // +-----------------------------------------------------------------------+
 // |                           sending html code                           |
Index: /trunk/admin/include/add_core_tabs.inc.php
===================================================================
--- /trunk/admin/include/add_core_tabs.inc.php	(revision 25083)
+++ /trunk/admin/include/add_core_tabs.inc.php	(revision 25084)
@@ -60,5 +60,5 @@
       
     case 'comments':
-      $sheets[''] = array('caption' => l10n('User comments validation'), 'url' => '');
+      $sheets[''] = array('caption' => l10n('User comments'), 'url' => '');
       break;
       
Index: /trunk/admin/themes/default/template/admin.tpl
===================================================================
--- /trunk/admin/themes/default/template/admin.tpl	(revision 25083)
+++ /trunk/admin/themes/default/template/admin.tpl	(revision 25084)
@@ -73,6 +73,6 @@
 				<li><a class="icon-signal" href="{$U_HISTORY_STAT}">{'History'|@translate}</a></li>
 				<li><a class="icon-tools" href="{$U_MAINTENANCE}">{'Maintenance'|@translate}</a></li>
-{if isset($U_PENDING_COMMENTS)}
-				<li><a class="icon-chat" href="{$U_PENDING_COMMENTS}">{'Pending Comments'|@translate}</a></li>
+{if isset($U_COMMENTS)}
+				<li><a class="icon-chat" href="{$U_COMMENTS}">{'Comments'|@translate}{if $NB_PENDING_COMMENTS > 0}<span class="adminMenubarCounter" title="{'%d waiting for validation'|translate:$NB_PENDING_COMMENTS}">{$NB_PENDING_COMMENTS}</span>{/if}</a></li>
 {/if}
         <li><a class="icon-arrows-cw" href="{$U_UPDATES}">{'Updates'|@translate}</a></li>
Index: /trunk/admin/themes/default/template/comments.tpl
===================================================================
--- /trunk/admin/themes/default/template/comments.tpl	(revision 25083)
+++ /trunk/admin/themes/default/template/comments.tpl	(revision 25084)
@@ -44,5 +44,10 @@
 {/literal}{/footer_script}
 
-<h2>{'Pending Comments'|@translate} {$TABSHEET_TITLE}</h2>
+<h2>{'User comments'|@translate} {$TABSHEET_TITLE}</h2>
+
+<p style="text-align:left;margin-left:1em;">
+  <a href="{$F_ACTION}&amp;filter=all" class="{if $filter == 'all'}commentFilterSelected{/if}">{'All'|@translate}</a> ({$nb_total})
+  | <a href="{$F_ACTION}&amp;filter=pending" class="{if $filter == 'pending'}commentFilterSelected{/if}">{'Waiting'|@translate}</a> ({$nb_pending})
+</p>
 
 {if !empty($comments) }
@@ -58,5 +63,5 @@
   <div class="comment">
     <a class="illustration" href="{$comment.U_PICTURE}"><img src="{$comment.TN_SRC}"></a>
-    <p class="commentHeader"><strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
+    <p class="commentHeader">{if $comment.IS_PENDING}<span class="pendingFlag">{'Waiting'|@translate}</span> - {/if}<strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
     <blockquote>{$comment.CONTENT}</blockquote>
   </div>
