Index: vote_up_down.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/vote_up_down/vote_up_down.module,v
retrieving revision 1.24.2.33
diff -u -r1.24.2.33 vote_up_down.module
--- vote_up_down.module	9 Aug 2009 00:14:41 -0000	1.24.2.33
+++ vote_up_down.module	31 Aug 2009 08:28:25 -0000
@@ -275,13 +275,21 @@
  * Implementation of hook_link().
  */
 function vote_up_down_link($type, $node = NULL, $teaser = FALSE) {
+  $tag = variable_get('vote_up_down_tag', 'vote');
   $links = array();
   switch ($type) {
     case 'node':
+      $criteria = array(
+        'content_type' => $type,
+        'content_id' => $node->nid,
+        'uid' => _vote_up_down_get_uid(),
+        'tag' => $tag,
+      );
+      $user_vote = votingapi_select_single_vote_value($criteria);
       $node_type = in_array($node->type, variable_get('vote_up_down_node_types', array()), TRUE);
       $style = variable_get('vote_up_down_widget_style_node', 0) == 1 ? '_alt' : '';
       if ($node_type && user_access('view up/down votes')) {
-        if (variable_get('vote_up_down_reset_vote', 0) && ((user_access('use vote up')) || (user_access('use vote down')))) {
+        if (variable_get('vote_up_down_reset_vote', 0) && ((user_access('use vote up')) || (user_access('use vote down'))) && $user_vote) {
           $token = drupal_get_token("vote_up_down/$type/$node->nid/0");
           $links['vote_up_down_reset'] = array(
             'title' => t('Reset vote'),
@@ -305,7 +313,14 @@
       }
       break;
     case 'comment':
-      if (variable_get('vote_up_down_reset_vote', 0) && (user_access('use vote up') || user_access('use vote down')) && (variable_get('vote_up_down_widget_comment', 0) || variable_get('vote_up_down_link_comment', 0))) {
+      $criteria = array(
+        'content_type' => $type,
+        'content_id' => $node->cid,
+        'uid' => _vote_up_down_get_uid(),
+        'tag' => $tag,
+      );
+      $user_vote = votingapi_select_single_vote_value($criteria);
+      if (variable_get('vote_up_down_reset_vote', 0) && (user_access('use vote up') || user_access('use vote down')) && (variable_get('vote_up_down_widget_comment', 0) || variable_get('vote_up_down_link_comment', 0)) && $user_vote) {
         $token = drupal_get_token("vote_up_down/$type/$node->cid/0");
         $links['vote_up_down_reset_c'] = array(
           'title' => t('Reset vote'),

