Index: fivestar.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fivestar/fivestar.module,v
retrieving revision 1.13.2.39
diff -u -r1.13.2.39 fivestar.module
--- fivestar.module	21 Sep 2008 05:07:46 -0000	1.13.2.39
+++ fivestar.module	24 Sep 2008 01:10:48 -0000
@@ -666,13 +666,15 @@
  *   A content-type to log the vote to. 'node' is the most common.
  * @param cid
  *   A content id to log the vote to. This would be a node ID, a comment ID, etc.
+ * @param tag
+ *   Multi-axis tag to allow multiple votes per node. 'vote' is the most common.
  * @param value
  *   A value from 1-100, representing the vote cast for the content.
  * @return
  *  An XML chunk containing the results of the vote, for use by the client-side
  *  javascript code.
  */
-function fivestar_vote($type, $cid, $value, $tag = 'vote') {
+function fivestar_vote($type, $cid, $tag, $value) {
 
   $result = _fivestar_cast_vote($type, $cid, $value, $tag, NULL, TRUE);
   votingapi_recalculate_results($type, $cid);
@@ -709,6 +711,7 @@
   $output .= '<value>'. $value .'</value>';
   $output .= '<type>'. $type .'</type>';
   $output .= '<id>'. $cid .'</id>';
+  $output .= '<tag>'. $tag .'</tag>';
   $output .= '</vote></xml>';
 
   drupal_set_header("Content-Type: text/xml");
@@ -879,7 +882,7 @@
           case 'below_static':
             $stars = variable_get('fivestar_stars_'. $node->type, 5);
             $node->content['fivestar_widget'] = array(
-              '#value' => fivestar_static('node', $node->nid, $node->type),
+              '#value' => fivestar_static('node', $node->nid, NULL, $node->type),
               '#weight' => strpos($position, 'above') === 0 ? -10 : 50,
             );
             break;
@@ -987,6 +990,7 @@
     'text' => variable_get('fivestar_text_'. $node->type, 'dual'),
     'content_type' => $content_type,
     'content_id' => $content_id,
+    'tag' => 'vote',
     'autosubmit' => TRUE,
     'title' => variable_get('fivestar_title_'. $node->type, 1) ? NULL : FALSE,
     'feedback_enable' => variable_get('fivestar_feedback_'. $node->type, 1),
@@ -997,7 +1001,7 @@
   return fivestar_custom_widget($form_state, $values, $settings);  
 }
 
-function fivestar_static($content_type, $content_id, $node_type = NULL) {
+function fivestar_static($content_type, $content_id, $tag = 'vote', $node_type = NULL) {
   global $user;
 
   $criteria = array(
@@ -1007,7 +1011,7 @@
     'tag' => 'vote',
   );
 
-  $votes = fivestar_get_votes($content_type, $content_id);
+  $votes = fivestar_get_votes($content_type, $content_id, $tag);
 
   if ($content_type == 'node') {
     // Content type should always be passed to avoid this node load.
@@ -1103,13 +1107,14 @@
     '#vote_count' => $values['count'],
     '#vote_average' => $values['average'],
     '#auto_submit' => isset($settings['autosubmit']) ? $settings['autosubmit'] : TRUE,
-    '#auto_submit_path' => (!isset($settings['autosubmit']) || $settings['autosubmit']) ? 'fivestar/vote/'. $settings['content_type'] .'/'. $settings['content_id'] : NULL,
+    '#auto_submit_path' => (!isset($settings['autosubmit']) || $settings['autosubmit']) ? 'fivestar/vote/'. $settings['content_type'] .'/'. $settings['content_id'] .'/'. $settings['tag'] : NULL,
     '#allow_clear' => $settings['allow_clear'],
     '#content_id' => isset($settings['content_id']) ? $settings['content_id'] : NULL,
     '#required' => isset($settings['required']) ? $settings['required'] : FALSE,
     '#feedback_enable' => isset($settings['feedback_enable']) ? $settings['feedback_enable'] : TRUE,
     '#labels_enable' => isset($settings['labels_enable']) ? $settings['labels_enable'] : TRUE,
     '#labels' => isset($settings['labels']) ? $settings['labels'] : NULL,
+    '#tag' => isset($settings['tag']) ? $settings['tag'] : 'vote',
   );
 
   $form['destination'] = array(
@@ -1167,7 +1172,7 @@
       $form['vote']['#default_value'] = $values['user'];
       $form['vote']['#attributes']['class'] .= ' fivestar-combo-stars';
       $form['#attributes']['class'] .= ' fivestar-combo-stars';
-      $static_average = theme('fivestar_static', $values['average'], $settings['stars']);
+      $static_average = theme('fivestar_static', $values['average'], $settings['stars'], $settings['tag']);
       if ($settings['text'] == 'none' && !$settings['labels_enable'] && !$settings['feedback_enable']) {
         $static_description = NULL;
       }
@@ -1288,8 +1293,12 @@
     unset($form['vote']['#description']);
   }
 
+  $class = 'fivestar-form';
+  $class .= '-'. (isset($form['vote']['#tag']) ? $form['tag']['#tag'] : 'vote');
+  $class .= '-'. (isset($form['content_id']['#value']) ? $form['content_id']['#value'] : 0);
+
   $output  = '';
-  $output .= '<div class="fivestar-form-'. (isset($form['content_id']['#value']) ? $form['content_id']['#value'] : 0) .' clear-block">';
+  $output .= '<div class="'. $class .' clear-block">';
   $output .= drupal_render($form);
   $output .= '</div>';
   return $output;
@@ -1303,16 +1312,18 @@
  *   The desired rating to display out of 100 (i.e. 80 is 4 out of 5 stars)
  * @param $stars
  *   The total number of stars this rating is out of
+ * @param $tag
+ *   Allows multiple ratings per node
  * @return
  *   A themed HTML string representing the star widget
  * 
  */
-function theme_fivestar_static($rating, $stars = 5) {
+function theme_fivestar_static($rating, $stars = 5, $tag = 'vote') {
   // Add necessary CSS.
   fivestar_add_css();
 
   $output = '';
-  $output .= '<div class="fivestar-widget-static fivestar-widget-static-'. $stars .' clear-block">';
+  $output .= '<div class="fivestar-widget-static fivestar-widget-static-'. $tag .' fivestar-widget-static-'. $stars .' clear-block">';
   $numeric_rating = $rating/(100/$stars);
   for ($n=1; $n <= $stars; $n++) {
     $star_value = ceil((100/$stars) * $n);
@@ -1551,7 +1562,8 @@
   else {
     $stars = 5;
   }
-  return theme('fivestar_static', $value, $stars);
+  // TODO: Find a reliable way of determining the tag.
+  return theme('fivestar_static', $value, $stars, 'vote');
 }
 
 function fivestar_views_widget_compact_handler($value, $field, $columns) {
@@ -1567,7 +1579,8 @@
     $content_type = 'node';
     $content_id = $columns->nid;
     $node_type = isset($columns->node_type) ? $query->node_type : db_result(db_query("SELECT type FROM {node} WHERE nid = %d", $columns->nid));
-  
+
+    // TODO: Find a reliable way of finding the current tag.
     $votes = fivestar_get_votes($content_type, $content_id);
 
     $values = array(
Index: js/fivestar.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fivestar/js/Attic/fivestar.js,v
retrieving revision 1.1.4.6
diff -u -r1.1.4.6 fivestar.js
--- js/fivestar.js	26 Apr 2008 18:30:03 -0000	1.1.4.6
+++ js/fivestar.js	24 Sep 2008 01:10:48 -0000
@@ -233,6 +233,7 @@
             },
             vote: {
               id: $("vote id", data).text(),
+	      tag: $("vote tag", data).text(),
               type: $("vote type", data).text(),
               value: $("vote value", data).text()
             },
@@ -318,13 +319,14 @@
      * voteResult.result.summary.user The textual description of the user's current vote.
      * voteResult.vote.id The id of the item the vote was placed on (such as the nid)
      * voteResult.vote.type The type of the item the vote was placed on (such as 'node')
+     * voteResult.vote.tag The multi-axis tag the vote was placed on (such as 'vote')
      * voteResult.vote.average The average of the new vote saved
      * voteResult.display.stars The type of star display we're using. Either 'average', 'user', or 'combo'.
      * voteResult.display.text The type of text display we're using. Either 'average', 'user', or 'combo'.
      */
     function fivestarDefaultResult(voteResult) {
       // Update the summary text.
-      $('div.fivestar-summary-'+voteResult.vote.id).html(voteResult.result.summary[voteResult.display.text]);
+      $('div.fivestar-summary-'+voteResult.vote.tag+'-'+voteResult.vote.id).html(voteResult.result.summary[voteResult.display.text]);
       // If this is a combo display, update the average star display.
       if (voteResult.display.stars == 'combo') {
         $('div.fivestar-form-'+voteResult.vote.id).each(function() {
