Index: vote_up_down.module
===================================================================
--- vote_up_down.module	(revision 1)
+++ vote_up_down.module	(working copy)
@@ -128,27 +128,6 @@
   return $form;
 }
 
-/**
- * Implementation of hook_form_alter().
- */
-function vote_up_down_form_alter($form_id, &$form) {
-  if ($form_id == 'userpoints_settings_form') {
-    $form['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['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,
-    );
-  }
-}
 
 /**
  * Implementation of hook_menu().
@@ -268,17 +247,43 @@
 /**
  * Implementation of hook_userpoints().
  */
-function vote_up_down_userpoints($points, $uid = NULL) {
-  // If userpoints module exists, award points
-  if (module_exist('userpoints')) {
-    if ($uid == NULL) {
-      global $user;
-      $uid = $user->uid;
+function vote_up_down_userpoints ($op, $points=0, $uid=0, $event=null, $description=null) {
+    if ($op == 'points') {
+        if ($uid == NULL) {
+          global $user;
+          $uid = $user->uid;
+        }
+        userpoints_userpointsapi('points', $points, $uid, 'Vote up/down points');
     }
-    userpoints_userpoints($points, $uid, 'Vote up/down points');
-  }
-}
+  
+    if ($op == '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;
+    }
+}  
 
+
 /*
  * Menu callback; Handles admin/vote_up_down and subpages.
  */
@@ -381,7 +386,7 @@
       $node = db_fetch_object(db_query(db_rewrite_sql('SELECT n.uid FROM {node} n WHERE n.nid = %d'), $cid));
       $user_vote = votingapi_get_user_votes($type, $cid);
       if (!$user_vote && ($node->uid != $user->uid) && $vote->value != 0) {
-        vote_up_down_userpoints(variable_get('userpoints_vote_up_down', 0));
+        vote_up_down_userpoints('points', variable_get('userpoints_vote_up_down', 0));
       }
     }
 
