Index: comment_upload.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_upload/comment_upload.module,v
retrieving revision 1.4.2.2
diff -u -p -r1.4.2.2 comment_upload.module
--- comment_upload.module	17 Jan 2007 08:32:04 -0000	1.4.2.2
+++ comment_upload.module	6 Feb 2007 08:37:49 -0000
@@ -86,13 +86,7 @@ function comment_upload_comment(&$commen
         }
       }
       if ($comment->files) {
-        if (count($comment->files) == 1 && variable_get('comment_upload_single', 0)) {
-          $files = $comment->files;
-          $comment->comment .= theme('comment_attachment', (object)array_pop($files), $comment);
-        }
-        else {
-          $comment->comment .= theme('upload_attachments', $comment->files);
-        }
+        $comment->comment .= theme('comment_attachments', $comment->files);
       }
       break;
   }
@@ -245,15 +239,32 @@ function comment_upload_nodeapi(&$node, 
 }
 
 
-function theme_comment_attachment($file, $comment) {
-  $href = check_url(strpos($file->fid, 'upload') === false ? file_create_url($file->filepath) : url(file_create_filename($file->filename, file_create_path())));
-  $regex = '/\.('. ereg_replace(' +', '|', preg_quote('jpg jpeg gif png')) .')$/i';
-  if (variable_get('comment_upload_inline_image', 0) && preg_match($regex, $file->filename)) {
-    $html = '<img src="'. $href .'"/>';
-  }
-  else {
-    $html = '<a href="'. $href .'">'. check_plain($file->filename) .' ('. format_size($file->filesize) .')</a>';
+/**
+ * Style the attachment display.
+ *
+ * Images are displayed inline when Inline display has been set.
+ * Any remaining files are styled by theme('upload_attachments').
+ *
+ * @param $files An array containing files objects ($comment->files structure).
+ *
+ * @return HTML representation of attachments.
+ */
+function theme_comment_attachments($files) {
+  // Display images.
+  if (variable_get('comment_upload_inline_image', 0)) {
+    $regex = '/\.('. ereg_replace(' +', '|', preg_quote('jpg jpeg gif png')) .')$/i';
+    foreach ($files as $key => $file) {
+      if ($file->list) {
+        if (preg_match($regex, $file->filename)) {
+          unset($files[$key]);
+          $href = check_url(strpos($file->fid, 'upload') === false ? file_create_url($file->filepath) : url(file_create_filename($file->filename, file_create_path())));
+          $html .= '<img src="'. $href .'" title="'. check_plain($file->description) . '"/>';
+        }
+      }
+    }
   }
+  // Style the remaining files as an attachment table.
+  $html .= theme('upload_attachments', $files);
   return $html;
 }
 
