? vud_hidden_comments_0.patch
Index: vud.css
===================================================================
RCS file: vud.css
diff -N vud.css
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ vud.css	27 Apr 2010 20:59:24 -0000
@@ -0,0 +1,17 @@
+/* $Id$  */
+/* VUD CSS file */
+div.negative-dimmed {
+	filter:alpha(opacity=50);
+  -ms-filter:”alpha(opacity=50)”;
+	-moz-opacity:0.5;
+	-khtml-opacity: 0.5;
+	opacity: 0.5;
+}
+
+div.negative-dimmed:hover {
+	filter:alpha(opacity=100);
+  -ms-filter:”alpha(opacity=100)”;
+	-moz-opacity: 1;
+	-khtml-opacity: 1;
+	opacity: 1;
+}
\ No newline at end of file
Index: vud.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vote_up_down/Attic/vud.module,v
retrieving revision 1.1.2.25
diff -u -p -r1.1.2.25 vud.module
--- vud.module	23 Apr 2010 05:10:16 -0000	1.1.2.25
+++ vud.module	27 Apr 2010 20:59:24 -0000
@@ -158,4 +158,4 @@ function vud_ctools_plugin_directory($mo
   if ($module == 'vud') {
     return $plugin;
   }
-}
+}
\ No newline at end of file
Index: vud.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vote_up_down/Attic/vud.theme.inc,v
retrieving revision 1.1.2.28
diff -u -p -r1.1.2.28 vud.theme.inc
--- vud.theme.inc	23 Apr 2010 06:13:25 -0000	1.1.2.28
+++ vud.theme.inc	27 Apr 2010 20:59:24 -0000
@@ -126,6 +126,7 @@ function vud_widget_proxy($content_id, $
 
   ctools_add_js('ajax-responder');
   drupal_add_js(drupal_get_path('module', 'vud') . '/vud.js');
+  drupal_add_css(drupal_get_path('module', 'vud') . '/vud.css');
   vud_add_files('css', $plugin);  // Search and add the CSS files.
   vud_add_files('js', $plugin);   // Search and add the JS files.
 
@@ -226,7 +227,10 @@ function vud_votes_proxy($content_id, $t
   }
   else {
     $variables['points'] = $vote_result;
-    if ($vote_result < 0) {
+    if ($vote_result < variable_get('vud_comment_dimmed', array())){
+      $variables['class'] = 'negative-dimmed';
+    }
+      elseif ($vote_result < 0) {
       $variables['class'] = 'negative';
     }
     else {
Index: vud_comment/vud_comment.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vote_up_down/vud_comment/Attic/vud_comment.module,v
retrieving revision 1.1.2.20
diff -u -p -r1.1.2.20 vud_comment.module
--- vud_comment/vud_comment.module	23 Apr 2010 06:13:26 -0000	1.1.2.20
+++ vud_comment/vud_comment.module	27 Apr 2010 20:59:24 -0000
@@ -62,6 +62,12 @@ function vud_comment_admin_settings() {
     '#default_value' => variable_get('vud_comment_reset', 0),
     '#options'       => array(0 => 'No', 1 => 'Yes'),
   );
+  $form['vud_comment_dimmed'] = array(
+    '#type'          => 'textfield',
+    '#title'         => t('Trigger point for dimmed comments'),
+    '#default_value' => variable_get('vud_comment_dimmed', '-5'),
+    '#description'   => t('Negatively voted comments will be dimmed once votes reach this point (default: -5).'),
+  );
 
   return system_settings_form($form);
 }
@@ -74,10 +80,23 @@ function vud_comment_comment(&$comment, 
     case 'view':
       $type = _vud_comment_get_node_type($comment->nid);
       $comment_allow = in_array($type, variable_get('vud_comment_node_types', array()), TRUE);
-      if ($comment_allow && user_access('use vote up/down on comments')) {
+      if ($comment_allow) {
         $tag = variable_get('vud_tag', 'vote');
-        $widget = variable_get('vud_comment_widget', 'plain');
-        $comment->comment = theme('vud_widget', $comment->cid, 'comment', $tag, $widget) . $comment->comment;
+        // Get the vote for this comment.
+        $result_criteria = array(
+          'content_type' => $type,
+          'content_id' => $comment->cid,
+          'value_type' => 'points',
+          'tag' => $tag,
+          'function' => 'sum'
+        );
+        $comment->vud_sum = (int) votingapi_select_single_result_value($result_criteria);
+
+        // Show a widget, if the user can vote.
+        if (user_access('use vote up/down on comments')) {
+          $widget = variable_get('vud_comment_widget', 'plain');
+          $comment->comment = theme('vud_widget', $comment->cid, 'comment', $tag, $widget) . $comment->comment;
+        }
       }
       break;
   }
