? userpoints_no_defines.patch
Index: userpoints.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints.module,v
retrieving revision 1.67.2.1
diff -u -p -r1.67.2.1 userpoints.module
--- userpoints.module	27 Mar 2008 13:54:20 -0000	1.67.2.1
+++ userpoints.module	6 Apr 2008 23:54:26 -0000
@@ -3,52 +3,23 @@
 
 // Copyright 2005-2007 Khalid Baheyeldin http://2bits.com
 
-define('USERPOINTS_PERM_VIEW',           'view userpoints');
-//The permission(PERM_USE) was removed from use as per #158490 it'll remain 
-//out until code exists to use the permission (jredding 12/26/2007)
-define('USERPOINTS_PERM_USE',            'use userpoints');
-define('USERPOINTS_PERM_ADMIN',          'admin userpoints');
-
-define('USERPOINTS_TRANS_UCPOINTS',      'userpoints_trans_ucpoints');
-define('USERPOINTS_TRANS_LCPOINTS',      'userpoints_trans_lcpoints');
-define('USERPOINTS_TRANS_LCPOINT',       'userpoints_trans_lcpoint');
-define('USERPOINTS_TRANS_UNCAT',         'userpoints_trans_uncat');
-
-define('USERPOINTS_STATUS',              'userpoints_status');
-
-define('USERPOINTS_POINTS_MODERATION',    'userpoints_points_moderation');
-
 define('USERPOINTS_TXN_STATUS_APPROVED',  0);
 define('USERPOINTS_TXN_STATUS_PENDING',   1);
 define('USERPOINTS_TXN_STATUS_DECLINED',  2);
 
-
-define('USERPOINTS_EXPIRY_DESCRIPTION', 'userpoints_expiry_description');
-define('USERPOINTS_EXPIREON_DATE', 'userpoints_expireon_date');
-define('USERPOINTS_EXPIREAFTER_DATE', 'userpoints_expireafter_date');
-define('USERPOINTS_DISPLAY_MESSAGE', 'userpoints_display_message');
-
-define('USERPOINTS_REPORT_USERCOUNT', 'userpoints_report_usercount');
-define('USERPOINTS_REPORT_LIMIT', 'userpoints_report_limit');
-define('USERPOINTS_REPORT_DISPLAYZERO', 'userpoints_report_displayzero');
-
-define('USERPOINTS_CATEGORY_NAME', 'Userpoints');
-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
  */
 function userpoints_translation() {
   static $trans;
-  
+
   if (!isset($trans)) {
     $trans = array(
-      '!Points' => variable_get(USERPOINTS_TRANS_UCPOINTS, 'Points'),
-      '!points' => variable_get(USERPOINTS_TRANS_LCPOINTS, 'points'),
-      '!point'  => variable_get(USERPOINTS_TRANS_LCPOINT, 'point'),
-      '!Uncategorized'  => variable_get(USERPOINTS_TRANS_UNCAT, 'Uncategorized'),
-      );
+      '!Points' => variable_get('userpoints_trans_ucpoints', 'Points'),
+      '!points' => variable_get('userpoints_trans_lcpoints', 'points'),
+      '!point'  => variable_get('userpoints_trans_lcpoint', 'point'),
+      '!Uncategorized'  => variable_get('userpoints_trans_uncat', 'Uncategorized'),
+    );
   }
   return $trans;  
 }
