? .svn
? userpoints_all_drupal6x_btmash_0001.patch
? userpoints_all_drupal6x_btmash_0002.patch
? po/.svn
Index: userpoints.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints.info,v
retrieving revision 1.1.2.6.2.1
diff -u -F^f -r1.1.2.6.2.1 userpoints.info
--- userpoints.info	14 Oct 2007 18:29:40 -0000	1.1.2.6.2.1
+++ userpoints.info	26 Mar 2008 18:58:59 -0000
@@ -2,4 +2,4 @@
 name = Userpoints
 description = Users earn points as they post nodes, comments, and vote on nodes.
 package = Userpoints
-
+core = 6.x
Index: userpoints.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints.install,v
retrieving revision 1.2.2.7.2.13
diff -u -F^f -r1.2.2.7.2.13 userpoints.install
--- userpoints.install	31 Jan 2008 03:53:12 -0000	1.2.2.7.2.13
+++ userpoints.install	26 Mar 2008 18:58:59 -0000
@@ -2,84 +2,174 @@
 // $Id: userpoints.install,v 1.2.2.7.2.13 2008/01/31 03:53:12 kbahey Exp $
 
 /**
+ * Implementation of hook_schema().
+ */
+function userpoints_schema() {
+  $schema = array();
+  $schema['userpoints'] = array(
+    'description' => 'Holds the user points',
+    'fields' => array(
+      'pid' => array(
+        'description' => t('User ID'),
+        'type' => 'serial',
+        'not null' => TRUE,
+      ),
+      'uid' => array(
+        'description' => t('User ID'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'points' => array(
+        'description' => t('Current Points'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'max_points' => array(
+        'description' => t('Out of a maximum points'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'last_update' => array(
+        'description' => t('Timestamp'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'tid' => array(
+        'description' => t('Category ID'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'primary key' => array('pid'),
+    'indexes' => array(
+      'last_update' => array('last_update'),
+    ),
+  );
+  
+  $schema['userpoints_txn'] = array(
+    'description' => t('Userpoints Transactions'),
+    'fields' => array(
+      'txn_id' => array(
+        'description' => t('Transaction ID'),
+        'type' => 'serial',
+        'not null' => TRUE,
+      ),
+      'uid' => array(
+        'description' => t('User ID'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'approver_uid' => array(
+        'description' => t('Approving User ID'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'points' => array(
+        'description' => t('Points'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'time_stamp' => array(
+        'description' => t('Timestamp'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'status' => array(
+        'description' => t('Status'),
+        'type' => 'int',
+        'size' => 'tiny',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'description' => array(
+        'description' => t('Description'),
+        'type' => 'text',
+      ),
+      'reference' => array(
+        'description' => t('Reserved for module specific use'),
+        'type' => 'varchar',
+        'length' => 128,
+      ),
+      'expirydate' => array(
+        'description' => t('Expirydate'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'expired' => array(
+        'description' => t('User ID'),
+        'type' => 'int',
+        'size' => 'tiny',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'parent_txn_id' => array(
+        'description' => t('Parent Transaction ID'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'tid' => array(
+        'description' => t('Category ID'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'entity_id' => array(
+        'description' => t('ID of an entity in the Database'),
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'entity_type' => array(
+        'description' => t('Type of entity'),
+        'type' => 'varchar',
+        'length' => 32,
+      ),
+      'operation' => array(
+        'description' => t('Operation being carried out'),
+        'type' => 'varchar',
+        'length' => 32,
+      ),
+      
+    ),
+    'primary key' => array('txn_id'),
+    'indexes' => array(
+      'operation' => array('operation'),
+      'reference' => array('reference'),
+      'status' => array('status'),
+    )
+  );
+  return $schema;
+}
+
+/**
  * Install the initial schema.
  */
 function userpoints_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {userpoints} (
-          uid           INT(10) NOT NULL DEFAULT '0',
-          points        INT(10) NOT NULL DEFAULT '0',
-          max_points    INT(10) NOT NULL DEFAULT '0',
-          last_update   INT(11) NOT NULL DEFAULT '0',
-          tid           INT(11) NOT NULL default '0',
-          pid           INT(11) NOT NULL auto_increment,
-          PRIMARY KEY (pid),
-          KEY (last_update)
-        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      db_query("CREATE TABLE {userpoints_txn} (
-          txn_id        INT     NOT NULL AUTO_INCREMENT,
-          uid           INT(10) NOT NULL DEFAULT '0',
-          approver_uid  INT(10) NOT NULL DEFAULT '0',
-          points        INT(10) NOT NULL DEFAULT '0',
-          time_stamp    INT(11) NOT NULL DEFAULT '0',
-          status        INT(1) NOT NULL DEFAULT '0',
-          description   TEXT,
-          reference     varchar(128),
-          expirydate    int(11) NULL default '0',
-          expired       tinyint (1) NOT NULL default '0',
-          parent_txn_id int(11) NOT NULL default '0',
-          tid           INT(11) NOT NULL default '0',
-          entity_id     INT(11) default NULL, 
-          entity_type   varchar(32) default NULL, 
-          operation         VARCHAR(32),
-          PRIMARY KEY (txn_id),
-          KEY (operation),
-          KEY (reference),
-          KEY (status)
-        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
-
-    case 'pgsql':
-      db_query("CREATE TABLE {userpoints} (
-          uid           SERIAL,
-	        points        INTEGER NOT NULL default '0',
-	        max_points    INTEGER NOT NULL default '0',
-	        last_update   INTEGER NOT NULL default '0',
-	        PRIMARY KEY (uid)
-        );");
-      db_query("CREATE TABLE {userpoints_txn} (
-          txn_id        SERIAL,
-	        uid           INTEGER NOT NULL default '0',
-	        approver_uid  INTEGER NOT NULL default '0',
-	        points        INTEGER NOT NULL default '0',
-	        time_stamp    INTEGER NOT NULL default '0',
-	        status        INTEGER NOT NULL default '0',
-	        event         VARCHAR,
-	        description   VARCHAR,
-          expirydate    INTEGER NOT NULL default '0',
-          expired       BOOLEAN, 
-          parent_txn_id INTEGER NOT NULL default '0'
-	        PRIMARY KEY (txn_id)
-	      );");
-      break;
-  }
+  drupal_install_schema('userpoints');
 }
 
 /**
  * Implementation of hook_uninstall().
  */
 function userpoints_uninstall() {
-
+  drupal_uninstall_schema('userpoints');
+  db_query("DELETE FROM {variable} WHERE name like '%userpoints%'");
+  
   $vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module='userpoints'"));
   if ($vid) {
     taxonomy_del_vocabulary($vid);
   }
-
-  db_query('DROP TABLE {userpoints}');
-  db_query('DROP TABLE {userpoints_txn}');
-  db_query("DELETE FROM {variable} WHERE name like '%userpoints%'");
 }
 
 function userpoints_update_1() {
@@ -88,106 +178,55 @@ function userpoints_update_1() {
 
 function userpoints_update_2() {
   $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      // Add the max_points column
-      $ret[] = update_sql("ALTER TABLE {userpoints} ADD max_points INT(10) NOT NULL DEFAULT '0' AFTER points");
-      // Make the points column bigger
-      $ret[] = update_sql("ALTER TABLE {userpoints} CHANGE points points INT(10) NOT NULL DEFAULT '0'");
-      break;
-  }
+  db_add_field($ret, 'userpoints', 'max_points', array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'lenght' => 10));
+  db_change_field($ret, 'userpoints', 'points', 'points', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'lenght' => 10));
   return $ret;
 }
 
 function userpoints_update_3() {
   $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      // Add the description column
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn} ADD description TEXT AFTER event");
-      break;
-  }
+  db_add_field($ret, 'userpoints_txn', 'description', array('type' => 'text'));
   return $ret;
 }
 
 function userpoints_update_4() {
   $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      // Add the description column
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn} CHANGE event event VARCHAR(32)");
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn} CHANGE status status INTEGER NOT NULL DEFAULT '0' AFTER time_stamp");
-      break;
-  }
+  db_change_field($ret, 'userpoints_txn', 'event', 'event', array('type' => 'varchar', 'lenght' => 32 ));
+  db_change_field($ret, 'userpoints_txn', 'status', 'status', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0 ));
   return $ret;
 }
 
 function userpoints_update_5() {
   $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      // Add the reference column and its index
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn} ADD COLUMN reference VARCHAR(128) AFTER description");
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn} ADD INDEX reference (reference )");
-      break;
-  }
+  db_add_field($ret, 'userpoints_txn', 'reference', array('type' => 'varchar', 'lenght' => 128));
+  db_add_index($ret, 'userpoints_txn', 'reference', array('reference'));
   return $ret;
 }
 
 function userpoints_update_6() {
   $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn} 
-                         ADD expirydate INT(11) NOT NULL AFTER reference,
-                         ADD expired TINYINT(1) NOT NULL AFTER expirydate,
-                         ADD parent_txn_id INT NOT NULL AFTER expired,
-                         ADD tid INT NULL AFTER parent_txn_id
-                          ");
-      $ret[] = update_sql("ALTER TABLE {userpoints}
-                          DROP PRIMARY KEY
-                          ");
-      $ret[] = update_sql("ALTER TABLE {userpoints}
-                          ADD tid INT NULL AFTER last_update,
-                          ADD pid INT NOT NULL AUTO_INCREMENT PRIMARY KEY
-                          ");
-      break;
-  }
+  db_add_field($ret, 'userpoints_txn', 'expirydate', array('type' => 'int', 'lenght' => 11, 'not null' => true));
+  db_add_field($ret, 'userpoints_txn', 'expired', array('type' => 'int', 'lenght' => 1, 'not null' => true, 'size' => 'tiny'));
+  db_add_field($ret, 'userpoints_txn', 'parent_txn_id', array('type' => 'int'));
+  db_add_field($ret, 'userpoints_txn', 'tid', array('type' => 'int'));
+
+  db_drop_primary_key($ret, 'userpoints');
+
+  db_add_field($ret, 'userpoints', 'tid', array('type' => 'int'));
+  db_add_field($ret, 'userpoints', 'pid', array('type' => 'serial', 'not null' => true));
+  db_add_primary_key($ret, 'userpoints', 'pid');
   return $ret;
 }
 function userpoints_update_7() {
   $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn} 
-                         ADD entity_id INT(11) NULL AFTER tid,
-                         ADD entity_type VARCHAR(32) NULL AFTER entity_id
-                          ");
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn}
-			 CHANGE event operation VARCHAR(32) 
-                          ");
-      break;
-  }
+  db_add_field($ret, 'userpoints_txn', 'entity_id', array('type' => 'int', 'lenght' => 11, 'not null' => true));
+  db_add_field($ret, 'userpoints_txn', 'entity_type', array('type' => 'varchar', 'lenght' => 32));
+  db_change_field($ret, 'userpoints_txn', 'event', 'operation', array('type' => 'varchar'));
   return $ret;
 }
 function userpoints_update_8() {
   $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {userpoints_txn} 
-                         CHANGE tid tid INT(11) NOT NULL default '0'
-                          ");
-      $ret[] = update_sql("ALTER TABLE {userpoints} 
-                         CHANGE tid tid INT(11) NOT NULL default '0'
-                          ");
-      break;
-  }
+  db_change_field($ret, 'userpoints_txn', 'tid', 'tid', array('type' => 'int', 'not null' => true, 'default' => 0, 'lenght' => 11));
+  db_change_field($ret, 'userpoints', 'tid', 'tid', array('type' => 'int', 'not null' => true, 'default' => 0, 'lenght' => 11));
   return $ret;
 }
Index: userpoints.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints.module,v
retrieving revision 1.44.2.14.2.67
diff -u -F^f -r1.44.2.14.2.67 userpoints.module
--- userpoints.module	5 Mar 2008 05:43:58 -0000	1.44.2.14.2.67
+++ userpoints.module	26 Mar 2008 18:59:00 -0000
@@ -36,7 +36,6 @@
 define('USERPOINTS_CATEGORY_DEFAULT_VID', 'userpoints_category_default_vid');
 define('USERPOINTS_CATEGORY_DEFAULT_TID', 'userpoints_category_default_tid');
 
-
 /**
  * Purpose: Returns an array of common translation placeholders
  */
@@ -82,99 +81,99 @@ function userpoints_help($section) {
 /**
  * Implementation of hook_menu().
  */
-function userpoints_menu($may_cache) {
+function userpoints_menu() {
   $items = array();
-  global $user;
-
-  if ($may_cache) {
-    $items[] = array(
-      'path'     => 'admin/settings/userpoints',
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('userpoints_admin_settings'),
-      'title'    => t('!Points settings', userpoints_translation()),
-      'description' => t('Configure userpoints settings'),
-      'access'   => user_access(USERPOINTS_PERM_ADMIN),
-      'type'     => MENU_NORMAL_ITEM,
-    );
-
-    $items[] = array(
-      'path'     => 'admin/user/userpoints',
-      'callback' => 'userpoints_admin_points',
-      'title'    => t('!Points', userpoints_translation()),
-      'description' => t('Manage !points', userpoints_translation()),
-      'access'   => user_access(USERPOINTS_PERM_ADMIN),
-    );
-    $items[] = array(
-      'path'     => 'admin/user/userpoints/list',
-      'callback' => 'userpoints_admin_points',
-      'title'    => t('List'),
-      'description' => t('List users by !points', userpoints_translation()),
-      'access'   => user_access(USERPOINTS_PERM_VIEW),
-      'type'     => MENU_DEFAULT_LOCAL_TASK,
-      'weight'   => -2,
-    );
-    $items[] = array(
-      'path'     => 'admin/user/userpoints/moderate',
-      'callback' => 'userpoints_admin_manage',
-      'title'    => t('Moderation'),
-      'description' => t('Review !points in moderation', userpoints_translation()),
-      'access'   => user_access(USERPOINTS_PERM_ADMIN),
-      'type'     => MENU_LOCAL_TASK,
-      'weight'   => -1,
-    );
-    $items[] = array(
-      'path'     => 'admin/user/userpoints/add',
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('userpoints_admin_txn'),
-      'title'    => t('Add'),
-      'description' => t('Admin add/delete userpoints'),
-      'access'   => user_access(USERPOINTS_PERM_ADMIN),
-      'type'     => MENU_LOCAL_TASK,
-      'weight'   => 0,
-      );
-    
-    $items[] = array(
-      'path'     => 'admin/user/userpoints/edit',
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('userpoints_admin_txn'),
-      'access'   => user_access(USERPOINTS_PERM_ADMIN),
-      'type'     => MENU_CALLBACK,
-      );
-  
-    $items[] = array(
-      'path'     => 'admin/user/userpoints/approve',
-      'callback' => 'userpoints_admin_approve',
-      'access'   => user_access(USERPOINTS_PERM_ADMIN),
-      'type'     => MENU_CALLBACK,
-    );
+  $items['admin/settings/userpoints'] = array(
+    'title' => '!Points settings',
+    'title arguments' => userpoints_translation(),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('userpoints_admin_settings'),
+    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'type' => MENU_NORMAL_ITEM
+  );
+  $items['admin/user/userpoints'] = array(
+    'title' => '!Points',
+    'title arguments' => userpoints_translation(),
+    'description' => 'Manage !points',
+    'page callback' => 'userpoints_admin_points',
+    'access arguments' => array(USERPOINTS_PERM_ADMIN)
+  );
+  $items['admin/user/userpoints/list'] = array(
+    'title' => 'List',
+    'title arguments' => userpoints_translation(),
+    'description' => 'List users by points',
+    'access arguments' => array(USERPOINTS_PERM_VIEW),
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => -2,
+  );
+  $items['admin/user/userpoints/moderate'] = array(
+    'title' => 'Moderation',
+    'title arguments' => userpoints_translation(),
+    'description' => 'Review points in moderation',
+    'page callback' => 'userpoints_admin_points',
+    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => -1,
+  );
+  $items['admin/user/userpoints/add'] = array(
+    'title' => 'Add',
+    'description' => 'Admin add/delete userpoints',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('userpoints_admin_txn'),
+    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 0,
+  );
+  $items['admin/user/userpoints/edit'] = array(
+    'title' => 'Edit',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('userpoints_admin_txn'),
+    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'type' => MENU_CALLBACK
+  );
   
-    $items[] = array(
-      'path'     => 'admin/user/userpoints/decline',
-      'callback' => 'userpoints_admin_approve',
-      'access'   => user_access(USERPOINTS_PERM_ADMIN),
-      'type'     => MENU_CALLBACK,
-    );
-    $items[] = array(
-      'path' => 'userpoints',
-      'title'    => t('Users by !points', userpoints_translation()),
-      'callback' => 'userpoints_list_users',
-      'access' => user_access(USERPOINTS_PERM_VIEW),
-      'type' => MENU_NORMAL_ITEM,
-    );
-    $items[] = array(
-      'path' => 'myuserpoints',
-      'title' => t('My') .' '. t('!points', userpoints_translation()),
-      'callback' => 'userpoints_my_userpoints',
-      'access' => (user_access(USERPOINTS_PERM_VIEW) && $user->uid),
-      'type' => MENU_NORMAL_ITEM
-    );
+  $items['admin/user/userpoints/approve'] = array(
+    'title' => 'Approve Userpoints',
+    'page callback' => 'userpoints_admin_approve',
+    'access arguments' => user_access(USERPOINTS_PERM_ADMIN),
+    'type' => MENU_CALLBACK
+  );
+  $items['admin/user/userpoints/decline'] = array(
+    'title' => 'Approve Userpoints',
+    'page callback' => 'userpoints_admin_approve',
+    'access arguments' => user_access(USERPOINTS_PERM_ADMIN),
+    'type' => MENU_CALLBACK
+  );
   
-  }
+  $items['userpoints'] = array(
+    'title' => 'Users by !points',
+    'title arguments' => userpoints_translation(),
+    'page callback' => 'userpoints_list_users',
+    'access' => user_access(USERPOINTS_PERM_VIEW),
+    'type' => MENU_NORMAL_ITEM,
+  );
   
+  $items['myuserpoints'] = array(
+    'title' => 'My !points',
+    'title arguments' => userpoints_translation(),
+    'page callback' => 'userpoints_my_userpoints',
+    'access callback' => 'userpoints_access_my_points',
+    'type' => MENU_NORMAL_ITEM
+  );
   return $items;
 }
 
 /**
+ * Checks if user can access their points - used via hook_menu().
+ *
+ * @return true if user has permissions to view userpoints and if the user is logged in
+ */
+function userpoints_access_my_points() {
+  global $user;
+  return (user_access(USERPOINTS_PERM_VIEW) && user_is_logged_in());
+}
+
+/**
  * Implementation of hook_perm().
  */
 function userpoints_perm() {
@@ -182,6 +181,36 @@ function userpoints_perm() {
 }
 
 /**
+ * Implementation of hook_theme().
+ */
+function userpoints_theme() {
+  $themes = array();
+  $themes['userpoints_list_users'] = array(
+    'arguments' => array(
+      'header',
+      'rows',
+      'tid',
+      'pager_limit',
+    ),
+  );
+  $themes['userpoints_list_users_header'] = array(
+  );
+  $themes['userpoints_list_users_row'] = array(
+    'arguments' => array(
+      'row'
+    ),
+  );
+  $themes['userpoints_my_userpoints'] = array(
+    'arguments' => array(
+      'args',
+      'header',
+      'rows',
+    ),
+  );
+  return $themes;
+}
+
+/**
  * menu callback for settings form.
  */
 function userpoints_admin_settings() {
@@ -934,10 +963,12 @@ function userpoints_confirm_approve($ope
     );  
 }
        
-function userpoints_confirm_approve_submit($form_id, $form_values) {
+function userpoints_confirm_approve_submit($form, &$form_state) {
   global $user;
+  
+  $form_values = $form_state['values'];
 
-  switch ($form_values['operation']) {
+  switch ($form_state['clicked_button']['#value']) {
     case 'approve':
       $status = USERPOINTS_TXN_STATUS_APPROVED;
       break;
@@ -956,10 +987,10 @@ function userpoints_confirm_approve_subm
 
   userpoints_userpointsapi($params);
 
-  drupal_goto('admin/user/userpoints/moderate');
+  $form_state['redirect'] = 'admin/user/userpoints/moderate';
 }
 
-function userpoints_admin_txn() {
+function userpoints_admin_txn($form_state) {
   global $user;
 
   $mode = arg(3);
@@ -1133,49 +1164,51 @@ function userpoints_admin_txn() {
   return $form;
 }
 
-function userpoints_admin_txn_submit($form_id, $form = NULL) {
-  if ($form_id != 'userpoints_admin_txn') {
+function userpoints_admin_txn_submit($form, &$form_state) {
+  if ($form['form_id']['#value'] != 'userpoints_admin_txn') {
     return;
   }
 
-  $txn_user = user_load(array('name' => $form['txn_user']));
-  switch ($form['mode']) {
+  $form_values = $form_state['values'];
+
+  $txn_user = user_load(array('name' => $form_values['txn_user']));
+  switch ($form_values['mode']) {
     case 'add':
       $params = array(
-                  'points' => $form['points'],
+                  'points' => $form_values['points'],
                   'uid' => $txn_user->uid,
                   'operation' => 'admin',
-                  'description' => $form['description'],
-                  'reference' => $form['reference'],
-                  'tid' => $form['tid'],
+                  'description' => $form_values['description'],
+                  'reference' => $form_values['reference'],
+                  'tid' => $form_values['tid'],
                 );
-      if ($form['expirydate']) {
+      if ($form_values['expirydate']) {
         //Check for the existence of an expirydate 
-        $params['expirydate'] = strtotime($form['expirydate']);
+        $params['expirydate'] = strtotime($form_values['expirydate']);
       }
       userpoints_userpointsapi($params);
       break;
       
     case 'edit':
-      if ($form['expirydate']) {
-        $expirydate = strtotime($form['expirydate']);
+      if ($form_values['expirydate']) {
+        $expirydate = strtotime($$form_values['expirydate']);
       }
       $params = array(
-        'uid' => $form['txn_uid'],
-        'approver_id' => $form['approver_uid'],
-        'points' => $form['points'],
-        'time_stamp' => strtotime($form['time_stamp']),
-        'operation' => $form['operation'],
-        'description' => $form['description'],
-        'reference' => $form['reference'],
-        'status' => $form['status'],
+        'uid' => $form_values['txn_uid'],
+        'approver_id' => $form_values['approver_uid'],
+        'points' => $form_values['points'],
+        'time_stamp' => strtotime($form_values['time_stamp']),
+        'operation' => $form_values['operation'],
+        'description' => $form_values['description'],
+        'reference' => $form_values['reference'],
+        'status' => $form_values['status'],
         'expirydate' => $expirydate,
-        'txn_id' => $form['txn_id']
+        'txn_id' => $form_values['txn_id']
       );
       userpoints_userpointsapi($params);
   }
   
-  drupal_goto('admin/user/userpoints');
+  $form_state['redirect'] = 'admin/user/userpoints';
 }
 
 /*
@@ -1604,58 +1637,59 @@ function userpoints_my_userpoints() {
   $pager_limit = variable_get(USERPOINTS_REPORT_LIMIT, 10);
   $result = pager_query($sql, $pager_limit, 0, NULL, $uid);
   $stati = userpoints_txn_status();
-  if (db_num_rows($result) > 0) {
-    while ($row = db_fetch_object($result)) {
-      $status = $stati[$row->status];
-      if (!$row->cat) { 
-        $row->cat = t('!Uncategorized', userpoints_translation());
-      }
-      if ($row->description) {
-        $description = $row->description;
-      }
-      else {
-        $description = t('None');
-      }
-      $operation = module_invoke_all('userpoints', 'entity_type', $row);
+  
+  $num_rows = 0;
+  while ($row = db_fetch_object($result)) {
+    $num_rows++;
+    $status = $stati[$row->status];
+    if (!$row->cat) { 
+      $row->cat = t('!Uncategorized', userpoints_translation());
+    }
+    if ($row->description) {
+      $description = $row->description;
+    }
+    else {
+      $description = t('None');
+    }
+    $operation = module_invoke_all('userpoints', 'entity_type', $row);
 
-      if (!$operation) {
-        switch ($row->entity_type) {
-          case 'node' :
-            $node = node_load($row->entity_id);
-            if ($node) {
-              $operation = l($row->operation, 'node/'. $node->nid, array('title' => $node->title));
+    if (!$operation) {
+      switch ($row->entity_type) {
+        case 'node' :
+          $node = node_load($row->entity_id);
+          if ($node) {
+            $operation = l($row->operation, 'node/'. $node->nid, array('title' => $node->title));
+          }
+          else {
+            $operation = $row->operation;
+          }
+          break;
+        case 'comment' :
+          if (module_exists('comment')) {
+            //We have to load the comment to get the nid for the comment
+            $comment = _comment_load($row->entity_id);
+            if ($comment) {
+              $operation = l($row->operation, 'node/'. $comment->nid, array('title' => $comment->subject), NULL, 'comment-'. $comment->cid);
             }
             else {
               $operation = $row->operation;
             }
-            break;
-          case 'comment' :
-            if (module_exists('comment')) {
-              //We have to load the comment to get the nid for the comment
-              $comment = _comment_load($row->entity_id);
-              if ($comment) {
-                $operation = l($row->operation, 'node/'. $comment->nid, array('title' => $comment->subject), NULL, 'comment-'. $comment->cid);
-              }
-              else {
-                $operation = $row->operation;
-              }
-            }
-            break;
-          default:
-            $operation = $row->operation;
-        }
+          }
+          break;
+        default:
+          $operation = $row->operation;
       }
-      $rows[] = array(
-          array('data' => $row->points, 'align' => 'center'),
-          array('data' => $status, 'align' => 'center'),
-          array('data' => format_date($row->time_stamp, 'small'), 'align' => 'center'),
-          array('data' => $operation),
-          array('data' => $row->cat),
-          array('data' => $description),
-      );
     }
+    $rows[] = array(
+        array('data' => $row->points, 'align' => 'center'),
+        array('data' => $status, 'align' => 'center'),
+        array('data' => format_date($row->time_stamp, 'small'), 'align' => 'center'),
+        array('data' => $operation),
+        array('data' => $row->cat),
+        array('data' => $description),
+    );
   }
-  else {
+  if ($num_rows <= 0) {
     $rows[] = array(
           array('data' => t('No !Points earned', userpoints_translation()), 'colspan' => 5, 'align' => 'center')
     );
@@ -1672,7 +1706,8 @@ function userpoints_my_userpoints() {
 function userpoints_get_vid() {
   //code lovingly inspired by the image.module w/ code by drewish
   $vid = variable_get(USERPOINTS_CATEGORY_DEFAULT_VID, '');
-  if (empty($vid) || !taxonomy_get_vocabulary($vid)) {
+  var_dump($vid);
+  if (empty($vid) || !taxonomy_vocabulary_load($vid)) {
     $sql = "SELECT vid FROM {vocabulary} WHERE module='userpoints'";
     $vid = db_result(db_query($sql));
     if (!$vid) {
@@ -1702,15 +1737,16 @@ function userpoints_get_vid() {
  * Purposes: returns an array of possible categories, suitable for inclusion in FAPI
  */
 function userpoints_get_categories() {
-  $vid = userpoints_get_vid();
   //Create the "Uncategorized" category
   $options = array();
   $options[0] = t('!Uncategorized', userpoints_translation());
-
-  if ($vid) {
-    $tree = taxonomy_get_tree($vid, 0, -1, 1);
-    foreach ($tree as $term) {
-      $options[$term->tid] = $term->name;  
+  if (module_exists('taxonomy')) {
+    $vid = userpoints_get_vid();
+    if ($vid) {
+      $tree = taxonomy_get_tree($vid, 0, -1, 1);
+      foreach ($tree as $term) {
+        $options[$term->tid] = $term->name;  
+      }
     }
   }
   return $options;
Index: userpoints_basic.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints_basic.info,v
retrieving revision 1.1.2.7.2.2
diff -u -F^f -r1.1.2.7.2.2 userpoints_basic.info
--- userpoints_basic.info	14 Oct 2007 16:45:06 -0000	1.1.2.7.2.2
+++ userpoints_basic.info	26 Mar 2008 18:59:00 -0000
@@ -2,4 +2,5 @@
 name = Userpoints Basic
 description = Userpoints for core Drupal, such as posting nodes and comments, and moderating comments.
 package = Userpoints
-dependencies = userpoints
+dependencies[] = userpoints
+core = 6.x
Index: userpoints_views.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints_views.info,v
retrieving revision 1.1
diff -u -F^f -r1.1 userpoints_views.info
--- userpoints_views.info	27 Dec 2007 22:01:22 -0000	1.1
+++ userpoints_views.info	26 Mar 2008 18:59:00 -0000
@@ -1,5 +1,7 @@
 ; $Id: userpoints_views.info,v 1.1 2007/12/27 22:01:22 kbahey Exp $
 name = Views Integration
 description = Adds userpoints related fields, sorts and filters to views. Benefits from the usernode module being installed, although not required.
-dependencies = userpoints views
+dependencies[] = userpoints
+dependencies[] = views
 package = Userpoints
+core = 6.x
\ No newline at end of file
Index: userpoints_workflow_ng.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints_workflow_ng.info,v
retrieving revision 1.1
diff -u -F^f -r1.1 userpoints_workflow_ng.info
--- userpoints_workflow_ng.info	5 Jan 2008 17:41:45 -0000	1.1
+++ userpoints_workflow_ng.info	26 Mar 2008 18:59:00 -0000
@@ -1,6 +1,7 @@
 ; $Id: userpoints_workflow_ng.info,v 1.1 2008/01/05 17:41:45 kbahey Exp $
 name = Userpoints Workflow-NG integration
 description = Provides integration of Userpoints with Workflow-NG
-dependencies = userpoints workflow_ng
+dependencies[] = userpoints 
+dependencies[] = workflow_ng
 package = Userpoints
-
+core = 6.x
