Index: /extensions/Comments_on_Albums/include/coa_admin_comments.php
===================================================================
--- /extensions/Comments_on_Albums/include/coa_admin_comments.php	(revision 11326)
+++ /extensions/Comments_on_Albums/include/coa_admin_comments.php	(revision 11327)
@@ -3,5 +3,5 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-global $template, $conf;
+global $template, $conf, $user;
 load_language('plugin.lang', COA_PATH);
 
@@ -11,35 +11,16 @@
 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
 
-$tabs = array(
-  array(
-    '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 $_GET['section'] == 'albums')
 {
-  $page['tab'] = $_GET['section'];
+  $page['tab'] = 'albums';
 } 
 else 
 {
-  $page['tab'] = $tabs[0]['code'];
+  $page['tab'] = 'pictures';
 }
 
 $tabsheet = new tabsheet();
-foreach ($tabs as $tab) 
-{
-  $tabsheet->add(
-    $tab['code'],
-    $tab['label'],
-    get_root_url().'admin.php?page=comments&amp;section='.$tab['code']
-    );
-}
+$tabsheet->add('pictures', l10n('COA_comments_photos'), get_root_url().'admin.php?page=comments');
+$tabsheet->add('albums', l10n('COA_comments_albums'), get_root_url().'admin.php?page=comments&amp;section=albums');
 $tabsheet->select($page['tab']);
 $tabsheet->assign();
@@ -134,12 +115,19 @@
     com.date, 
     com.author,
-    '.$conf['user_fields']['username'].' AS username, 
+    u.'.$conf['user_fields']['username'].' AS username, 
     com.content, 
-    cat.name
+    cat.name,
+    img.id AS image_id,
+    img.path,
+    img.tn_ext
   FROM '.COA_TABLE.' AS com
-    INNER JOIN '.CATEGORIES_TABLE.' AS cat
+    LEFT JOIN '.CATEGORIES_TABLE.' AS cat
       ON cat.id = com.category_id
     LEFT JOIN '.USERS_TABLE.' AS u
       ON u.'.$conf['user_fields']['id'].' = com.author_id
+    LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc 
+      ON ucc.cat_id = com.category_id AND ucc.user_id = '.$user['id'].'
+    LEFT JOIN '.IMAGES_TABLE.' AS img
+      ON img.id = ucc.user_representative_picture_id
   WHERE validated = \'false\'
   ORDER BY com.date DESC
@@ -159,11 +147,21 @@
     }
     
+    // thumbnail
+    $row['thumb'] = get_thumbnail_url(
+      array(
+        'id' => $row['image_id'],
+        'path' => $row['path'],
+        'tn_ext' => @$row['tn_ext'],
+        )
+     );
+    
     // comment content
     $template->append(
       'comments', 
       array(
+        'ID' => $row['id'],
         'CAT_URL' => PHPWG_ROOT_PATH.'admin.php?page=cat_modify&amp;cat_id='.$row['category_id'],
-        'CAT_NAME' => $row['name'],
-        'ID' => $row['id'],
+        'CAT_NAME' => trigger_event('render_category_name', $row['name']),
+        'TN_SRC' => $row['thumb'],
         'AUTHOR' => trigger_event('render_comment_author', $author_name),
         'DATE' => format_date($row['date'], true),
Index: /extensions/Comments_on_Albums/include/coa_comments_page.php
===================================================================
--- /extensions/Comments_on_Albums/include/coa_comments_page.php	(revision 11326)
+++ /extensions/Comments_on_Albums/include/coa_comments_page.php	(revision 11327)
@@ -197,6 +197,6 @@
     com.validated
   FROM '.COA_TABLE.' AS com
-  LEFT JOIN '.USERS_TABLE.' As u
-    ON u.'.$conf['user_fields']['id'].' = com.author_id
+    LEFT JOIN '.USERS_TABLE.' As u
+      ON u.'.$conf['user_fields']['id'].' = com.author_id
   WHERE '.implode('
     AND ', $page['where_clauses']).'
@@ -234,8 +234,15 @@
     cat.permalink, 
     cat.uppercats, 
-    com.id as comment_id
+    com.id as comment_id,
+    img.id AS image_id,
+    img.path,
+    img.tn_ext
   FROM '.CATEGORIES_TABLE.' AS cat
-  LEFT JOIN '.COA_TABLE.' AS com
-    ON cat.id=com.category_id
+    LEFT JOIN '.COA_TABLE.' AS com
+      ON com.category_id = cat.id
+    LEFT JOIN '.USER_CACHE_CATEGORIES_TABLE.' AS ucc 
+      ON ucc.cat_id = cat.id AND ucc.user_id = '.$user['id'].'
+    LEFT JOIN '.IMAGES_TABLE.' AS img
+      ON img.id = ucc.user_representative_picture_id
   '.get_sql_condition_FandF(
     array(
@@ -251,7 +258,6 @@
     foreach ($comments as $comment) 
     {
-      // category
-      $name = $categories[$comment['comment_id']]['name'];
-      $url = duplicate_index_url(
+      // category url
+      $comment['cat_url'] = duplicate_index_url(
         array(
           'category' => array(
@@ -263,10 +269,20 @@
           )
         );
+       
+      // category thumbnail
+      $comment['thumb'] = get_thumbnail_url(
+        array(
+          'id' => $categories[$comment['comment_id']]['image_id'],
+          'path' => $categories[$comment['comment_id']]['path'],
+          'tn_ext' => @$categories[$comment['comment_id']]['tn_ext'],
+          )
+       );
       
       // comment content
       $tpl_comment = array(
         'ID' => $comment['comment_id'],
-        'CAT_URL' => $url,
-        'CAT_NAME' => $name,
+        'U_PICTURE' => $comment['cat_url'],
+        'ALT' => trigger_event('render_category_name', $categories[$comment['comment_id']]['name']),
+        'TN_SRC' => $comment['thumb'],
         'AUTHOR' => trigger_event('render_comment_author', $comment['author']),
         'DATE' => format_date($comment['date'], true),
@@ -341,11 +357,6 @@
   
   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">
-  <a href="{$comment.CAT_URL}">{$comment.CAT_NAME}</a>
-</div>
-'.$search;
-
+    $search = '<img src="{$comment.TN_SRC}" alt="{$comment.ALT}">';
+    $replacement = $search.'<br/>{$comment.ALT}';
     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 11326)
+++ /extensions/Comments_on_Albums/include/functions_comment.inc.php	(revision 11327)
@@ -154,5 +154,5 @@
       include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
 
-      $comment_url = get_absolute_root_url().'comments.php?comment_id='.$comm['id'];
+      $comment_url = get_absolute_root_url().'comments.php?display_mode=albums&amp;comment_id='.$comm['id'];
 
       $keyargs_content = array
@@ -273,5 +273,5 @@
       include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
 
-      $comment_url = get_absolute_root_url().'comments.php?display_mode=albums&comment_id='.$comment['comment_id'];
+      $comment_url = get_absolute_root_url().'comments.php?display_mode=albums&amp;comment_id='.$comment['comment_id'];
 
       $keyargs_content = array
Index: /extensions/Comments_on_Albums/main.inc.php
===================================================================
--- /extensions/Comments_on_Albums/main.inc.php	(revision 11326)
+++ /extensions/Comments_on_Albums/main.inc.php	(revision 11327)
@@ -65,5 +65,5 @@
 function COA_comments_page() 
 {
-  global $template, $page, $conf;
+  global $template, $page, $conf, $user;
   
   if (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') 
Index: /extensions/Comments_on_Albums/template/admin_comments.tpl
===================================================================
--- /extensions/Comments_on_Albums/template/admin_comments.tpl	(revision 11326)
+++ /extensions/Comments_on_Albums/template/admin_comments.tpl	(revision 11327)
@@ -45,5 +45,5 @@
       <td>
         <div class="comment">
-          <a class="illustration" href="{$comment.CAT_URL}">{$comment.CAT_NAME}</a>
+          <a class="illustration" href="{$comment.CAT_URL}"><img src="{$comment.TN_SRC}"><br/>{$comment.CAT_NAME}</a>
           <p class="commentHeader"><strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
           <blockquote>{$comment.CONTENT}</blockquote>
