? fivestar-value-type.patch
Index: fivestar.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fivestar/fivestar.module,v
retrieving revision 1.32
diff -u -p -r1.32 fivestar.module
--- fivestar.module	3 Nov 2009 04:34:29 -0000	1.32
+++ fivestar.module	3 Feb 2011 04:07:24 -0000
@@ -311,7 +311,7 @@ function _fivestar_cast_vote($type, $cid
     }
 
     // Get the user's current vote.
-    $criteria = array('content_type' => $type, 'content_id' => $cid, 'tag' => $tag, 'uid' => $uid);
+    $criteria = array('content_type' => $type, 'content_id' => $cid, 'tag' => $tag, 'uid' => $uid, 'value_type' => variable_get('fivestar_value_type', 'percent'));
     // Get the unique identifier for the user (IP Address if anonymous).
     $user_criteria = votingapi_current_user_identifier();
     $user_votes = votingapi_select_votes($criteria + $user_criteria);
@@ -358,7 +358,7 @@ function fivestar_get_votes($type, $cid,
   $criteria = array(
     'content_type' => $type,
     'content_id' => $cid,
-    'value_type' => 'percent',
+    'value_type' => variable_get('fivestar_value_type', 'percent'),
     'tag' => $tag,
   );
 
@@ -705,7 +705,7 @@ function fivestar_static($content_type, 
   $criteria = array(
     'content_type' => $content_type,
     'content_id' => $content_id,
-    'value_type' => 'percent',
+    'value_type' => variable_get('fivestar_value_type', 'percent'),
     'tag' => 'vote',
   );
 
Index: includes/fivestar.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fivestar/includes/fivestar.admin.inc,v
retrieving revision 1.2
diff -u -p -r1.2 fivestar.admin.inc
--- includes/fivestar.admin.inc	11 May 2009 15:56:23 -0000	1.2
+++ includes/fivestar.admin.inc	3 Feb 2011 04:07:24 -0000
@@ -58,21 +58,27 @@ function fivestar_settings() {
     '#attributes' => array('class' => 'fivestar-widgets'),
   );
 
-  $form['tags'] = array(
+  $form['votingapi_settings'] = array(
     '#tree' => FALSE,
     '#type' => 'fieldset',
-    '#title' => t('Voting tags'),
-    '#description' => t('Choose the voting tags that will be available for node rating. A tag is simply a category of vote. If you only need to rate one thing per node, leave this as the default "vote".'),
+    '#title' => t('VotingAPI settings'),
+    '#description' => t('Choose the VotingAPI value_type and tags that will be available for node rating. A tag is simply a category of vote. If you only need to rate one thing per node, leave this as the default "vote".'),
     '#weight' => 3,
    );
 
-  $form['tags']['tags'] = array(
+  $form['votingapi_settings']['tags'] = array(
     '#type' => 'textfield',
     '#title' => t('Tags'),
     '#default_value' => variable_get('fivestar_tags', 'vote'),
     '#required' => TRUE,
     '#description' => t('Separate multiple tags with commas.'),
    );
+   $form['votingapi_settings']['fivestar_value_type'] = array(
+     '#type' => 'textfield',
+     '#title' => t('Value type'),
+     '#description' => t("The default value for this setting is 'percent'. Don't change this unless you understand what you're doing."),
+     '#default_value' => variable_get('fivestar_value_type', 'percent'),
+   );
 
   $form['color'] = fivestar_color_form();
   $form['#validate'][] = 'fivestar_color_form_validate';
@@ -92,7 +98,7 @@ function fivestar_settings_submit($form,
   // TODO We could delete all variables for removed tags
   variable_set('fivestar_tags', $form_state['values']['tags']);
   variable_set('fivestar_widget', $form_state['values']['fivestar_widget']);
-
+  variable_set('fivestar_value_type', $form_state['values']['fivestar_value_type']);
   // Rebuild the menu in case tags were changed
   menu_rebuild();
 }
