function action_vote_up_down_userpoints_remove in Vote Up/Down 5
Same name and namespace in other branches
- 6 vote_up_down_actions.inc \action_vote_up_down_userpoints_remove()
Implementation of a Drupal action. Deduct userpoint from node author.
File
- ./
vote_up_down_actions.inc, line 124 - Contains Drupal actions and actions sets for use with vote_up_down.module and the Voting API..
Code
function action_vote_up_down_userpoints_remove($op, $edit = array(), &$node) {
switch ($op) {
case 'metadata':
return array(
'description' => t('Deduct userpoint from node author (Vote up/down)'),
'type' => t('Node'),
'batchable' => FALSE,
'configurable' => FALSE,
);
case 'do':
userpoints_userpointsapi('points', -variable_get('userpoints_actions', 0), $node->uid);
watchdog('action', t('Deducted userpoint from author of node id %id', array(
'%id' => intval($node->nid),
)));
break;
// return an HTML config form for the action
case 'form':
return '';
// validate the HTML form
case 'validate':
return TRUE;
// process the HTML form to store configuration
case 'submit':
return '';
}
}