Index: nodereview.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodereview/nodereview.module,v
retrieving revision 1.5.2.4
diff -u -r1.5.2.4 nodereview.module
--- nodereview.module	14 Apr 2008 17:31:41 -0000	1.5.2.4
+++ nodereview.module	18 Apr 2008 03:10:21 -0000
@@ -1,6 +1,8 @@
 <?php
 // $Id: nodereview.module,v 1.5.2.4 2008/04/14 17:31:41 johnforsythe Exp $
 
+define('NODEREVIEW_FIVESTAR_ENABLE', module_exists('fivestar') && variable_get('nodereview_fivestar_enable', 0));
+
 require_once(
   drupal_get_path('module', 'nodereview') . '/nodereview_node_nodereview.inc'
 );
@@ -304,6 +306,29 @@
     '#options' => $options,
     '#description' => t('Specify which content types can be reviewed.'),
   );
+
+  if (module_exists('fivestar')) {
+    $form['fivestar'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Fivestar options'),
+      '#collapsible' => FALSE,
+      '#collapsed' => FALSE,
+      '#tree' => TRUE,
+    );
+    $form['fivestar']['enable'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use Fivestar for reviews'),
+      '#default_value' => variable_get('nodereview_fivestar_enable', 0),
+      '#description' => t('Enabling Fivestar for reviews will replace select list options with a JavaScript star display.'),
+    );
+    $form['fivestar']['stars'] = array(
+      '#type' => 'select',
+      '#title' => t('Number of stars'),
+      '#options' => drupal_map_assoc(range(1, 10)),
+      '#default_value' => variable_get('nodereview_fivestar_stars', 5),
+    );
+  }
+
   $form['submit'] = array(
     '#type' => 'submit', 
     '#value' => t('Save'),
@@ -320,6 +345,9 @@
   foreach ($form_values['types'] as $type => $checked) {
     variable_set('nodereview_use_'. $type, (bool)$checked);
   }
+  foreach ($form_values['fivestar'] as $option => $value) {
+    variable_set('nodereview_fivestar_'. $option, $value);
+  }
 }
 
 
Index: nodereview_node_nodereview.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodereview/nodereview_node_nodereview.inc,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 nodereview_node_nodereview.inc
--- nodereview_node_nodereview.inc	14 Apr 2008 17:31:41 -0000	1.6.2.1
+++ nodereview_node_nodereview.inc	18 Apr 2008 03:10:21 -0000
@@ -119,6 +119,12 @@
     '#description' => $axis->description,
     '#required' => TRUE,
   );
+
+  if (variable_get('nodereview_fivestar_enable', 0)) {
+    $form['reviews'][$axis->aid]['score']['#type'] = 'fivestar';
+    $form['reviews'][$axis->aid]['score']['#stars'] = variable_get('nodereview_fivestar_stars', 5);
+  }
+
   $form['reviews'][$axis->aid]['review'] = array(
     '#type' => 'textarea',
     '#title' => t('Review'),
@@ -306,8 +312,13 @@
   $output = '';
 
   $title = $review->tag;
-  $title .= ': ' . $review->score/10 . '/10';
-  $output .= theme('box', $title, $review->review);
+  if (NODEREVIEW_FIVESTAR) {
+    $output = theme('fivestar_static', $review->score, variable_get('nodereview_fivestar_stars', 5));
+  }
+  else {
+    $title .= ': ' . $review->score/10 . '/10';
+  }
+  $output = theme('box', $title, $output . $review->review);
 
   return $output;
 }
@@ -316,8 +327,13 @@
   $output = '';
 
   $title = $review['tag'];
-  $title .= ': ' . $review['score']/10 . '/10';
-  $output .= theme('box', $title, check_markup($review['review'], $node->format));
+  if (NODEREVIEW_FIVESTAR) {
+    $output = theme('fivestar_static', $review['score']);
+  }
+  else {
+    $title .= ': ' . $review['score']/10 . '/10';
+  }
+  $output = theme('box', $title, $output . check_markup($review['review'], $node->format));
 
   return $output;
 }
@@ -335,7 +351,12 @@
   foreach ($node->reviews as $review) {
     $row = array();
     $row[] = $review->tag;
-    $row[] = $review->score/10 . '/10';
+    if (NODEREVIEW_FIVESTAR) {
+      $row[] = theme('fivestar_static', $review->score, variable_get('nodereview_fivestar_stars', 5));
+    }
+    else {
+      $row[] = $review->score/10 . '/10';
+    }
     $review_text = truncate_utf8($review->review, 50, TRUE, TRUE);
     $row[] = substr($review_text, 0, strpos($review_text, "\n"));
     $rows[] = $row;