@@ -58,10 +29,10 @@ function userpoints_translation() {
  */
 function userpoints_txn_status() {
   return array(
-      USERPOINTS_TXN_STATUS_APPROVED => t('Approved'),
-      USERPOINTS_TXN_STATUS_PENDING  => t('Pending'),
-      USERPOINTS_TXN_STATUS_DECLINED => t('Declined'),
-      );
+    USERPOINTS_TXN_STATUS_APPROVED => t('Approved'),
+    USERPOINTS_TXN_STATUS_PENDING  => t('Pending'),
+    USERPOINTS_TXN_STATUS_DECLINED => t('Declined'),
+  );
 }
 
 /**
@@ -88,7 +59,7 @@ function userpoints_menu() {
     'title arguments' => userpoints_translation(),
     'page callback' => 'drupal_get_form',
     'page arguments' => array('userpoints_admin_settings'),
-    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'access arguments' => array('admin userpoints'),
     'type' => MENU_NORMAL_ITEM
   );
   $items['admin/user/userpoints'] = array(
@@ -96,13 +67,13 @@ function userpoints_menu() {
     'title arguments' => userpoints_translation(),
     'description' => strtr('Manage !points', userpoints_translation()),
     'page callback' => 'userpoints_admin_points',
-    'access arguments' => array(USERPOINTS_PERM_ADMIN)
+    'access arguments' => array('admin userpoints')
   );
   $items['admin/user/userpoints/list'] = array(
     'title' => 'List',
     'title arguments' => userpoints_translation(),
     'description' => strtr('List users by !points', userpoints_translation()),
-    'access arguments' => array(USERPOINTS_PERM_VIEW),
+    'access arguments' => array('view userpoints'),
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => -2,
   );
@@ -111,7 +82,7 @@ function userpoints_menu() {
     'title arguments' => userpoints_translation(),
     'description' => strtr('Review !points in moderation', userpoints_translation()),
     'page callback' => 'userpoints_admin_manage',
-    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'access arguments' => array('admin userpoints'),
     'type' => MENU_LOCAL_TASK,
     'weight' => -1,
   );
@@ -120,7 +91,7 @@ function userpoints_menu() {
     'description' => 'Admin add/delete userpoints',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('userpoints_admin_txn'),
-    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'access arguments' => array('admin userpoints'),
     'type' => MENU_LOCAL_TASK,
     'weight' => 0,
   );
@@ -128,20 +99,20 @@ function userpoints_menu() {
     'title' => 'Edit',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('userpoints_admin_txn'),
-    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'access arguments' => array('admin userpoints'),
     'type' => MENU_CALLBACK
   );
   
   $items['admin/user/userpoints/approve'] = array(
     'title' => 'Approve Userpoints',
     'page callback' => 'userpoints_admin_approve',
-    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'access arguments' => array('admin userpoints'),
     'type' => MENU_CALLBACK
   );
   $items['admin/user/userpoints/decline'] = array(
     'title' => 'Approve Userpoints',
     'page callback' => 'userpoints_admin_approve',
-    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'access arguments' => array('admin userpoints'),
     'type' => MENU_CALLBACK
   );
   
@@ -149,7 +120,7 @@ function userpoints_menu() {
     'title' => 'Users by !points',
     'title arguments' => userpoints_translation(),
     'page callback' => 'userpoints_list_users',
-    'access arguments' => array(USERPOINTS_PERM_VIEW),
+    'access arguments' => array('view userpoints'),
     'type' => MENU_NORMAL_ITEM,
   );
   
@@ -170,14 +141,14 @@ function userpoints_menu() {
  */
 function userpoints_access_my_points() {
   global $user;
-  return (user_access(USERPOINTS_PERM_VIEW) && user_is_logged_in());
+  return (user_access('view userpoints') && user_is_logged_in());
 }
 
 /**
  * Implementation of hook_perm().
  */
 function userpoints_perm() {
-  return array(USERPOINTS_PERM_VIEW, USERPOINTS_PERM_ADMIN);
+  return array('view userpoints', 'admin userpoints');
 }
 
 /**
@@ -224,10 +195,10 @@ function userpoints_admin_settings() {
     '#weight' => -1,
   );
 
-  $form[$group][USERPOINTS_POINTS_MODERATION] = array(
+  $form[$group]['userpoints_points_moderation'] = array(
     '#type'          => 'radios',
     '#title'         => t('Transaction status'),
-    '#default_value' => variable_get(USERPOINTS_POINTS_MODERATION, 0),
+    '#default_value' => variable_get('userpoints_points_moderation', 0),
     '#options'       => array(t('Approved'), t('Moderated')),
     '#description'   => t('Select whether all !points should be approved automatically, or moderated, and require admin approval', userpoints_translation()),
   );
@@ -240,33 +211,33 @@ function userpoints_admin_settings() {
     '#title' => t('Points branding'),
   );
   
-  $form[$group][USERPOINTS_TRANS_UCPOINTS] = array(
+  $form[$group]['userpoints_trans_ucpoints'] = array(
   '#type' => 'textfield',
   '#title' => t('Word to use in the interface for the upper case plural word !Points', userpoints_translation()),
-  '#default_value' => variable_get(USERPOINTS_TRANS_UCPOINTS, 'Points'),
+  '#default_value' => variable_get('userpoints_trans_ucpoints', 'Points'),
   '#size' => 20,
   '#maxlength' => 20,
   );
   
-  $form[$group][USERPOINTS_TRANS_LCPOINTS] = array(
+  $form[$group]['userpoints_trans_lcpoints'] = array(
   '#type' => 'textfield',
   '#title' => t('Word to use in the interface for the lower case plural word !points', userpoints_translation()),
-  '#default_value' => variable_get(USERPOINTS_TRANS_LCPOINTS, 'points'),
+  '#default_value' => variable_get('userpoints_trans_lcpoints', 'points'),
   '#size' => 20,
   '#maxlength' => 20,
   );
   
-  $form[$group][USERPOINTS_TRANS_LCPOINT] = array(
+  $form[$group]['userpoints_trans_lcpoint'] = array(
   '#type' => 'textfield',
   '#title' => t('Word to use in the interface for the lower case singular word !point', userpoints_translation()),
-  '#default_value' => variable_get(USERPOINTS_TRANS_LCPOINT, 'point'),
+  '#default_value' => variable_get('userpoints_trans_lcpoint', 'point'),
   '#size' => 20,
   '#maxlength' => 20,
   );
-  $form[$group][USERPOINTS_TRANS_UNCAT] = array(
+  $form[$group]['userpoints_trans_uncat'] = array(
   '#type' => 'textfield',
   '#title' => t('Word to use for the uncategorized category'),
-  '#default_value' => variable_get(USERPOINTS_TRANS_UNCAT, 'Uncategorized'),
+  '#default_value' => variable_get('userpoints_trans_uncat', 'Uncategorized'),
   '#size' => 20,
   '#maxlength' => 20,
   );
@@ -281,13 +252,13 @@ function userpoints_admin_settings() {
                        '),
   );
 
-  $form[$group][USERPOINTS_EXPIREAFTER_DATE] = array(
+  $form[$group]['userpoints_expireafter_date'] = array(
     '#type' => 'select',
     '#title' => t('Expire !points after', userpoints_translation()),
     '#description' => t('Once points have been obtained by the user 
                           they will expire according to this setting'),
     '#options' => expiry_dates(),
-    '#default_value' => variable_get(USERPOINTS_EXPIREAFTER_DATE, NULL),
+    '#default_value' => variable_get('userpoints_expireafter_date', NULL),
   );
 
   /**
@@ -298,19 +269,19 @@ function userpoints_admin_settings() {
    *
    */
   $warning="";
