Greetings,

I recognize that the vote up/down module is intended by design to prevent a registered user to vote +1 more than once.

However, I have a use case that requires that a registered user be able to +1 the node more than once (and still retain the historical votes). Can anyone provide me any guidance on how to modify the code so that this can be done?

I'd really appreciate it.

Rob

Comments

marvil07’s picture

Version: 6.x-2.4 » 6.x-3.x-dev
Status: Active » Closed (duplicate)

I think this is pretty related with #813534: +N/-N votes on widgets, maybe when that is in place, you will not really would need to let vote more than once.

I will prefer that way because of how votingapi store the votes, so marking as duplicated of that issue.

Sizzly’s picture

Status: Closed (duplicate) » Active

I'm sorry to open this back up... But...

I recognize that this functionality isn't high priority. I could probably tweak the code myself if you could point me in the right direction. Where's the code for determining if a user can vote on a particular node or not?

If you could just point me in the direction of the vote validation code I'd be much appreciated.

Thanks.

Sizzly’s picture

Is it this bit o' code that prevents a second vote by a user?


if (!is_null($user_vote)) {
          $reset_token = drupal_get_token("votereset/node/$node->nid/$tag");
          $links['vud_node_votes_reset_link'] = array(
            'title' => t('Reset your vote'),
            'href'  => "votereset/node/$node->nid/$tag/$reset_token",
            'attributes' => array('rel' => 'nofollow'),
            'html'  => TRUE,
          );

I think it's the !is_null, right?

Sizzly’s picture

Should've read that better... IT's in vud.theme, right?

    // Do not allow vote with the same value
    if ( ($casted_vote > 0 && $value > 0) || ($casted_vote < 0 && $value < 0) ) {
      $value = FALSE;
    }

    if ($value !== FALSE) {
      $vote['value'] = $value;
      $vote['value_type'] = 'points';
      $tag = $tag ? $tag : variable_get('vud_tag', 'vote');
      $vote['tag'] = $tag;
      $vote['content_id'] = $content_id;
      $vote['content_type'] = $type;
      $votes = array(0 => $vote);
      drupal_alter('vud_votes', $votes);
      votingapi_set_votes($votes);
    }
marvil07’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev

No more features for 6.x-3.x now that it is the stable branch, moving to 7.x-1.x.

marvil07’s picture

Status: Active » Postponed

Postponed until basic port is ready.

marvil07’s picture

Issue summary: View changes
Status: Postponed » Closed (duplicate)
Related issues: +#813534: +N/-N votes on widgets