? some_modules_ported.patch
Index: user2userpoints/user2userpoints.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/user2userpoints/user2userpoints.info,v
retrieving revision 1.3
diff -u -p -r1.3 user2userpoints.info
--- user2userpoints/user2userpoints.info	18 Dec 2008 20:13:08 -0000	1.3
+++ user2userpoints/user2userpoints.info	2 Aug 2010 21:14:48 -0000
@@ -3,4 +3,5 @@ name = User to User Points
 description = Users are able to send points to other users.
 package = Userpoints
 dependencies[] = userpoints
-core = 6.x
+core = 7.x
+files[]=user2userpoints.module
Index: user2userpoints/user2userpoints.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/user2userpoints/user2userpoints.module,v
retrieving revision 1.4.2.2
diff -u -p -r1.4.2.2 user2userpoints.module
--- user2userpoints/user2userpoints.module	27 Nov 2009 02:39:48 -0000	1.4.2.2
+++ user2userpoints/user2userpoints.module	2 Aug 2010 21:14:49 -0000
@@ -4,12 +4,12 @@
 /**
  * @file
  *
- * user2userpoints uses userpoints api to give users ability to give points to others.
+ * user2userpoints uses userpoints api to give users ability to give points to
+ * others.
  *
  * @ingroup userpoints_contrib
  */
 
-define('USER2USERPOINTS_PERM_SEND',       'user2userpoints_send');
 define('USER2USERPOINTS_FIELDSET_TITLE',  'user2userpoints_fieldset_title');
 define('USER2USERPOINTS_TO_LABEL',        'user2userpoints_to_label');
 define('USER2USERPOINTS_AMOUNT_LABEL',    'user2userpoints_amount_label');
