# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: nodereview/nodereview_node_nodereview.inc
--- nodereview/nodereview_node_nodereview.inc Base (1.6)
+++ nodereview/nodereview_node_nodereview.inc Locally Modified (Based On 1.6)
@@ -251,9 +251,6 @@
 function nodereview_view($node, $teaser = FALSE, $page = FALSE) {
   //$node = node_prepare($node, $teaser);
 
-  $aids = array_keys($node->reviews);
-  $num_aids = sizeof($aids);
-
   // Previews are just plain ugly, because the $node object is not really a node
   // but a mutated $_POST.  It has to be handled completely differently.
   if ($node->in_preview) {
@@ -278,8 +275,8 @@
     $node = node_prepare($node, $teaser);
 
     // Do a markup check on the fields
-    for ($i=0; $i < $num_aids; $i++) {
-      $node->reviews[$aids[$i]]->review = check_markup($node->reviews[$aids[$i]]->review);
+    foreach ($node->reviews as $review) {
+      $review->review = check_markup($review->review);
     }
 
     if ($teaser) {
@@ -300,6 +297,31 @@
   }
 }
 
+function nodereview_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
+  switch ($op) {
+    case 'view':
+      $votes_obj = votingapi_get_voting_results('node', $node->nid);
+      if ($votes_obj) {
+        $votes = array();
+        foreach ($votes_obj as $vote) {
+          if ($vote->function == 'average') $votes[$vote->tag] = $vote->value;
+        }
+
+        foreach ($votes as $tag => $value) {
+          $header[] = $tag;
+          $row[] = (NODEREVIEW_FIVESTAR_ENABLE) ?
+            theme('fivestar_static', $value, variable_get('nodereview_fivestar_stars', 5)):
+            $row[] = $value/10 . '/10';
+        }
+        $node->content['axes_tallies'] = array(
+          '#value' =>   $output = theme('table', $header, array($row), array('class'=>'axes_tallies')),
+          '#weight' => -10,
+        );
+      }
+      break;
+  }
+}
+
 /* ----- Theme functions ----- */
 
 function theme_nodereview_review_body($review, $node) {
