You are here

function vote_up_down_userpoints in Vote Up/Down 5

Same name and namespace in other branches
  1. 6 vote_up_down.module \vote_up_down_userpoints()

Implementation of hook_userpoints().

File

./vote_up_down.module, line 295
vote_up_down is a module that adds a widget for +1/-1 votes on nodes. It depends upon Voting API. It's based upon "simplevote.module".

Code

function vote_up_down_userpoints($op, $points = 0, $uid = 0, $event = NULL, $description = NULL) {
  switch ($op) {
    case 'setting':
      $form['vote_updown_points'] = array(
        '#type' => 'fieldset',
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#title' => t('Vote up/down points'),
      );
      $form['vote_updown_points']['userpoints_vote_up_down'] = array(
        '#type' => 'textfield',
        '#title' => t('Points for voting on a node (requires the Vote up/down module)'),
        '#default_value' => variable_get('userpoints_vote_up_down', 0),
        '#size' => 5,
        '#maxlength' => 5,
      );
      $form['vote_updown_points']['userpoints_actions'] = array(
        '#type' => 'textfield',
        '#title' => t('Points for actions (requires the Actions module)'),
        '#default_value' => variable_get('userpoints_actions', 0),
        '#size' => 5,
        '#maxlength' => 5,
      );
      return $form;
      break;
  }
}