@@ -17,28 +17,35 @@ define('USER2USERPOINTS_SHOW_CATEGORIES'
 define('USER2USERPOINTS_SHOW_LINKS',     'user2userpoints_show_links');
 
 /**
- * Implements hook_user().
+ * Implements hook_user_view().
  */
-function user2userpoints_user($op, &$edit, &$account, $category = NULL) {
-  if ($op == 'view') {
-    $url = 'user2userpoints/'. $account->name;
-    $items[t('!Points', userpoints_translation())] = array(
-      'value' => l(t('Give !points to '. $account->name, userpoints_translation()), $url),
-      'class' => 'member',
+function user2userpoints_user_view($account, $view_mode) {
+  $url = 'user2userpoints/' . $account->name;
+  if (user_access('give points to another user')) {
+    // @todo Can not be added to the userpoints category because that is called
+    // later on. Update module weight?
+    $account->content['user2userpoints'] = array(
+      '#type' => 'user_profile_item',
+      '#title' => t('Give points'),
+      '#markup' => l(t('Give !points to !user', array_merge(userpoints_translation(), array('!user' => theme('username', array('account' => $account))))), $url, array('html' => TRUE, 'query' => drupal_get_destination())),
+      '#attributes' => array('class' => 'member'),
     );
-    return array(t('!Points', userpoints_translation()) => $items);
   }
 }
 
 /**
- * Implements hook_perm().
+ * Implements hook_permission().
  */
-function user2userpoints_perm() {
-  return array(USER2USERPOINTS_PERM_SEND);
+function user2userpoints_permission() {
+  return array(
+    'give points to another user' => array(
+      'title' => t('Give points to another user'),
+    ),
+  );
 }
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function user2userpoints_menu() {
 
@@ -60,9 +67,10 @@ function user2userpoints_menu() {
    */
   $items['user2userpoints'] = array(
     'title'            => 'Give !points',
+    'title arguments'  => userpoints_translation(),
     'page callback'    => 'drupal_get_form',
     'page arguments'   => array('user2userpoints_giveform', 1, 2, 3),
-    'access arguments' => array(USER2USERPOINTS_PERM_SEND),
+    'access arguments' => array('give points to another user'),
     'type'             => MENU_LOCAL_TASK,
     'weight'           => 1,
   );
@@ -71,49 +79,45 @@ function user2userpoints_menu() {
 }
 
 /**
- * Display the give points link below nodes and comments.
+ * Implements hook_node_view().
  */
-function user2userpoints_link($type, $node = NULL, $teaser = FALSE) {
+function user2userpoints_node_view($node, $view_mode) {
   global $user;
-  if (variable_get(USER2USERPOINTS_SHOW_LINKS,TRUE)) {
-    $links = array();
-    if ($node->uid != $user->uid) {
-      if ($node->type != 'page') {
-        if (user_access(USER2USERPOINTS_PERM_SEND)) {
-          $links['user2userpoints'] = array(
-          'title' => t('Give !points', userpoints_translation()),
-          'href'  => 'user2userpoints/'. $node->name
-          );
-        }
-      }
+  if (variable_get(USER2USERPOINTS_SHOW_LINKS, TRUE) && user_access('give points to another user')) {
+    if ($node->uid != $user->uid && $node->type != 'page') {
+      $links = array();
+      $links['user2userpoints'] = array(
+        'title' => t('Give !points', userpoints_translation()),
+        'href'  => 'user2userpoints/' . $node->name,
+        'query' => drupal_get_destination(),
+      );
+      $node->content['links']['user2userpoints'] = array(
+        '#theme' => 'links',
+        '#links' => $links,
+        '#attributes' => array('class' => array('links', 'inline')),
+      );
     }
-    return $links;
   }
 }
 
-function user2userpoints_giveform(&$form_state,  $account = NULL, $amount = 0, $tid = 0) {
+/**
+ * Form builder function to display form to give another user points.
+ */
+function user2userpoints_giveform($form, &$form_state,  $account = NULL, $amount = 0, $tid = 0) {
   if (is_numeric($account)) {
-    $to = user_load(array('uid' => $to_id));
-    $account =  $to->name;
+    $to = user_load($to_id);
+    $account = $to->name;
   }
 
   $default_tid = variable_get(USERPOINTS_CATEGORY_DEFAULT_TID, NULL);
-  if ($default_tid) {
-    if (! $tid) {
-      $tid = $default_tid;
-    }
+  if ($default_tid && !$tid) {
+    $tid = $default_tid;
   }
 
-  $form = array();
+  // @todo: Figure out why it doesn't get set by the menu system.
+  drupal_set_title(t('Give !points', userpoints_translation()));
 
-  $form['points'] = array(
-    '#type'        => 'fieldset',
-    '#title'       => variable_get(USER2USERPOINTS_FIELDSET_TITLE, 'Give Points'),
-    '#collapsible' => TRUE,
-    '#collapsed'   => FALSE,
-  );
-
-  $form['points']['to'] = array(
+  $form['to'] = array(
     '#type'              => 'textfield',
     '#title'             => variable_get(USER2USERPOINTS_TO_LABEL, 'To'),
     '#autocomplete_path' => 'user/autocomplete',
@@ -123,7 +127,7 @@ function user2userpoints_giveform(&$form
     '#required'          => TRUE
   );
 
-  $form['points']['amount'] = array(
+  $form['amount'] = array(
     '#type'          => 'textfield',
     '#title'         => variable_get(USER2USERPOINTS_AMOUNT_LABEL, 'Amount'),
     '#default_value' => $amount,
@@ -133,14 +137,14 @@ function user2userpoints_giveform(&$form
 
   if ($default_tid) {
     if (variable_get(USER2USERPOINTS_SHOW_CATEGORIES, 1) === 0 ) {
-      $form['points']['tid'] = array(
+      $form['tid'] = array(
       '#type'          => 'hidden',
       '#default_value' => $tid,
       '#required'      => TRUE,
       );
     }
     else {
-      $form['points']['tid'] = array(
+      $form['tid'] = array(
       '#type'          => 'select',
       '#title'         =>  t('Type'),
       '#default_value' => $tid,
@@ -150,66 +154,74 @@ function user2userpoints_giveform(&$form
     }
   }
 
-  $form[] = array(
+  $form['submit'] = array(
     '#type'  => 'submit',
     '#value' => t('Give !Points', userpoints_translation())
   );
   return $form;
 }
 
-function user2userpoints_giveform_validate($form, $form_state) {
+/**
+ * Validate form to give another user points.
+ */
+function user2userpoints_giveform_validate($form, &$form_state) {
   global $user;
 
   /* Check the name to be valid. */
   if (!empty($form_state['values']['to'])) {
     $to_id = $form_state['values']['to'];
-    $field = (is_int($to_id)) ? 'uid' : 'name';
-    $to = user_load(array($field => $to_id));
+    if ($to_id > 0) {
+      $to = user_load($to_id);
+    }
+    else {
+      $to = user_load_by_name($to_id);
+    }
 
     if (!$to->uid) {
       form_set_error('to', t('That is not a valid user.'));
+      return;
     }
 
     if ($to->uid == $user->uid) {
       form_set_error('to', t("You can't give !points to yourself.", userpoints_translation()));
+      return;
     }
   }
 
   /* Check the value to be valid. */
-  if (!empty($form_state['values']['amount'])) {
-    if ($form_state['values']['amount'] < 1) {
-      form_set_error('amount', t("You can't give less than one !point.", userpoints_translation()));
-    }
+  if ($form_state['values']['amount'] < 1) {
+    form_set_error('amount', t("You can't give less than one !point.", userpoints_translation()));
+    return;
+  }
 
-    $tid = ($form_state['values']['tid']) ? $form_state['values']['tid'] : arg(2);
-    if (!$tid) {
-      $tid = 'all';
-    }
+  $tid = isset($form_state['values']['tid']) ? $form_state['values']['tid'] : 'all';
 
-    if ($form_state['values']['amount'] > userpoints_get_current_points($user->uid, $tid)) {
-      form_set_error('amount', t("You don't have enough !points for that.", userpoints_translation()));
-    }
+  if ($form_state['values']['amount'] > userpoints_get_current_points($user->uid, $tid)) {
+    form_set_error('amount', t("You don't have enough !points for that.", userpoints_translation()));
+    return;
   }
+  // Save account so that it can be used by the submit function.
+  $form_state['validated_account'] = $to;
 }
 
+/**
+ * Submit function to give another user points.
+ */
 function user2userpoints_giveform_submit($form, &$form_state) {
   global $user;
 
   $points = $form_state['values']['amount'];
-  $to_id  = $form_state['values']['to'];
+  $to = $form_state['validated_account'];
 
   $tid = NULL;
-  if ($form_state['values']['tid']) {
+  if (isset($form_state['values']['tid'])) {
     $tid = $form_state['values']['tid'];
   }
 
-  $field = (is_int($to_id)) ? 'uid' : 'name';
-  $to = user_load(array($field => $to_id));
-
   $params = array(
     'uid'    => $to->uid,
     'points' => $points,
-    'event'  => 'From: '. $user->name,
+    'operation'  => 'From: '. check_plain($user->name),
     'tid'    => $tid,
   );
   userpoints_userpointsapi($params);
@@ -217,12 +229,15 @@ function user2userpoints_giveform_submit
   $params = array(
     'uid'    => $user->uid,
     'points' => -$points,
-    'event'  => 'To: '. $to->name,
+    'operation'  => 'To: '. check_plain($to->name),
     'tid'    => $tid,
   );
   userpoints_userpointsapi($params);
 }
 
+/**
+ * Implements hook_userpoints().
+ */
 function user2userpoints_userpoints($op, $params = array()) {
   switch ($op) {
     case 'setting':
@@ -273,5 +288,3 @@ function user2userpoints_userpoints($op,
       break;
   }
 }
-
-
Index: userpoints_admin_email/userpoints_admin_email.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_admin_email/userpoints_admin_email.info,v
retrieving revision 1.1
diff -u -p -r1.1 userpoints_admin_email.info
--- userpoints_admin_email/userpoints_admin_email.info	24 Jan 2009 04:03:59 -0000	1.1
+++ userpoints_admin_email/userpoints_admin_email.info	2 Aug 2010 21:14:49 -0000
@@ -3,4 +3,5 @@ name = Userpoints Admin Email
 description = Notifies the site admin when any user reaches a certain number of points
 dependencies[] = userpoints
 package = Userpoints
-core = 6.x
+core = 7.x
+files[]=userpoints_admin_email.module
Index: userpoints_admin_email/userpoints_admin_email.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_admin_email/userpoints_admin_email.module,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 userpoints_admin_email.module
--- userpoints_admin_email/userpoints_admin_email.module	24 Jan 2009 17:12:56 -0000	1.1.2.1
+++ userpoints_admin_email/userpoints_admin_email.module	2 Aug 2010 21:14:49 -0000
@@ -3,7 +3,13 @@
 // Copyright 2008 Khalid Baheyeldin http://2bits.com
 
 /**
- * Implementation of hook_userpoints()
+ * @file
+ * Notifies the site admin when any user reaches a certain number of points.
+ */
+
+
+/**
+ * Implements hook_userpoints()
  */
 function userpoints_admin_email_userpoints($op, $params = array()) {
   switch($op) {
@@ -42,21 +48,21 @@ function userpoints_admin_email_userpoin
 }
 
 function userpoints_admin_email_send_mail($uid, $points) {
-  $account = user_load(array('uid' => $uid));
+  $account = user_load($uid);
 
   $params = array(
     'subject' => t('User !uid reached threshold',
       array('!uid'   => $uid)),
-    'body' => t('User !username (!url) has reached the number of points set in the threshold: !points',
+    'body' => array(t('User !username (!url) has reached the number of points set in the threshold: !points',
       array(
         '!username' => $account->name,
         '!url'      => url('user/' . $uid, array('absolute' => TRUE)),
         '!points'   => $points,
-        )),
+        ))),
   );
 
   // Get email address for user 1
-  $admin = user_load(array('uid' => 1));
+  $admin = user_load(1);
   $email = $admin->mail;
 
   // Send the email
@@ -64,7 +70,7 @@ function userpoints_admin_email_send_mai
 }
 
 /**
- * Implementation of hook_mail().
+ * Implements hook_mail().
  */
 function userpoints_admin_email_mail($key, &$message, $params) {
   $message['subject'] = $params['subject'];
Index: userpoints_badges/userpoints_badges.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_badges/userpoints_badges.module,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 userpoints_badges.module
--- userpoints_badges/userpoints_badges.module	22 Feb 2009 06:56:17 -0000	1.1.2.3
+++ userpoints_badges/userpoints_badges.module	2 Aug 2010 21:14:49 -0000
@@ -101,7 +101,7 @@ function userpoints_badges_run_mass_badg
 }
 
 /**
- * Implementation of hook_userpoints
+ * Implements hook_userpoints
  */
 function userpoints_badges_userpoints($op, $params = array()) {
   switch ($op) {
Index: userpoints_download/userpoints_download.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_download/userpoints_download.module,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 userpoints_download.module
--- userpoints_download/userpoints_download.module	28 Mar 2010 15:02:54 -0000	1.1.2.1
+++ userpoints_download/userpoints_download.module	2 Aug 2010 21:14:49 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: userpoints_download.module,v 1.1.2.1 2010/03/28 15:02:54 kbahey Exp $
+// $Id: userpoints_download.module,v 1.1.2.1 2010-03-28 15:02:54 kbahey Exp $
 
 define('USERPOINTS_DOWNLOAD_POINTS',     'userpoints_download_points');
 define('USERPOINTS_DOWNLOAD_TID',        'userpoints_download_tid');
Index: userpoints_flag/userpoints_flag.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_flag/userpoints_flag.module,v
retrieving revision 1.1
diff -u -p -r1.1 userpoints_flag.module
--- userpoints_flag/userpoints_flag.module	9 Sep 2009 17:23:47 -0000	1.1
+++ userpoints_flag/userpoints_flag.module	2 Aug 2010 21:14:49 -0000
@@ -40,18 +40,18 @@ function userpoints_flag_form_alter(&$fo
         '#default_value' => variable_get(userpoints_flag_author_node_vote, 0),
         '#size'          => 5,
         '#maxlength'     => 5,
-		'#description' => t('Select 0 to ignore.'),
-    );	
-	
+    '#description' => t('Select 0 to ignore.'),
+    );  
+  
     $form[$group][userpoints_flag_author_comment_vote] = array(
         '#type'          => 'textfield',
       '#title' => t('!Points to comment author', userpoints_translation()),
         '#default_value' => variable_get(userpoints_flag_author_comment_vote, 0),
         '#size'          => 5,
         '#maxlength'     => 5,
-		'#description' => t('Select 0 to ignore.'),
-    );	
-	
+    '#description' => t('Select 0 to ignore.'),
+    );  
+  
     $form[$group][userpoints_flag_daily_threshold] = array(
       '#type' => 'select',
       '#title' => t('Daily threshold'),
@@ -82,30 +82,30 @@ function userpoints_flag_flag($action, $
   //no points for author
   if ($uid != $account->uid) {
       $threshold = variable_get(userpoints_flag_daily_threshold, 0);
-	  if (($threshold == '0') OR (_userpoints_flag_within_threshold($account->uid, $threshold))) {
-		  userpoints_userpointsapi(array(
-		    'uid'       => $account->uid,
-		    'points'    => ($action == 'flag' ? variable_get(userpoints_flag_vote, 1): -1 * variable_get(userpoints_flag_vote, 1)),
-		    'moderate' => variable_get(userpoints_flag_moderation, 0),
-		    'entity_id' => $content_id,
-		    'entity_type' => $flag->content_type,
-		    'operation'     => 'flag',
-		    'description' => t('Flag cast: !content_type !content_id.',array('!content_type'=> $flag->content_type, '!content_id'=> $content_id)),
-		    )
-		  );
-		  if (($author_points != 0) AND ($uid != 0)) {
-		    userpoints_userpointsapi(array(
-		    'uid'       => $uid,
-		    'points'    => ($action == 'flag' ? $author_points: -1 * $author_points),
-		    'moderate' => variable_get(userpoints_flag_moderation, 0),
-		    'entity_id' => $content_id,
-		    'entity_type' => $flag->content_type,
-		    'operation'     => 'flag author',
-		    'description' => t('Flag author cast: !content_type !content_id.',array('!content_type'=> $flag->content_type, '!content_id'=> $content_id)),
-		    )
-		    );
-		  }
-	  }
+    if (($threshold == '0') OR (_userpoints_flag_within_threshold($account->uid, $threshold))) {
+      userpoints_userpointsapi(array(
+        'uid'       => $account->uid,
+        'points'    => ($action == 'flag' ? variable_get(userpoints_flag_vote, 1): -1 * variable_get(userpoints_flag_vote, 1)),
+        'moderate' => variable_get(userpoints_flag_moderation, 0),
+        'entity_id' => $content_id,
+        'entity_type' => $flag->content_type,
+        'operation'     => 'flag',
+        'description' => t('Flag cast: !content_type !content_id.',array('!content_type'=> $flag->content_type, '!content_id'=> $content_id)),
+        )
+      );
+      if (($author_points != 0) AND ($uid != 0)) {
+        userpoints_userpointsapi(array(
+        'uid'       => $uid,
+        'points'    => ($action == 'flag' ? $author_points: -1 * $author_points),
+        'moderate' => variable_get(userpoints_flag_moderation, 0),
+        'entity_id' => $content_id,
+        'entity_type' => $flag->content_type,
+        'operation'     => 'flag author',
+        'description' => t('Flag author cast: !content_type !content_id.',array('!content_type'=> $flag->content_type, '!content_id'=> $content_id)),
+        )
+        );
+      }
+    }
   }
 }
 
Index: userpoints_invite/userpoints_invite.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_invite/userpoints_invite.install,v
retrieving revision 1.3
diff -u -p -r1.3 userpoints_invite.install
--- userpoints_invite/userpoints_invite.install	7 Nov 2008 02:59:38 -0000	1.3
+++ userpoints_invite/userpoints_invite.install	2 Aug 2010 21:14:49 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: userpoints_invite.install,v 1.3 2008/11/07 02:59:38 kbahey Exp $
+// $Id: userpoints_invite.install,v 1.3 2008-11-07 02:59:38 kbahey Exp $
 
 define('USERPOINTS_INVITE_REGISTER',         'userpoints_invite_register');
 define('USERPOINTS_INVITE_REGISTER_INVITER', 'userpoints_invite_register_inviter');
Index: userpoints_invite/userpoints_invite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_invite/userpoints_invite.module,v
retrieving revision 1.9.2.5
diff -u -p -r1.9.2.5 userpoints_invite.module
--- userpoints_invite/userpoints_invite.module	15 Jul 2010 22:04:06 -0000	1.9.2.5
+++ userpoints_invite/userpoints_invite.module	2 Aug 2010 21:14:49 -0000
@@ -10,7 +10,6 @@ define('USERPOINTS_INVITE_REGISTER_INVIT
 define('USERPOINTS_INVITE_REGISTER_REMOVE_ON_DELETE',  'userpoints_invite_register_remove_on_delete');
 
 function userpoints_invite_help($path, $arg) {
-  $output = '';
   switch ($path) {
     case 'admin/settings/userpoints_invite':
       $output = t('A userpoints interface with the invite module.');
Index: userpoints_no_negative/userpoints_no_negative.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_no_negative/userpoints_no_negative.info,v
retrieving revision 1.1.4.2
diff -u -p -r1.1.4.2 userpoints_no_negative.info
--- userpoints_no_negative/userpoints_no_negative.info	11 Jan 2009 00:51:41 -0000	1.1.4.2
+++ userpoints_no_negative/userpoints_no_negative.info	2 Aug 2010 21:14:49 -0000
@@ -1,6 +1,7 @@
-; $Id: userpoints_no_negative.info,v 1.1.4.2 2009/01/11 00:51:41 kbahey Exp $
+; $Id: userpoints_no_negative.info,v 1.1.4.2 2009-01-11 00:51:41 kbahey Exp $
 name = Userpoints No Negative
 description = Has no UI.  Once enabled, prevents transactions that would move accounts negative.  Allows currently negative users to make positive transactions.  
 package = Userpoints
 dependencies[] = userpoints
-core = 6.x
+core = 7.x
+files[]=userpoints_no_negative.module
Index: userpoints_no_negative/userpoints_no_negative.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_no_negative/userpoints_no_negative.module,v
retrieving revision 1.1.4.5
diff -u -p -r1.1.4.5 userpoints_no_negative.module
--- userpoints_no_negative/userpoints_no_negative.module	19 Jan 2009 14:07:03 -0000	1.1.4.5
+++ userpoints_no_negative/userpoints_no_negative.module	2 Aug 2010 21:14:49 -0000
@@ -1,11 +1,15 @@
 <?php
-// $Id: userpoints_no_negative.module,v 1.1.4.5 2009/01/19 14:07:03 kbahey Exp $ 
+// $Id: userpoints_no_negative.module,v 1.1.4.5 2009/01/19 14:07:03 kbahey Exp $
 
-// @file
-// Very simple userpoints_contrib to prevent accounts from going (further) negative
-
-// Implementation of hook_userpoints
+/**
+ * @file
+ * Very simple userpoints_contrib to prevent accounts from going (further)
+ * negative.
+ */
 
+/**
+ * Implements hook_userpoints().
+ */
 function userpoints_no_negative_userpoints($op, $params = array()) {
   if ($op == 'points before') {
     $points = $params['points'];
@@ -14,8 +18,8 @@ function userpoints_no_negative_userpoin
     if ($points < 0) {
       $current_points = userpoints_get_current_points($uid, 'all');
       if (($current_points + $points) < 0) {
-        $account = user_load(array('uid' => $uid));
-        $message = t('User %uname losing %pointsvalue !points! skipped because it would move thir !points! (further) negative',
+        $account = user_load($uid);
+        $message = t('User %uname losing %pointsvalue !points skipped because it would move their !points (further) negative',
           array_merge(userpoints_translation(), array(
             '%uname'  => $account->name,
             '%pointsvalue' => abs($points),
Index: userpoints_nodelimit/userpoints_nodelimit.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_nodelimit/userpoints_nodelimit.install,v
retrieving revision 1.1
diff -u -p -r1.1 userpoints_nodelimit.install
--- userpoints_nodelimit/userpoints_nodelimit.install	20 Sep 2009 19:03:18 -0000	1.1
+++ userpoints_nodelimit/userpoints_nodelimit.install	2 Aug 2010 21:14:49 -0000
@@ -4,8 +4,8 @@
 * Implementation of hook_install().
 */
 function userpoints_nodelimit_install() {
-	
-	db_query("UPDATE {system} SET weight = 5 WHERE name = 'userpoints_nodelimit'");
+  
+  db_query("UPDATE {system} SET weight = 5 WHERE name = 'userpoints_nodelimit'");
   drupal_set_message(t('User Points Node Limit has been successfully installed.'));
   drupal_set_message(t('You can configure the User Points Node Limit module on the <a href="@url">Content Types settings page</a>.', array('@url' => url('admin/content/types/list'))));
 }
Index: userpoints_nodelimit/userpoints_nodelimit.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_nodelimit/userpoints_nodelimit.module,v
retrieving revision 1.4.2.3
diff -u -p -r1.4.2.3 userpoints_nodelimit.module
--- userpoints_nodelimit/userpoints_nodelimit.module	11 Jan 2010 04:20:48 -0000	1.4.2.3
+++ userpoints_nodelimit/userpoints_nodelimit.module	2 Aug 2010 21:14:49 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: userpoints_nodelimit.module,v 1.4.2.3 2010/01/11 04:20:48 kbahey Exp $
+// $Id: userpoints_nodelimit.module,v 1.4.2.3 2010-01-11 04:20:48 kbahey Exp $
 
 /**
  * Enables a limit on node creation based on user's current user points.
@@ -18,7 +18,7 @@ define('USERPOINTS_NODELIMIT_DISABLED', 
 define('USERPOINTS_NODELIMIT_ENABLED', 1);
 
 /**
- * Implementation of hook_form_alter().
+ * Implements hook_form_alter().
  */
 function userpoints_nodelimit_form_alter(&$form, $form_state, $form_id) {
 
@@ -36,19 +36,19 @@ function userpoints_nodelimit_form_alter
         if (!isset($form['#node']->nid) && !userpoints_nodelimit_check($type)) {
           $friendly_name = node_get_types('name', $form['#node']); 
           drupal_set_message(theme('userpoints_nodelimit_insufficent_points_message', $type, $friendly_name), 'error');
-      	  //destroy the form
-      	  $form = NULL;
-      	  //return a simple hidden field so that function doesn't fail
-      	  $form['dummy'] = array(
-       		  '#type' => 'hidden',
-        	  '#default_value' => '',
-      	  );
+          //destroy the form
+          $form = NULL;
+          //return a simple hidden field so that function doesn't fail
+          $form['dummy'] = array(
+             '#type' => 'hidden',
+            '#default_value' => '',
+          );
         }
         else {
-     		  // add a validate function as the points may change between the opening for the form  
-     		  // and the submission of the form, so we should check again prior to submission
-				  $form['#validate'][] = 'userpoints_nodelimit_validate';
-			  }
+           // add a validate function as the points may change between the opening for the form  
+           // and the submission of the form, so we should check again prior to submission
+          $form['#validate'][] = 'userpoints_nodelimit_validate';
+        }
       }
     }
   }
@@ -72,7 +72,7 @@ function userpoints_nodelimit_validate($
   * Node Limit Error Message
   */
 function theme_userpoints_nodelimit_insufficent_points_message($node_type, $friendly_name) {
-	$html_message =	t('You do not have enough !points to create @friendly content.<br />You currently have @user_points !points, you need @node_points !points to create a @friendly.', 
+  $html_message =  t('You do not have enough !points to create @friendly content.<br />You currently have @user_points !points, you need @node_points !points to create a @friendly.', 
     array_merge(userpoints_translation(), 
     array('@user_points' => userpoints_get_current_points($user->uid), 
       '@node_points' => variable_get('userpoints_nodelimit_nodepoints_'.$node_type, '?'),
@@ -119,7 +119,7 @@ function userpoints_nodelimit_get_settin
 }
 
 /**
- * Implementation of hook_node_type().
+ * Implements hook_node_type().
  */
 function userpoints_nodelimit_node_type($op, $info) {
   switch ($op) {
Index: userpoints_pageviews/userpoints_pageviews.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_pageviews/userpoints_pageviews.info,v
retrieving revision 1.2
diff -u -p -r1.2 userpoints_pageviews.info
--- userpoints_pageviews/userpoints_pageviews.info	11 Nov 2008 03:59:08 -0000	1.2
+++ userpoints_pageviews/userpoints_pageviews.info	2 Aug 2010 21:14:49 -0000
@@ -3,4 +3,5 @@ name = Userpoints Page Views
 description = Gives points to content creators based on page views
 package = Userpoints
 dependencies[] = userpoints
-core = 6.x
+core = 7.x
+files[]=userpoints_pageviews.module
Index: userpoints_pageviews/userpoints_pageviews.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_pageviews/userpoints_pageviews.install,v
retrieving revision 1.1
diff -u -p -r1.1 userpoints_pageviews.install
--- userpoints_pageviews/userpoints_pageviews.install	16 Jan 2009 15:31:20 -0000	1.1
+++ userpoints_pageviews/userpoints_pageviews.install	2 Aug 2010 21:14:49 -0000
@@ -2,17 +2,9 @@
 // $Id: userpoints_pageviews.install,v 1.1 2009/01/16 15:31:20 kbahey Exp $
 
 /**
- * Implementation of hook_install().
- */
-function userpoints_pageviews_install() {
-  drupal_install_schema('userpoints_pageviews');
-}
-
-/**
  * Implementation of hook_uninstall().
  */
 function userpoints_pageviews_uninstall() {
-  drupal_uninstall_schema('userpoints_pageviews');
   db_query("DELETE FROM {variable} WHERE name LIKE 'userpoints%pageview%'");
 }
 
@@ -40,11 +32,5 @@ function userpoints_pageviews_schema() {
       'userpoints_pageviews_timestamp' => array('timestamp'),
     ),
   );  
-  
   return $schema;
 }
-
-function userpoints_pageviews_update_6001() { 
-  drupal_install_schema('userpoints_pageviews');
-	return array();
-}
Index: userpoints_pageviews/userpoints_pageviews.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_pageviews/userpoints_pageviews.module,v
retrieving revision 1.1.4.4
diff -u -p -r1.1.4.4 userpoints_pageviews.module
--- userpoints_pageviews/userpoints_pageviews.module	20 Jan 2009 21:15:11 -0000	1.1.4.4
+++ userpoints_pageviews/userpoints_pageviews.module	2 Aug 2010 21:14:50 -0000
@@ -2,13 +2,20 @@
 // $Id: userpoints_pageviews.module,v 1.1.4.4 2009/01/20 21:15:11 kbahey Exp $
 
 
-define('USERPOINTS_PAGEVIEWS_NODE',                	'userpoints_pageviews_node_');
+define('USERPOINTS_PAGEVIEWS_NODE',                  'userpoints_pageviews_node_');
 define('USERPOINTS_PAGEVIEW_TID',                   'userpoints_pageview_tid');
 define('USERPOINTS_PAGEVIEW_PAGE_LIMIT',            'userpoints_pageview_page_limit');
 define('USERPOINTS_PAGEVIEW_CLICK_IGNORE_INTERVAL', 'userpoints_pageview_click_ignore_interval');
 
-function userpoints_pageviews_perm() {
-  return array('userpoints pageviews click');
+/**
+ * Implements hook_permission().
+ */
+function userpoints_pageviews_permission() {
+  return array(
+    'userpoints pageviews click' => array(
+      'title' => t('Track page visits for awarding page view userpoints'),
+    ),
+  );
 }
 
 function userpoints_pageviews_userpoints($op = 'setting', $params = array()) {
@@ -22,10 +29,10 @@ function userpoints_pageviews_userpoints
       '#description'   => t('You can assign different points for each content type. If you want a content type not to have any points awarded, then specify 0 for it.'), 
     );
 
-    foreach (node_get_types() as $type => $name) {
+    foreach (node_type_get_names() as $type => $name) {
         $form[$group][USERPOINTS_PAGEVIEWS_NODE . $type] = array(
           '#type'          => 'textfield',
-          '#title'         => t('!Points for viewing a !node-name', array_merge(userpoints_translation(), array('!node-name' => $name->name))),
+          '#title'         => t('!Points for viewing a !node-name', array_merge(userpoints_translation(), array('!node-name' => $name))),
           '#default_value' => variable_get(USERPOINTS_PAGEVIEWS_NODE . $type, 0),
           '#size'          => 5,
           '#maxlength'     => 5,
@@ -66,41 +73,28 @@ function userpoints_pageviews_userpoints
   }
 }
 
-function userpoints_pageviews_nodeapi(&$node, $op = 'view', $teaser, $page) {
+/**
+ * Implements hook_node_view().
+ */
+function userpoints_pageviews_node_view($node, $view_mode) {
   global $user;
 
-  if($op != 'view') {
-    return;
-  }
-
-  if (!$page) {
-    // Node is not in page mode, but rather in a list
-    return;
-  }
-
-  if (!user_access('userpoints pageviews click')) {
-    // User does not have access to earn points for clicks
+  // Check view mode, permission, node author and timeout setting.
+  if ($view_mode != 'full' || !user_access('userpoints pageviews click') || $node->uid == $user->uid || userpoints_pageviews_check_timeout($node->nid, $user->uid)) {
     return;
   }
 
-  if ($node->uid == $user->uid) {
-    // User created this node...
-    return;
-  }
-
-  $num = userpoints_pageviews_check_timeout($node->nid, $user->uid);
-  if ($num) {
-    // Allow points if time between click is greater than defined interval and the user has permissions
-    return;
-  }
-
-  // All good ...
-
-  // Create a record, so we can check it later
-  db_query("INSERT INTO {userpoints_pageviews} (uid, nid, ip, timestamp) VALUES (%d, %d, '%s', %d)",
-    $user->uid, $node->nid, ip_address(), time());
+  // Create a record, so we can check it later.
+  db_insert('userpoints_pageviews')
+    ->fields(array(
+      'uid' => $user->uid,
+      'nid' => $node->nid,
+      'ip' => ip_address(),
+      'timestamp' => REQUEST_TIME,
+    ))
+    ->execute();
  
-  // Award the points
+  // Award the points.
   userpoints_userpointsapi(array(
     'uid'         => $node->uid,
     'points'      => variable_get(USERPOINTS_PAGEVIEWS_NODE . $node->type, 0),
@@ -112,22 +106,21 @@ function userpoints_pageviews_nodeapi(&$
 }
 
 function userpoints_pageviews_check_timeout($nid = 0, $uid = 0) {
-  switch (variable_get(USERPOINTS_PAGEVIEW_PAGE_LIMIT, 0)) {
-    case 0: // All
-      return (int)db_result(db_query("SELECT COUNT(*) FROM {userpoints_pageviews}
-        WHERE ip = '%s'
-        AND %d < (timestamp + %d)
-        AND nid = %d
-        AND uid = %d",
-        ip_address(), time(), variable_get(USERPOINTS_PAGEVIEW_CLICK_IGNORE_INTERVAL, 86400), $nid, $uid));
-
-    case 1: // One
-      return (int)db_result(db_query("SELECT COUNT(*) FROM {userpoints_pageviews}
-        WHERE ip = '%s'
-        AND %d < (timestamp + %d)
-        AND uid = %d",
-        ip_address(), time(), variable_get(USERPOINTS_PAGEVIEW_CLICK_IGNORE_INTERVAL, 86400), $uid));
-  }
+
+  $query = db_select('userpoints_pageviews')
+    ->condition('ip', ip_address())
+    ->condition('timestamp', REQUEST_TIME - variable_get(USERPOINTS_PAGEVIEW_CLICK_IGNORE_INTERVAL, 86400), '>')
+    ->condition('uid', $uid)
+    ->range(0, 1);
+  $query->addExpression('1');
+
+  // If set to All.
+  if (variable_get(USERPOINTS_PAGEVIEW_PAGE_LIMIT, 0)) {
+    $query->condition('nid', $nid);
+  }
+  return (bool)$query
+    ->execute()
+    ->fetchField();
 }
 
 /**
@@ -137,7 +130,8 @@ function userpoints_pageviews_cron() {
   $frequency = 86400; // 24 hours
   $last_run = variable_get('cron_last', time());
   if (time() >= ($last_run + $frequency)) {
-    db_query("DELETE FROM {userpoints_pageviews} WHERE timestamp < %d",
-      time() - variable_get(USERPOINTS_PAGEVIEW_CLICK_IGNORE_INTERVAL, 86400));
+    db_delete('userpoints_pageviews')
+      ->condition('timestamp', REQUEST_TIME - variable_get(USERPOINTS_PAGEVIEW_CLICK_IGNORE_INTERVAL, 86400), '<')
+      ->execute();
   }
 }
Index: userpoints_register/userpoints_register.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_register/userpoints_register.module,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 userpoints_register.module
--- userpoints_register/userpoints_register.module	11 Jun 2010 23:35:17 -0000	1.1.2.2
+++ userpoints_register/userpoints_register.module	2 Aug 2010 21:14:50 -0000
@@ -9,7 +9,7 @@ define('USERPOINTS_REGISTER_TID',      '
 define('USERPOINTS_REGISTER_DISPLAY',  'userpoints_register_display');
 
 /*
-* Implementation of hook_userpoints()
+* Implements hook_userpoints()
 * Creates points configuration form for awarding points for registering
 */
 
@@ -53,7 +53,7 @@ function userpoints_register_userpoints(
 }
 
 /*
-*   Implementation of hook_user()
+*   Implements hook_user()
 *   Awards the points for registering
 */
 function userpoints_register_user($op, &$edit, &$account, $category = NULL) {
Index: userpoints_reset/userpoints_reset.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_reset/userpoints_reset.module,v
retrieving revision 1.4
diff -u -p -r1.4 userpoints_reset.module
--- userpoints_reset/userpoints_reset.module	13 Nov 2008 15:08:35 -0000	1.4
+++ userpoints_reset/userpoints_reset.module	2 Aug 2010 21:14:50 -0000
@@ -1,8 +1,6 @@
 <?php
 // $Id: userpoints_reset.module,v 1.4 2008/11/13 15:08:35 kbahey Exp $
 
-define(USERPOINTS_PERM_RESET, 'reset userpoints');
-
 function userpoints_reset_help($path, $arg) {
   switch ($path) {
     case 'admin/settings/userpoints/reset':
@@ -16,14 +14,14 @@ function userpoints_reset_menu() {
   $items['admin/settings/userpoints/reset'] = array(
     'page callback' => 'userpoints_reset_page',
     'title'    => 'Reset',
-    'access arguments'   => array(USERPOINTS_PERM_RESET),
+    'access arguments'   => array('reset userpoints'),
     'type'     => MENU_NORMAL_ITEM
-		);
+    );
    return $items;
 }
 
-function userpoints_reset_perm() {
-  return array (USERPOINTS_PERM_RESET);
+function userpoints_reset_permission() {
+  return array ('reset userpoints' => array('title' => t('Reset Userpoints')));
 }
 
 function userpoints_reset_page() {
Index: userpoints_retroactive/userpoints_retroactive.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_retroactive/userpoints_retroactive.module,v
retrieving revision 1.5.2.6
diff -u -p -r1.5.2.6 userpoints_retroactive.module
--- userpoints_retroactive/userpoints_retroactive.module	21 Feb 2010 21:39:58 -0000	1.5.2.6
+++ userpoints_retroactive/userpoints_retroactive.module	2 Aug 2010 21:14:50 -0000
@@ -3,8 +3,6 @@
 
 // Based on a script by Miguel Figueiredo <elmig@debianpt.org>, 2006
 
-define(USERPOINTS_PERM_RETROACTIVE, 'retroactive userpoints');
-
 function userpoints_retroactive_help($path, $arg) {
   switch ($path) {
     case 'admin/settings/userpoints/retroactive':
@@ -18,15 +16,15 @@ function userpoints_retroactive_menu() {
   $items['admin/settings/userpoints/retroactive'] = array(
     'page callback'    => 'userpoints_retroactive_page',
     'title'            => t('Retroactive'),
-    'access arguments' => array(USERPOINTS_PERM_RETROACTIVE),
+    'access arguments' => array('retroactive userpoints'),
     'type'             => MENU_NORMAL_ITEM
   );
 
   return $items;
 }
 
-function userpoints_retroactive_perm() {
-  return array (USERPOINTS_PERM_RETROACTIVE);
+function userpoints_retroactive_permission() {
+  return array ('retroactive userpoints' => array('title' => t('Calculate retroactive Userpoints')));
 }
 
 function userpoints_retroactive_page() {
Index: userpoints_revision/userpoints_revision.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_revision/userpoints_revision.info,v
retrieving revision 1.1
diff -u -p -r1.1 userpoints_revision.info
--- userpoints_revision/userpoints_revision.info	11 Jan 2010 04:28:20 -0000	1.1
+++ userpoints_revision/userpoints_revision.info	2 Aug 2010 21:14:50 -0000
@@ -1,8 +1,7 @@
 ; $Id: userpoints_revision.info,v 1.1 2010/01/11 04:28:20 kbahey Exp $
 name = Userpoints Revision
-description = Gives users points for creating revisions on nodes that are not their own.
-core = 6.x
+description = Gives users points for creating revisions on nodes.
+core = 7.x
 package = Userpoints
-version = "6.x-1.0"
-project = userpoints_revision
 dependencies[] = userpoints
+files[]=userpoints_revision.module
Index: userpoints_revision/userpoints_revision.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_revision/userpoints_revision.module,v
retrieving revision 1.1
diff -u -p -r1.1 userpoints_revision.module
--- userpoints_revision/userpoints_revision.module	11 Jan 2010 04:28:20 -0000	1.1
+++ userpoints_revision/userpoints_revision.module	2 Aug 2010 21:14:50 -0000
@@ -1,121 +1,97 @@
 <?php
 
-/*******************************************************************
-	DRUPAL HOOKS
-*******************************************************************/
-
-function userpoints_revision_nodeapi(&$node, $op, $teaser, $page)
-{
-  	switch ($op)
-	{
-	
-		case 'update':
-
-			if($node->revision)
-			{
-				global $user;
-				$points_own_nodes = variable_get('userpoint_revision_own_nodes', 0);
-				if(!$points_own_nodes && $user->uid==$node->uid)
-					break;
-				//load old node revision to compare against
-				$old_node = node_load($node->nid);
-				
-				//flag for significant changes between the two revisions
-				$change = FALSE;
-				
-				//lets check the length of content in each revision
-					$size1 = strlen($old_node->body);
-					$size2 = strlen($node->body);
-					
-					$diff = abs($size1 - $size2);
-				
-				if($diff > 20)
-				{
-					$change = TRUE;
-				}
-				//similar character count, lets check character by character
-				else
-				{
-					$count = 0;
-					
-					for($i = 0; $i < $size1, $i < $size2; $i++)
-					{
-						if($old_node->body{$i} != $node->body{$i})
-						{
-							$count++;
-						}
-					}
-					
-					if($count > 20)
-					{
-						$change = TRUE;
-					}
-				}
-								
-				if($change)
-				{
-					$points = variable_get('userpoints_revision_'.$node->type, 0);
-			
-					$params = array(
-						'points' 		=> $points,
-						'uid' 			=> $user->uid,
-						'operation' 	=> t('New revision'),
-						'entity_id'		=> $node->nid,
-						'entity_type'	=> 'node'
-					);
-					
-					userpoints_userpointsapi($params);
-				}
-			}
-						
-			break;
-	}
+/**
+ * @file
+ * Gives users points for creating revisions on nodes
+ */
+
+/**
+ * Implements hook_hode_update().
+ */
+function userpoints_revision_node_update($node) {
+  if ($node->revision) {
+    global $user;
+    $points_own_nodes = variable_get('userpoint_revision_own_nodes', 0);
+    if(!$points_own_nodes && $user->uid == $node->uid) {
+      return;
+    }
+    // Load old node revision to compare against.
+    $old_node = node_load($node->nid);
+
+    // Flag for significant changes between the two revisions.
+    $change = FALSE;
+
+    // Check the length of content in each revision.
+    $size1 = strlen($old_node->body);
+    $size2 = strlen($node->body);
+    $diff = abs($size1 - $size2);
+
+    if ($diff > 20) {
+      $change = TRUE;
+    }
+    // Similar character count, lets check character by character.
+    else
+    {
+      $count = 0;
+      for ($i = 0; $i < $size1, $i < $size2; $i++) {
+        if ($old_node->body{$i} != $node->body{$i}) {
+          $count++;
+
+          // Check after each different character to avoid comparing too much.
+          if ($count > 20) {
+            $change = TRUE;
+          }
+        }
+      }
+    }
+
+    // Add points if there are relevant changes.
+    if ($change) {
+      $points = variable_get('userpoints_revision_' . $node->type, 0);
+
+      $params = array(
+        'points'  => $points,
+        'uid'       => $user->uid,
+        'operation'   => t('New revision'),
+        'entity_id'    => $node->nid,
+        'entity_type'  => 'node'
+      );
+      userpoints_userpointsapi($params);
+    }
+  }
 }
 
-/*******************************************************************
-	USERPOINTS HOOKS
-*******************************************************************/
-
-function userpoints_revision_userpoints($op, $params = array())
-{
-	switch($op)
-	{
-		case 'setting':
-
-			$form['revision'] = array(
-				'#collapsed'	=> TRUE,
-				'#collapsible'	=> TRUE,
-				'#title'		=> t('!Points for creating node revisions',
-									userpoints_translation()),
-				'#type' 		=> 'fieldset',
-			);
-			
-			$form['revision']['userpoint_revision_own_nodes'] = array(
-				'#type' => 'checkbox',
-				'#default_value' => variable_get('userpoint_revision_own_nodes', 0),
-				'#title' => t('Award points for revisions by the node author'),
-			);
-
-			foreach (node_get_types() as $type => $name)
-			{
-				$form['revision']['userpoints_revision_'.$type] = array(
-					'#default_value' => variable_get('userpoints_revision_'.$type, '0'),					
-					'#maxlength'     => 5,
-					'#size'          => 5,
-					'#title'         => t('!Points for creating a revision of a
-											!node-name',
-											array_merge(
-												userpoints_translation(),
-												array('!node-name' => $name->name)
-											)
-										),
-					'#type'          => 'textfield',
-				);
-			}
-
-			return $form;
-
-			break;
-	}
+/**
+ * Implements hook_userpoints().
+ */
+function userpoints_revision_userpoints($op, $params = array()) {
+  switch($op) {
+    case 'setting':
+
+      $form['revision'] = array(
+        '#collapsed'  => TRUE,
+        '#collapsible'  => TRUE,
+        '#title'    => t('!Points for creating node revisions', userpoints_translation()),
+        '#type'     => 'fieldset',
+      );
+      
+      $form['revision']['userpoint_revision_own_nodes'] = array(
+        '#type' => 'checkbox',
+        '#default_value' => variable_get('userpoint_revision_own_nodes', 0),
+        '#title' => t('Award points for revisions by the node author'),
+      );
+
+      foreach (node_type_get_names() as $type => $name) {
+        $form['revision']['userpoints_revision_'.$type] = array(
+          '#default_value' => variable_get('userpoints_revision_'.$type, '0'),          
+          '#maxlength'     => 5,
+          '#size'          => 5,
+          '#title'         => t('!Points for creating a revision of a !node-name', array_merge(userpoints_translation(), array('!node-name' => $name->name))),
+          '#type'          => 'textfield',
+        );
+      }
+      return $form;
+      break;
+  }
 }
 
Index: userpoints_role/userpoints_role.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_role/userpoints_role.info,v
retrieving revision 1.3.2.2
diff -u -p -r1.3.2.2 userpoints_role.info
--- userpoints_role/userpoints_role.info	11 Jan 2009 00:51:42 -0000	1.3.2.2
+++ userpoints_role/userpoints_role.info	2 Aug 2010 21:14:50 -0000
@@ -3,4 +3,5 @@ name = Userpoints Role
 description = Users join/leave roles as they earn/lose certain points threshold, and get an email.
 package = Userpoints
 dependencies[] = userpoints
-core = 6.x
+core = 7.x
+files[]=userpoints_role.module
Index: userpoints_role/userpoints_role.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_role/userpoints_role.install,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 userpoints_role.install
--- userpoints_role/userpoints_role.install	29 Dec 2008 17:19:40 -0000	1.1.2.4
+++ userpoints_role/userpoints_role.install	2 Aug 2010 21:14:50 -0000
@@ -1,8 +1,12 @@
 <?php
 
-// $Id: userpoints_role.install,v 1.1.2.4 2008/12/29 17:19:40 kbahey Exp $
+// $Id: userpoints_role.install,v 1.1.2.4 2008-12-29 17:19:40 kbahey Exp $
 
 function userpoints_role_uninstall() {
-  db_query("DELETE FROM {variable} WHERE name LIKE 'userpoints_role%%'");
-  db_query("DELETE FROM {variable} WHERE name LIKE 'userpoints_email_role%%'");
+  db_delete('variable')
+    ->condition(db_or()
+      ->condition('name', 'userpoints_role%', 'LIKE')
+      ->condition('name', 'userpoints_email_role%', 'LIKE')
+    )
+    ->execute();
 }
Index: userpoints_role/userpoints_role.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_role/userpoints_role.module,v
retrieving revision 1.4.2.5
diff -u -p -r1.4.2.5 userpoints_role.module
--- userpoints_role/userpoints_role.module	3 Feb 2009 17:00:01 -0000	1.4.2.5
+++ userpoints_role/userpoints_role.module	2 Aug 2010 21:14:50 -0000
@@ -35,12 +35,12 @@ function userpoints_role_help($path, $ar
 function userpoints_role_menu() {
   $items = array();
 
-  $items['admin/settings/userpoints/role/%'] = array(
+  $items['admin/config/people/userpoints/role/%'] = array(
     'title'            => t('!Points roles settings', userpoints_translation()),
     'description'      => t('Settings for role'),
     'page callback'    => 'drupal_get_form',
     'page arguments'   => array('userpoints_role_admin_settings', 4),
-    'access arguments' => array(USERPOINTS_PERM_ADMIN),
+    'access arguments' => array('administer userpoints'),
     'type'             => MENU_NORMAL_ITEM
   );
 
@@ -245,7 +245,7 @@ function _userpoints_role_update_roles($
 }
 
 function userpoints_role_check_user_role($uid, $rid) {
-  return (int)db_result(db_query("SELECT COUNT(*) FROM {users_roles} WHERE rid = %d AND uid = %d", $rid, $uid));
+  return (bool)db_query_range("SELECT 1 FROM {users_roles} WHERE rid = :rid AND uid = :uid", 0, 1, array(':uid' => $uid, ':rid' => $rid))->fetchField();;
 }
 
 function userpoints_role_join($uid, $role_point) {
@@ -271,7 +271,7 @@ function userpoints_role_leave($uid, $ro
 }
 
 function userpoints_role_send_mail($op = 'join', $uid, $role_point) {
-  $account = user_load(array('uid' => $uid));
+  $account = user_load($uid);
   $vars = array(
     '!username' => $account->name,
     '!rolename' => $role_point['name'],
@@ -302,7 +302,7 @@ function userpoints_role_email($op = 'jo
 }
 
 /**
- * Implementation of hook_mail().
+ * Implements hook_mail().
  */
 function userpoints_role_mail($key, &$message, $params) {
   $message['subject'] = $params['subject'];
Index: userpoints_role_exempt/userpoints_role_exempt.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_role_exempt/userpoints_role_exempt.info,v
retrieving revision 1.3.2.2
diff -u -p -r1.3.2.2 userpoints_role_exempt.info
--- userpoints_role_exempt/userpoints_role_exempt.info	11 Jan 2009 00:51:42 -0000	1.3.2.2
+++ userpoints_role_exempt/userpoints_role_exempt.info	2 Aug 2010 21:14:50 -0000
@@ -3,4 +3,5 @@ name = Role exempt
 description = Exempts certain roles from earning userpoints. Useful for admin and moderators.
 package = Userpoints
 dependencies[] = userpoints
-core = 6.x
+core = 7.x
+files[]=userpoints_role_exempt.module
Index: userpoints_role_exempt/userpoints_role_exempt.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints_contrib/userpoints_role_exempt/userpoints_role_exempt.module,v
retrieving revision 1.3.2.3
diff -u -p -r1.3.2.3 userpoints_role_exempt.module
--- userpoints_role_exempt/userpoints_role_exempt.module	12 Apr 2009 19:14:56 -0000	1.3.2.3
+++ userpoints_role_exempt/userpoints_role_exempt.module	2 Aug 2010 21:14:50 -0000
@@ -60,7 +60,7 @@ function userpoints_role_exempt_is_exemp
     return TRUE;
   }
   // Load the user object
-  $account = user_load(array('uid' => $uid));
+  $account = user_load($uid);
 
   // Search the user's roles
   foreach($account->roles as $rid => $name) {
