Can I do this programmatically or using rules/actions/trigger modules?
no possible now, take a look to #467220: Integration with rules
There is an outstanding issue to provide Rules support for Voting API (and hence Vote Up/Down). See #467220: Integration with rules.
In the meantime, you can always write yourself a custom action, probably using the votingapi_set_votes() API directly. Something like:
$vote = array(); $vote['content_type'] = 'node'; $vote['content_id'] = $node->nid; // the node id $vote['value'] = 1; // or -1 $vote['value_type'] = 'points'; $vote['tag'] = variable_get('vud_tag', 'vote'); $votes = array(0 => $vote); drupal_alter('vud_votes', $votes); votingapi_set_votes($votes);
Marking as duplicate of the Rules request, okay?
Thank you very much. I will give it a shot.
Tried the code piece and it is working fine. Thanks for the help.
make it findable :-p
Comments
Comment #1
marvil07 commentedno possible now, take a look to #467220: Integration with rules
Comment #2
lyricnz commentedThere is an outstanding issue to provide Rules support for Voting API (and hence Vote Up/Down). See #467220: Integration with rules.
In the meantime, you can always write yourself a custom action, probably using the votingapi_set_votes() API directly. Something like:
Marking as duplicate of the Rules request, okay?
Comment #3
lyricnz commentedComment #4
chandrabhan commentedThank you very much. I will give it a shot.
Comment #5
chandrabhan commentedTried the code piece and it is working fine. Thanks for the help.
Comment #6
marvil07 commentedmake it findable :-p