### Eclipse Workspace Patch 1.0 #P vote_up_down Index: vote_up_down.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/vote_up_down/vote_up_down.module,v retrieving revision 1.16.2.3 diff -u -r1.16.2.3 vote_up_down.module --- vote_up_down.module 9 Jan 2008 15:46:33 -0000 1.16.2.3 +++ vote_up_down.module 18 Jan 2008 21:21:08 -0000 @@ -249,12 +249,13 @@ * Implementation of hook_link(). */ function vote_up_down_link($type, $node = NULL, $teaser = FALSE) { + global $user; $links = array(); switch ($type) { case 'node': $node_type = in_array($node->type, variable_get('vote_up_down_node_types', array()), TRUE); if ($node_type && user_access('view up-down vote')) { - if (variable_get('vote_up_down_reset_vote', 0) && user_access('use up-down vote')) { + if (variable_get('vote_up_down_reset_vote', 0) && user_access('use up-down vote') && votingapi_get_user_votes('node', $node->nid, $user->uid)) { $links['vote_up_down_reset'] = array( 'title' => t('Reset vote'), 'href' => "vote_up_down/$type/$node->nid/0", @@ -271,7 +272,7 @@ } break; case 'comment': - if (variable_get('vote_up_down_reset_vote', 0) && user_access('use up-down vote') && (variable_get('vote_up_down_widget_comment', 0) || variable_get('vote_up_down_link_comment', 0))) { + if (variable_get('vote_up_down_reset_vote', 0) && user_access('use up-down vote') && votingapi_get_user_votes('comment', $node->cid, $user->uid) && (variable_get('vote_up_down_widget_comment', 0) || variable_get('vote_up_down_link_comment', 0))) { $links['vote_up_down_reset_c'] = array( 'title' => t('Reset vote'), 'href' => "vote_up_down/$type/$node->cid/0",