-  if (userpoints_date_to_timestamp(variable_get(USERPOINTS_EXPIREON_DATE, array('day' => 1, 'month' => 1, 'year' => 1900))) < time()) {
+  if (userpoints_date_to_timestamp(variable_get('userpoints_expireon_date', array('day' => 1, 'month' => 1, 'year' => 1900))) < time()) {
     $warning = '<br /><strong>'. t('This setting will not take affect, date must be in the future') .'</strong>';
   }
 
-  $form[$group][USERPOINTS_EXPIREON_DATE] = array(
+  $form[$group]['userpoints_expireon_date'] = array(
     '#type' => 'date',
     '#title' => t('Expire !points on this date', userpoints_translation()),
     '#description' => t('Once points have been obtained by the user they will 
                          last until this date. This setting overrides the 
                          "Expire after setting" above'. $warning),
-    '#default_value' => variable_get(USERPOINTS_EXPIREON_DATE, array('day' => 1, 'month' => 1, 'year' => 1980)),
+    '#default_value' => variable_get('userpoints_expireon_date', array('day' => 1, 'month' => 1, 'year' => 1980)),
   );
-  $form[$group][USERPOINTS_EXPIRY_DESCRIPTION] = array(
+  $form[$group]['userpoints_expiry_description'] = array(
     '#type' => 'textarea',
     '#title' => t('Expiration entry description'),
     '#description' => t('A negating expiration entry is made to expire 
@@ -326,7 +297,7 @@ function userpoints_admin_settings() {
                          <br/> !description = Original description for the point 
                          <br /> !txn_id Original transaction ID 
                          <br /> !date = Date of the original entry'),
-    '#default_value' => variable_get(USERPOINTS_EXPIRY_DESCRIPTION, ''),
+    '#default_value' => variable_get('userpoints_expiry_description', ''),
   );
 
   $group = "misc";
@@ -338,10 +309,10 @@ function userpoints_admin_settings() {
     '#description' => t('Control the behavior of messages users see. '),
   );
 
-  $form[$group][USERPOINTS_DISPLAY_MESSAGE] = array(
+  $form[$group]['userpoints_display_message'] = array(
     '#type'          => 'radios',
     '#title'         => t('Display message'),
-    '#default_value' => variable_get(USERPOINTS_DISPLAY_MESSAGE, 1),
+    '#default_value' => variable_get('userpoints_display_message', 1),
     '#options'       => array(0 => t('No'), 1 => t('Yes')),
     '#description'   => t('Determines if a message should be displayed whenever !points are awarded/substracted ', userpoints_translation()),
   );
@@ -354,24 +325,24 @@ function userpoints_admin_settings() {
     '#description' => t(''),
   );
 
-  $form[$group][USERPOINTS_REPORT_LIMIT] = array(
+  $form[$group]['userpoints_report_limit'] = array(
     '#type'          => 'select',
     '#title'         => t('Transactions per page'),
-    '#default_value' => variable_get(USERPOINTS_REPORT_LIMIT, 10),
+    '#default_value' => variable_get('userpoints_report_limit', 10),
     '#options'       => array(10 => 10, 20 => 20, 30 => 30, 40 => 40, 50 => 50, 100 => 100),
     '#description'   => t('Limits the number of transactions displayed per page'), 
   );
-  $form[$group][USERPOINTS_REPORT_DISPLAYZERO] = array(
+  $form[$group]['userpoints_report_displayzero'] = array(
     '#type'          => 'radios',
     '#title'         => t('Display zero !point users?', userpoints_translation()),
-    '#default_value' => variable_get(USERPOINTS_REPORT_DISPLAYZERO, 1),
+    '#default_value' => variable_get('userpoints_report_displayzero', 1),
     '#options'       => array(t('No'), t('Yes')),
     '#description'   => t('If set to "No" users with zero !points will not be displayed in the reports ', userpoints_translation()),
   );
-  $form[$group][USERPOINTS_REPORT_USERCOUNT] = array(
+  $form[$group]['userpoints_report_usercount'] = array(
     '#type'          => 'select',
     '#title'         => t('Users per page'),
-    '#default_value' => variable_get(USERPOINTS_REPORT_USERCOUNT, 30),
+    '#default_value' => variable_get('userpoints_report_usercount', 30),
     '#options'       => array(10 => 10, 20 => 20, 30 => 30, 40 => 40, 50 => 50, 100 => 100),
     '#description'   => t('When listing !points by user limit how many users are displayed on a single page', userpoints_translation()), 
   );
@@ -389,13 +360,13 @@ function userpoints_admin_settings() {
       '#collapsed' => TRUE,
       '#title' => t('!Points Categorization', userpoints_translation()),
     );
-    $form[$group][USERPOINTS_CATEGORY_DEFAULT_TID] = array(
+    $form[$group]['userpoints_category_default_tid'] = array(
       '#type' => 'select',
       '#title' => t('Default Category'),
-      '#default_value' => variable_get(USERPOINTS_CATEGORY_DEFAULT_TID, NULL),
+      '#default_value' => variable_get('userpoints_category_default_tid', NULL),
       '#options' =>  userpoints_get_categories(),
       '#description' => t('By default all points are assigned to this category.  You can modify what categories are available by modifying the <a href="!url">Userpoints taxonomy</a>', 
-        array('!url' => url('admin/content/taxonomy/'. variable_get(USERPOINTS_CATEGORY_DEFAULT_VID, '')))),
+        array('!url' => url('admin/content/taxonomy/'. variable_get('userpoints_category_default_vid', '')))),
     );
   }
 
@@ -500,7 +471,7 @@ function userpoints_userpointsapi($param
     }
     if (!isset($params['moderate'])) {
       //if not passed then site default is used
-      $params['status'] = variable_get(USERPOINTS_POINTS_MODERATION, 0);
+      $params['status'] = variable_get('userpoints_points_moderation', 0);
     }
     else {
       if ($params['moderate'] == true) {
@@ -512,7 +483,7 @@ function userpoints_userpointsapi($param
     }
     if (!isset($params['tid']) || !is_numeric($params['tid'])) {
       //if not passed then site default is used
-      $params['tid'] = variable_get(USERPOINTS_CATEGORY_DEFAULT_TID, NULL);
+      $params['tid'] = variable_get('userpoints_category_default_tid', NULL);
     }
     if (!isset($params['entity_id'])) { 
       $params['entity_id'] = NULL; 
@@ -591,7 +562,7 @@ function userpoints_userpointsapi($param
         ))));
   } //if $params['status']
 
-  if ($mesg && ($params['display'] || ($params['display'] === null && variable_get(USERPOINTS_DISPLAY_MESSAGE, 1) == 1))) {
+  if ($mesg && ($params['display'] || ($params['display'] === null && variable_get('userpoints_display_message', 1) == 1))) {
     drupal_set_message($mesg);
   }
   // Call the _userpoints hook to allow modules to act after points are awarded
@@ -626,7 +597,7 @@ function _userpoints_transaction(&$param
     }
     if (!isset($params['moderate'])) {
       //if not passed then site default is used
-      $params['status'] = variable_get(USERPOINTS_POINTS_MODERATION, 0);
+      $params['status'] = variable_get('userpoints_points_moderation', 0);
     }
     else {
       if ($params['moderate'] == true) {
@@ -646,7 +617,7 @@ function _userpoints_transaction(&$param
       $params['reference'] = NULL; 
     }
     if (!isset($params['tid']) || !is_numeric($params['tid'])) {
-      $params['tid'] = variable_get(USERPOINTS_CATEGORY_DEFAULT_TID, NULL);
+      $params['tid'] = variable_get('userpoints_category_default_tid', NULL);
     }
     elseif ($params['tid'] == 0) {
       //tid with 0 are uncategorized and are set to NULL
@@ -772,9 +743,9 @@ function _userpoints_update_cache(&$para
  * Returns: timestamp
  */
 function userpoints_get_default_expiry_date() {
-  $expirydate = userpoints_date_to_timestamp(variable_get(USERPOINTS_EXPIREON_DATE, NULL));
+  $expirydate = userpoints_date_to_timestamp(variable_get('userpoints_expireon_date', NULL));
   if ($expirydate < time()) {
-    $expirydate = variable_get(USERPOINTS_EXPIREAFTER_DATE, NULL);
+    $expirydate = variable_get('userpoints_expireafter_date', NULL);
     if ($expirydate) { 
       $expirydate = time() + $expirydate; 
     }
@@ -818,10 +789,10 @@ function userpoints_user($op, &$edit, &$
     case 'view':
       // Get the points for the user
       $points = userpoints_get_current_points($account->uid);
-      if (user_access(USERPOINTS_PERM_ADMIN)) {
+      if (user_access('admin userpoints')) {
         $points = l($points, 'admin/user/userpoints/add/'. $account->uid, array('title' => t('Manage points')));
       }
-      if (user_access(USERPOINTS_PERM_VIEW)) {
+      if (user_access('view userpoints')) {
         $disp_points[] = array(
           'title' => t('User !points', userpoints_translation()),
           'value' => $points,
@@ -868,7 +839,7 @@ function userpoints_admin_manage() {
   drupal_set_title(t($cat) ." ". t("!points", userpoints_translation()));
 
   $sql .= tablesort_sql($header);
-  $pager_limit = variable_get(USERPOINTS_REPORT_USERCOUNT, 30);
+  $pager_limit = variable_get('userpoints_report_usercount', 30);
   $result = pager_query($sql, $pager_limit, 0, NULL, USERPOINTS_TXN_STATUS_PENDING, $tid);
     while ($data = db_fetch_object($result)) {
       $user = user_load(array('uid' => $data->uid));
@@ -1062,7 +1033,7 @@ function userpoints_admin_txn($form_stat
     $form['tid'] = array(
       '#type' => 'select',
       '#title' => t('Category'),
-      '#default_value' => variable_get(USERPOINTS_CATEGORY_DEFAULT_TID, 0),
+      '#default_value' => variable_get('userpoints_category_default_tid', 0),
       '#options' =>  userpoints_get_categories(),
       '#description' => t('Category to apply these points to'),
     );
@@ -1242,7 +1213,7 @@ function userpoints_admin_points() {
               WHERE tid = %d
               ";
 
-  if (variable_get(USERPOINTS_REPORT_DISPLAYZERO, 1) == 0 ) {
+  if (variable_get('userpoints_report_displayzero', 1) == 0 ) {
     //The user would NOT like to see users with zero points
     $sql .= " AND p.points <> 0";
     $sql_cnt .= " AND points <> 0";
@@ -1255,7 +1226,7 @@ function userpoints_admin_points() {
     array('data' => t('!Points', userpoints_translation()), 'field' => 'p.points', 'sort' => 'desc'),
   );
   $sql .= tablesort_sql($header);
-  $pager_limit = variable_get(USERPOINTS_REPORT_USERCOUNT, 30);
+  $pager_limit = variable_get('userpoints_report_usercount', 30);
   $result = pager_query($sql, $pager_limit, 0, $sql_cnt, $tid);
   while ($data = db_fetch_object($result)) {
     if (!$data->cat) {
@@ -1315,7 +1286,7 @@ function userpoints_list_users() {
               WHERE tid = %d
               ";
 
-  if (variable_get(USERPOINTS_REPORT_DISPLAYZERO, 1) == 0 ) {
+  if (variable_get('userpoints_report_displayzero', 1) == 0 ) {
     //The user would NOT like to see users with zero points
     $sql .= " AND p.points <> 0";
     $sql_cnt .= " AND points <> 0";
@@ -1323,7 +1294,7 @@ function userpoints_list_users() {
   $sql .= " GROUP BY p.uid, u.name, p.points, p.tid, t.name";
   $header = theme('userpoints_list_users_header');
   $sql .= tablesort_sql($header);
-  $pager_limit = variable_get(USERPOINTS_REPORT_USERCOUNT, 30);
+  $pager_limit = variable_get('userpoints_report_usercount', 30);
   $result = pager_query($sql, $pager_limit, 0, $sql_cnt, $tid);
   while ($data = db_fetch_object($result)) {
     $rows[] = theme('userpoints_list_users_row', $data);
@@ -1428,7 +1399,7 @@ function userpoints_block($op = 'list', 
       return $blocks;
 
     case 'view':
-      if (user_access(USERPOINTS_PERM_VIEW)) {
+      if (user_access('view userpoints')) {
         if ($delta == -1) {
           $title = t('@user\'s !points', array_merge(array('@user' => $user->name), userpoints_translation()));;
           if ($user->uid) {
@@ -1531,7 +1502,7 @@ function userpoints_expire_transactions(
   $results = db_query($sql, time());
   while ($line = db_fetch_array($results)) {
     $line['time_stamp'] = format_date($line['time_stamp'], 'custom', 'Y-m-d H:i'); 
-    $description = t(variable_get(USERPOINTS_EXPIRY_DESCRIPTION, NULL), 
+    $description = t(variable_get('userpoints_expiry_description', NULL), 
       array_merge(userpoints_translation(), 
       array('!operation' => $line['operation'], 
         '!description' => $line['description'], 
@@ -1582,7 +1553,7 @@ function userpoints_my_userpoints() {
     $uid = $user->uid;
   }
   $point_user = user_load(array('uid' => $uid));
-  if ($point_user && user_access(USERPOINTS_PERM_VIEW)) { 
+  if ($point_user && user_access('view userpoints')) { 
     $title = t('!Points for ', userpoints_translation()) . $point_user->name;
     drupal_set_title($title);
   } 
@@ -1634,7 +1605,7 @@ function userpoints_my_userpoints() {
            LEFT JOIN {term_data} t on p.tid = t.tid
            WHERE p.uid = %d";
   $sql .= tablesort_sql($header);
-  $pager_limit = variable_get(USERPOINTS_REPORT_LIMIT, 10);
+  $pager_limit = variable_get('userpoints_report_limit', 10);
   $result = pager_query($sql, $pager_limit, 0, NULL, $uid);
   $stati = userpoints_txn_status();
   
@@ -1705,7 +1676,7 @@ 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, '');
+  $vid = variable_get('userpoints_category_default_vid', '');
   if (empty($vid) || !taxonomy_vocabulary_load($vid)) {
     $sql = "SELECT vid FROM {vocabulary} WHERE module='userpoints'";
     $vid = db_result(db_query($sql));
@@ -1713,7 +1684,7 @@ function userpoints_get_vid() {
       drupal_set_message(t("Created Userpoints vocabulary"));
       //No vocabulary exists, we'll create one 
       $vocab = array(
-        'name' => t(USERPOINTS_CATEGORY_NAME),
+        'name' => t('Userpoints'),
         'description' => t('Automatically created by the userpoints module'),
         'multiple' => '0',
         'required' => '0',
@@ -1724,7 +1695,7 @@ function userpoints_get_vid() {
       taxonomy_save_vocabulary($vocab);
       $vid = $vocab['vid'];
     }
-    variable_set(USERPOINTS_CATEGORY_DEFAULT_VID, $vid);
+    variable_set('userpoints_category_default_vid', $vid);
   }
   if (!is_numeric($vid)) {
     watchdog('userpoints', t('userpoints module was unable to select or create a vocabulary. Points will be uncategorized'), WATCHDOG_ERROR);
@@ -1755,14 +1726,14 @@ function userpoints_get_categories() {
  * Wrapper function to return the default tid via API call
  */
 function userpoints_get_default_tid() {
-  variable_get(USERPOINTS_CATEGORY_DEFAULT_TID, NULL);
+  variable_get('userpoints_category_default_tid', NULL);
 }
 
 /*
  * Purpose: Allow my_userpoints to be themeable
  */
 function theme_userpoints_my_userpoints($args, $header, $rows) {
-  $pager_limit = variable_get(USERPOINTS_REPORT_LIMIT, 10);
+  $pager_limit = variable_get('userpoints_report_limit', 10);
   $output  = theme('table', $header, $rows);
   $output .= "<p>";
   if ($args['subtotals']) {
Index: userpoints_basic.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints_basic.module,v
retrieving revision 1.10
diff -u -p -r1.10 userpoints_basic.module
--- userpoints_basic.module	26 Mar 2008 20:12:43 -0000	1.10
+++ userpoints_basic.module	6 Apr 2008 23:54:26 -0000
@@ -4,12 +4,6 @@
 
 // Copyright 2005 Khalid Baheyeldin http://2bits.com
 
-define('USERPOINTS_POST',                'userpoints_post_');
-define('USERPOINTS_POST_COMMENT',        'userpoints_post_comment');
-define('USERPOINTS_MODERATE_COMMENT',    'userpoints_moderate_comment');
-//define a variable to trigger the use of the v2bug please read drupal.org/node/183520
-define('USERPOINTS_USE_V2BUG',    'userpoints_use_v2bug');
-
 function userpoints_basic_help($section) {
   switch ($section) {
     case 'admin/settings/userpoints_basic':
@@ -30,34 +24,34 @@ function userpoints_basic_userpoints($op
         '#title'       => t('!Points for basic events', userpoints_translation()),
       );
       
-      $form[$group][USERPOINTS_POST . '_undo_points_on_delete'] = array(
+      $form[$group]['userpoints_post__undo_points_on_delete'] = array(
         '#type'          => 'checkbox',
         '#title'         => t('Take away !points on node delete', array_merge(userpoints_translation())),
-        '#default_value' => variable_get(USERPOINTS_POST . '_undo_points_on_delete', true),
+        '#default_value' => variable_get('userpoints_post__undo_points_on_delete', true),
         );
         
       foreach (node_get_types() as $type => $name) {
-        $form[$group][USERPOINTS_POST . $type] = array(
+        $form[$group]['userpoints_post_' . $type] = array(
           '#type'          => 'textfield',
           '#title'         => t('!Points for posting a !node-name', array_merge(userpoints_translation(), array('!node-name' => $name->name))),
-          '#default_value' => variable_get(USERPOINTS_POST . $type, '0'),
+          '#default_value' => variable_get('userpoints_post_' . $type, '0'),
           '#size'          => 5,
           '#maxlength'     => 5,
           );
       }
 
-      $form[$group][USERPOINTS_POST_COMMENT] = array(
+      $form[$group]['userpoints_post_comment'] = array(
         '#type'          => 'textfield',
         '#title'         => t('!Points for posting a comment', userpoints_translation()),
-        '#default_value' => variable_get(USERPOINTS_POST_COMMENT, 0),
+        '#default_value' => variable_get('userpoints_post_comment', 0),
         '#size'          => 5,
         '#maxlength'     => 5,
         );
 
-      $form[$group][USERPOINTS_MODERATE_COMMENT] = array(
+      $form[$group]['userpoints_moderate_comment'] = array(
         '#type'          => 'textfield',
         '#title'         => t('!Points for moderating a comment', userpoints_translation()),
-        '#default_value' => variable_get(USERPOINTS_MODERATE_COMMENT, 0),
+        '#default_value' => variable_get('userpoints_moderate_comment', 0),
         '#size'          => 5,
         '#maxlength'     => 5,
         );
@@ -82,10 +76,10 @@ function userpoints_basic_userpoints($op
                              3) You have read <a href="http://drupal.org/node/183520">Article 183520</a> on drupal.org and 
                                 understand that there could be unusual issues with ownership moves', userpoints_translation()),
       );
-      $form[$group][USERPOINTS_USE_V2BUG] = array(
+      $form[$group]['userpoints_use_v2bug'] = array(
         '#type'          => 'checkbox',
         '#title'         => t('I agree to the above description and want to use the V2 bug fix'),
-        '#default_value' => variable_get(USERPOINTS_USE_V2BUG, false),
+        '#default_value' => variable_get('userpoints_use_v2bug', false),
       );
 
       return $form;
@@ -96,7 +90,7 @@ function userpoints_basic_userpoints($op
 function userpoints_nodeapi(&$node, $op, $teaser, $page) {
   //static up_orig_uid please read drupal.org/node/183520 
   static $up_orig_uid;
-  $points = variable_get(USERPOINTS_POST . $node->type, 0);
+  $points = variable_get('userpoints_post_' . $node->type, 0);
   switch ($op) {
     case 'insert':
       $params = array(
@@ -109,7 +103,7 @@ function userpoints_nodeapi(&$node, $op,
       userpoints_userpointsapi($params);
       break;
     case 'delete':
-      if (variable_get(USERPOINTS_POST . '_undo_points_on_delete', true)) {
+      if (variable_get('userpoints_post__undo_points_on_delete', true)) {
         $points = -$points;
         $params = array(
           'points' => $points,
@@ -161,7 +155,7 @@ function userpoints_nodeapi(&$node, $op,
         //We failed to pull a matching operation via the DB
         //If the user wants to use the V2BUG we'll use it..
         //please read drupal.org/node/183520
-        if (variable_get(USERPOINTS_USE_V2BUG, false)) {
+        if (variable_get('userpoints_use_v2bug', false)) {
           if ($node->uid != $up_orig_uid) {
             // Add to the new node owner
             $params = array(
@@ -193,7 +187,7 @@ function userpoints_comment($comment, $o
   //static up_orig_uid, please read this thread http://drupal.org/node/183520
   static $up_orig_com_uid;
 
-  $points = variable_get(USERPOINTS_POST_COMMENT, 0);
+  $points = variable_get('userpoints_post_comment', 0);
   switch ($op) {
     case 'insert':
       $params = array(
@@ -217,7 +211,7 @@ function userpoints_comment($comment, $o
       userpoints_userpointsapi($params);
       break;
     case 'moderate':
-      $points = variable_get(USERPOINTS_MODERATE_COMMENT, 0);
+      $points = variable_get('userpoints_moderate_comment', 0);
       $params = array(
         'points' => $points,
         'uid' => $comment->uid,
@@ -273,7 +267,7 @@ function userpoints_comment($comment, $o
         //We failed to pull a matching operation via the DB
         //If the user wants to use the V2BUG we'll use it..
         //please read drupal.org/node/183520
-        if (variable_get(USERPOINTS_USE_V2BUG, false)) {
+        if (variable_get('userpoints_use_v2bug', false)) {
           if ($orig_uid != $comment['uid']) {
             $params = array(
               'points' => $points,
Index: userpoints_views.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints_views.module,v
retrieving revision 1.4
diff -u -p -r1.4 userpoints_views.module
--- userpoints_views.module	26 Mar 2008 20:12:43 -0000	1.4
+++ userpoints_views.module	6 Apr 2008 23:54:26 -0000
@@ -331,7 +331,7 @@ function userpoints_views_views_default_
       'single' => '1',
     ),
   );
-  $view->requires = array(usernode_users, userpoints, userpoints_categories);
+  $view->requires = array('usernode_users', 'userpoints', 'userpoints_categories');
   $views[$view->name] = $view;
 
   $view = new stdClass();
