diff --git a/drupalvb.admin-pages.inc b/drupalvb.admin-pages.inc
index c8b8d66..f2e37c3 100644
--- a/drupalvb.admin-pages.inc
+++ b/drupalvb.admin-pages.inc
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Drupal vB system settings.
diff --git a/drupalvb.inc b/drupalvb.inc
index 9324452..57c11ee 100644
--- a/drupalvb.inc
+++ b/drupalvb.inc
@@ -14,7 +14,7 @@
  */
 function drupalvb_db_is_valid() {
   static $is_valid = NULL;
-  if ($is_valid!=NULL) {
+  if ($is_valid != NULL) {
     return $is_valid;
   }
 
@@ -113,10 +113,11 @@ function _drupalvb_init_user_map() {
   foreach ($result as $vbuser) {
     if (isset($users[$vbuser->username])) {
       db_insert("drupalvb_users")
-      ->fields(array(
-        "uid" => $users[$vbuser->username],
-        "userid" => $vbuser->userid
-      ));
+        ->fields(array(
+          'uid' => $users[$vbuser->username],
+          'userid' => $vbuser->userid,
+        ))
+        ->execute();
     }
   }
 }
diff --git a/drupalvb.inc.php b/drupalvb.inc.php
index 1475988..8b0e0c5 100644
--- a/drupalvb.inc.php
+++ b/drupalvb.inc.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Drupal vB CRUD functions.
@@ -38,8 +39,8 @@ function drupalvb_set_login_cookies($userid) {
   }
 
   // Clear out old session (if available).
-  if (!empty($_COOKIE[$cookie_prefix .'sessionhash'])) {
-    drupalvb_db_query("DELETE FROM {session} WHERE sessionhash = :hash", array(":hash" => $_COOKIE[$cookie_prefix .'sessionhash']));
+  if (!empty($_COOKIE[$cookie_prefix . 'sessionhash'])) {
+    drupalvb_db_query("DELETE FROM {session} WHERE sessionhash = :hash", array(":hash" => $_COOKIE[$cookie_prefix . 'sessionhash']));
   }
 
   // Setup user session.
@@ -51,11 +52,11 @@ function drupalvb_set_login_cookies($userid) {
   drupalvb_db_query("REPLACE INTO {session} (sessionhash, userid, host, idhash, lastactivity, location, useragent, loggedin) VALUES (:hash, :userid, :host, :idhash, :lastactivity, :location, :useragent, :loggedin)", array(":hash" => $sessionhash, ":userid" => $vbuser['userid'], ":host" => substr($_SERVER['REMOTE_ADDR'], 0, 15), ":idhash" => $idhash, ":lastactivity" => $now, ":location" => '/forum/', ":useragent" => $browserstring, ":loggedin" => 2));
 
   // Setup cookies.
-  setcookie($cookie_prefix .'sessionhash', $sessionhash, $expire, $cookie_path, $vb_cookie_domain);
-  setcookie($cookie_prefix .'lastvisit', $now, $expire, $cookie_path, $vb_cookie_domain);
-  setcookie($cookie_prefix .'lastactivity', $now, $expire, $cookie_path, $vb_cookie_domain);
-  setcookie($cookie_prefix .'userid', $vbuser['userid'], $expire, $cookie_path, $vb_cookie_domain);
-  setcookie($cookie_prefix .'password', md5($vbuser['password'] . variable_get('drupalvb_license', '')), $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'sessionhash', $sessionhash, $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'lastvisit', $now, $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'lastactivity', $now, $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'userid', $vbuser['userid'], $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'password', md5($vbuser['password'] . variable_get('drupalvb_license', '')), $expire, $cookie_path, $vb_cookie_domain);
   return TRUE;
 }
 
@@ -93,11 +94,11 @@ function drupalvb_clear_cookies($userid = NULL) {
     drupalvb_db_query("UPDATE {user} SET lastvisit = :time WHERE userid = :userid", array(":time" => time(), ":userid" => $userid));
   }
 
-  setcookie($cookie_prefix .'sessionhash', '', $expire, $cookie_path, $vb_cookie_domain);
-  setcookie($cookie_prefix .'lastvisit', '', $expire, $cookie_path, $vb_cookie_domain);
-  setcookie($cookie_prefix .'lastactivity', '', $expire, $cookie_path, $vb_cookie_domain);
-  setcookie($cookie_prefix .'userid', '', $expire, $cookie_path, $vb_cookie_domain);
-  setcookie($cookie_prefix .'password', '', $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'sessionhash', '', $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'lastvisit', '', $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'lastactivity', '', $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'userid', '', $expire, $cookie_path, $vb_cookie_domain);
+  setcookie($cookie_prefix . 'password', '', $expire, $cookie_path, $vb_cookie_domain);
 }
 
 /**
@@ -136,13 +137,13 @@ function drupalvb_get_ip() {
  */
 function drupalvb_create_user($account, $edit) {
   // Ensure we are not duplicating a user.
-  $userid = drupalvb_db_select("user","u")
-          ->fields("u", array("userid") )
-          ->condition("username", drupalvb_htmlspecialchars($edit['name']) )
-          ->execute()
-          ->fetchColumn(0);
+  $userid = drupalvb_db_select('user', 'u')
+    ->fields('u', array('userid') )
+    ->condition('username', drupalvb_htmlspecialchars($edit['name']) )
+    ->execute()
+    ->fetchColumn(0);
 
-  if(!$userid) {
+  if (!$userid) {
     $salt = '';
     for ($i = 0; $i < 3; $i++) {
       $salt .= chr(rand(32, 126));
@@ -154,11 +155,11 @@ function drupalvb_create_user($account, $edit) {
     else {
       $passhash = md5(md5($edit['pass']) . $salt);
     }
-  
+
     $time = $account->created;
     $passdate = date('Y-m-d', $time);
     $joindate = $time;
-  
+
     // Attempt to grab the user title from the database.
     $result = drupalvb_db_query("SELECT title FROM {usertitle} WHERE minposts = 0");
     if ($resarray = $result->fetchAssoc()) {
@@ -167,15 +168,15 @@ function drupalvb_create_user($account, $edit) {
     else {
       $usertitle = 'Junior Member';
     }
-  
+
     // Divide timezone by 3600, since vBulletin stores hours.
     $timezone = variable_get('date_default_timezone', 0);
     $timezone = ($timezone != 0 ? $timezone / 3600 : 0);
-  
+
     // Default new user options: I got these by setting up a new user how I
     // wanted and looking in the database to see what options were set for him.
     $options = variable_get('drupalvb_default_options', '3415');
-  
+
     // Default usergroup id.
     $usergroupid = variable_get('drupalvb_default_usergroup', '2');
     $lid = drupalvb_get_languageid();
@@ -184,32 +185,33 @@ function drupalvb_create_user($account, $edit) {
     }
     // Insert user to vBulletin
     $userid = drupalvb_db_insert("user")
-    ->fields( array(
-      "username" => drupalvb_htmlspecialchars($edit['name']),
-      "usergroupid" => $usergroupid,
-      "password" => $passhash,
-      "passworddate" => $passdate,
-      "usertitle" => $usertitle,
-      "email" => $account->mail,
-      "salt" => $salt,
-      "languageid" => 1,
-      "timezoneoffset" => $timezone,
-      "joindate" => $joindate,
-      "lastvisit" => time(),
-      "lastactivity" => time(),
-      "options" => $options
-    ))->execute();
-  
+      ->fields(array(
+        "username" => drupalvb_htmlspecialchars($edit['name']),
+        "usergroupid" => $usergroupid,
+        "password" => $passhash,
+        "passworddate" => $passdate,
+        "usertitle" => $usertitle,
+        "email" => $account->mail,
+        "salt" => $salt,
+        "languageid" => 1,
+        "timezoneoffset" => $timezone,
+        "joindate" => $joindate,
+        "lastvisit" => time(),
+        "lastactivity" => time(),
+        "options" => $options,
+      ))
+      ->execute();
+
     $rr = drupalvb_db_query("SELECT * FROM {userfield} WHERE userid=1");
     $fields = $rr->fetchAssoc();
-    foreach($fields as $f => $v) $fields[$f] = '';
+    foreach ($fields as $f => $v) $fields[$f] = '';
     $fields['userid'] = $userid;
     drupalvb_db_insert("userfield")->fields($fields)->execute();
-    
+
     $rr = drupalvb_db_query("SELECT * FROM {usertextfield} WHERE userid=1");
     $fields = $rr->fetchAssoc();
-    foreach($fields as $f => $v) $fields[$f] = '';
-    $fields['userid'] = $userid;    
+    foreach ($fields as $f => $v) $fields[$f] = '';
+    $fields['userid'] = $userid;
     drupalvb_db_insert("usertextfield")->fields($fields)->execute();
   }
 
@@ -223,7 +225,7 @@ function drupalvb_create_user($account, $edit) {
 /**
  * Update a user in vBulletin.
  */
-function drupalvb_update_user($account, $edit) { 
+function drupalvb_update_user($account, $edit) {
   $fields = $values = array();
 
   foreach ($edit as $field => $value) {
@@ -237,7 +239,7 @@ function drupalvb_update_user($account, $edit) {
         break;
 
       case 'clear_pass':
-        if(empty($edit['salt'])) {
+        if (empty($edit['salt'])) {
           $salt = '';
           for ($i = 0; $i < 3; $i++) {
             $salt .= chr(rand(32, 126));
@@ -271,12 +273,12 @@ function drupalvb_update_user($account, $edit) {
   if (isset($edit['userid'])) {
     $userid = $edit['userid'];
   }
-  else if (!$userid = drupalvb_get_userid($account->uid)) {
+  elseif (!$userid = drupalvb_get_userid($account->uid)) {
     $userid = drupalvb_db_query("SELECT userid FROM {user} WHERE username = :name", array(':name' => drupalvb_htmlspecialchars($account->name)))->fetchField();
   }
   drupalvb_set_mapping($account->uid, $userid);
 
-  $values[':userid'] = $userid;    
+  $values[':userid'] = $userid;
   drupalvb_db_query("UPDATE {user} SET " . implode(', ', $fields) . " WHERE userid=:userid", $values);
 }
 
@@ -408,10 +410,10 @@ function drupalvb_get_languageid($language = NULL) {
 function drupalvb_get_users_online() {
   $vb_options = drupalvb_get_options();
 
-  $datecut          = time() - $vb_options['cookietimeout'];
-  $numbervisible    = 0;
+  $datecut = time() - $vb_options['cookietimeout'];
+  $numbervisible = 0;
   $numberregistered = 0;
-  $numberguest      = 0;
+  $numberguest = 0;
 
   $result = drupalvb_db_query("SELECT user.username, user.usergroupid, session.userid, session.lastactivity FROM {session} AS session LEFT JOIN {user} AS user ON (user.userid = session.userid) WHERE session.lastactivity > :datecut", array(':datecut' => $datecut));
 
diff --git a/drupalvb.install b/drupalvb.install
index dfd3692..7c10cb8 100644
--- a/drupalvb.install
+++ b/drupalvb.install
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Install, update, and uninstall functions for Drupalvb.
diff --git a/drupalvb.module b/drupalvb.module
index 418e704..2e44f5e 100644
--- a/drupalvb.module
+++ b/drupalvb.module
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Drupal vB module core functions for Drupal.
@@ -63,8 +64,6 @@ function drupalvb_help($path, $arg) {
  * Implements hook_menu().
  */
 function drupalvb_menu() {
-  $items = array();
-
   $items['admin/config/system/drupalvb'] = array(
     'title' => 'Drupal vB integration',
     'page callback' => 'drupalvb_settings',
@@ -199,42 +198,41 @@ function drupalvb_form_alter(&$form, $form_state, $form_id) {
 function drupalvb_user_account_form_validate($form, &$form_state) {
   $account = $form['#user'];
   $val = $form_state['values'];
-  
+
   $userid = drupalvb_get_userid($account->uid);
   if (!$userid) {
     $userid = 0;
   }
-  
+
   // If registering, do not allow the reuse of username or email in forums
   // If updating profile, do not allow changing the username to another forum username if it's already in use
-  
-  if ($form['#form_id'] == 'user_register_form' || ($userid>1 && $account->name!=$val['name']) ) {
-  
-    $count = drupalvb_db_query("SELECT count(*) FROM {user} 
-                               WHERE userid<>:userid AND username=:username", 
-                               array(':userid' => $userid, ':username' => drupalvb_htmlspecialchars($val['name'])))->fetchField();
-                               
+
+  if ($form['#form_id'] == 'user_register_form' || ($userid > 1 && $account->name != $val['name'])) {
+    $count = drupalvb_db_query('SELECT COUNT(*) FROM {user} WHERE userid <> :userid AND username = :username', array(
+      ':userid' => $userid,
+      ':username' => drupalvb_htmlspecialchars($val['name']),
+    ))->fetchField();
     if ($count > 0) {
-      form_set_error('name', t('The name %name is already taken in the forums.', array('%name' => $val['name'])));    
+      form_set_error('name', t('The name %name is already taken in the forums.', array('%name' => $val['name'])));
     }
   }
-  
-  
+
   if ($form['#form_id'] == 'user_register_form') {
-    $count = drupalvb_db_query("SELECT count(*) FROM {user} 
-                                 WHERE userid<>:userid AND email=:mail", 
-                                 array(':userid' => $userid, ':mail' => drupalvb_htmlspecialchars($val['mail'])))->fetchField();
-                                 
+    $count = drupalvb_db_query('SELECT COUNT(*) FROM {user} WHERE userid <> :userid AND email = :mail', array(
+      ':userid' => $userid,
+      ':mail' => drupalvb_htmlspecialchars($val['mail']),
+    ))->fetchField();
     if ($count > 0) {
       form_set_error('mail', t('The e-mail address %email is already registered in the forums. <a href="@password">Have you forgotten your password?</a>', array('%email' => $val['mail'], '@password' => url('user/password'))));
     }
   }
-  
-  // Pass the plain text password to current_pass so we can update the forum password on hook_user_update
+
+  // Pass the plain text password to current_pass() so we can update the forum
+  // password on hook_user_update().
   if (!empty($form_state['values']['pass'])) {
     $form_state['values']['clear_pass'] = $form_state['values']['pass'];
   }
-  else if (!empty($form_state['values']['current_pass'])) {
+  elseif (!empty($form_state['values']['current_pass'])) {
     $form_state['values']['clear_pass'] = $form_state['values']['current_pass'];
   }
 }
@@ -243,12 +241,13 @@ function drupalvb_user_account_form_validate($form, &$form_state) {
  * Validate login against vBulletin user database.
  */
 function drupalvb_login_validate($form, &$form_state) {
-  if (!empty($form_state['uid'])) return;  // Already found the user from a previous validation function
-   
+  // Already found the user from a previous validation function
+  if (!empty($form_state['uid'])) {
+    return;
+  }
   if (!variable_get('drupalvb_dual_login', TRUE)) {
     return;
   }
-
   $username = $form_state['values']['name'];
   $password = trim($form_state['values']['pass']);
 
@@ -260,10 +259,10 @@ function drupalvb_login_validate($form, &$form_state) {
   if (!drupalvb_db_is_valid()) {
     return;
   }
-  if ($vbuser = drupalvb_db_query("SELECT userid, username, password, salt, email, joindate 
-                                   FROM {user} 
-                                   WHERE username = :username", 
-                                   array(":username" => drupalvb_htmlspecialchars($username)))->fetchAssoc()) {
+  $vbuser = drupalvb_db_query('SELECT userid, username, password, salt, email, joindate FROM {user} WHERE username = :username', array(
+    ':username' => drupalvb_htmlspecialchars($username)
+  ))->fetchAssoc();
+  if ($vbuser) {
     // Rebuild the password.
     $vbpassword = md5(md5($password) . $vbuser['salt']);
     if ($vbuser['password'] === $vbpassword) {
@@ -276,7 +275,7 @@ function drupalvb_login_validate($form, &$form_state) {
         // Only update the password of the existing Drupal user record.
         $account = user_load($uid);
         $userinfo['pass'] = $password;
-        $form_state['uid'] = $uid; 
+        $form_state['uid'] = $uid;
       }
       else {
         // This user is completely unknown to Drupal, register a new account.
@@ -322,14 +321,17 @@ function drupalvb_user_pass_validate($form, $form_state) {
   module_load_include('inc', 'drupalvb');
 
   // Try to import a corresponding user from vB.
-  if ($userid = drupalvb_db_query("SELECT userid FROM {user} WHERE username = :username OR email = :email", array(':username' => drupalvb_htmlspecialchars($name), ':email' => $name))->fetchField()) {
+  $userid = drupalvb_db_query('SELECT userid FROM {user} WHERE username = :username OR email = :email', array(
+    ':username' => drupalvb_htmlspecialchars($name),
+    ':email' => $name,
+  ))->fetchField();
+  if ($userid) {
     drupalvb_lookup_drupal_user($userid);
   }
 }
 
 /**
- * Try to lookup a Drupal user account for a vBulletin user id, using the mapping
- * table.
+ * Looks up a Drupal uid for a vBulletin user ID in the mapping table.
  *
  * @param $userid
  *   A vBulletin user id.
@@ -339,8 +341,7 @@ function drupalvb_vb_user_load($userid) {
 }
 
 /**
- * Lookup a vBulletin user from the Drupal uid, using the mapping
- * table.
+ * Looks up a vBulletin userid for a Drupal uid in the mapping table.
  *
  * @param $uid
  *   A Drupal uid.
@@ -353,7 +354,6 @@ function drupalvb_get_userid($uid) {
  * Implements hook_user_login().
  *
  * Log in a user in vB upon login in Drupal.
- *
  */
 function drupalvb_user_login(&$edit, $account) {
   $vbuser = drupalvb_db_query("SELECT u.userid, ub.liftdate FROM {user} u LEFT JOIN {userban} ub ON ub.userid = u.userid WHERE u.username = :username", array(':username' => drupalvb_htmlspecialchars($account->name)))->fetchAssoc();
@@ -388,11 +388,10 @@ function drupalvb_user_login(&$edit, $account) {
  * Implements hook_user_logout.
  *
  * Log out a user in vB upon logout in Drupal.
- *
  */
 function drupalvb_user_logout($account) {
-  //A check must be made for database connectivity here, otherwise the logout
-  //process will be stopped.
+  // A check must be made for database connectivity here, otherwise the logout
+  // process will be stopped.
   if (!drupalvb_db_is_valid()) {
     watchdog('drupalvb', 'Forum session was NOT closed for user %username (@uid).', array('%username' => $account->name, '@uid' => $account->uid), WATCHDOG_ERROR);
     return;
@@ -408,10 +407,9 @@ function drupalvb_user_logout($account) {
 }
 
 /**
- * Implements hook_user_insert.
+ * Implements hook_user_insert().
  *
  * Register a new user in vB upon registration in Drupal.
- *
  */
 function drupalvb_user_insert($edit, $account) {
   global $user;
@@ -425,10 +423,9 @@ function drupalvb_user_insert($edit, $account) {
 }
 
 /**
- * Implements hook_user_update.
+ * Implements hook_user_update().
  *
  * Update a user in vB upon update in Drupal.
- *
  */
 function drupalvb_user_update($edit, $account) {
   global $user;
@@ -436,13 +433,13 @@ function drupalvb_user_update($edit, $account) {
   // Update data if user exists.
   $userid = drupalvb_get_userid($account->uid);
   if (!$userid) {
-    $userid = drupalvb_db_query_range("SELECT userid FROM {user} WHERE username = :name", 0,1, array(":name" => drupalvb_htmlspecialchars($account->name)))->fetchField();
+    $userid = drupalvb_db_query_range("SELECT userid FROM {user} WHERE username = :name", 0, 1, array(":name" => drupalvb_htmlspecialchars($account->name)))->fetchField();
   }
-  
+
   if ($userid) {
     // Merge current username, salt, and finally edited values into one array,
     // so usernames may be altered (if allowed).
-    drupalvb_update_user($account, array_merge(array('name' => $account->name, "userid" => $userid),$edit));
+    drupalvb_update_user($account, array_merge(array('name' => $account->name, "userid" => $userid), $edit));
   }
   // If not, create a new user in vB.
   else {
@@ -459,10 +456,9 @@ function drupalvb_user_update($edit, $account) {
 }
 
 /**
- * Implements drupalvb_user_delete.
+ * Implements hook_user_delete().
  *
  * Delete a user in vB upon deletion in Drupal.
- *
  */
 function drupalvb_user_delete($account) {
   // If vBulletin user exists, delete user account, session and profile data.
@@ -575,7 +571,7 @@ function drupalvb_logout() {
 }
 
 /**
- * Implementation of hook_panels_include_directory().
+ * Implements hook_panels_include_directory().
  */
 function drupalvb_panels_include_directory($plugintype) {
   switch ($plugintype) {
@@ -754,8 +750,8 @@ function drupalvb_block_view($delta = '') {
  *   The type of data to display, 'threads' or 'posts'.
  */
 function drupalvb_block_recent($display) {
-  $date_cut   = time() - (variable_get('drupalvb_block_recent_limit', 7) * 86400);
-  $num_items  = variable_get('drupalvb_block_recent_count', 5);
+  $date_cut = time() - (variable_get('drupalvb_block_recent_limit', 7) * 86400);
+  $num_items = variable_get('drupalvb_block_recent_count', 5);
   $vb_options = drupalvb_get_options();
   switch ($display) {
     case 'threads':
@@ -820,7 +816,7 @@ function theme_drupalvb_block_recent($variables) {
  */
 function drupalvb_block_recent_user($account) {
   if ($vbuserid = drupalvb_get_userid($account->uid)) {
-    $num_items  = variable_get('drupalvb_block_recent_count', 5);
+    $num_items = variable_get('drupalvb_block_recent_count', 5);
     $vb_options = drupalvb_get_options();
     $result = drupalvb_db_query("SELECT p.postid, p.title, p.threadid, p.dateline AS created, p.userid, p.username AS name, t.title AS threadtitle, p.pagetext AS body FROM {post} p INNER JOIN {thread} t ON p.threadid = t.threadid INNER JOIN {forum} f ON f.forumid = t.forumid WHERE f.showprivate = 0 AND p.userid = :userid GROUP BY p.threadid ORDER BY p.dateline DESC LIMIT " . $num_items, array(':userid' => $vbuserid));
     $items = array();
@@ -1033,7 +1029,7 @@ function drupalvb_private_messages() {
   $output = '<p>' . t("Below is a list of private messages you have received.  You may click on a user's name to see their profile, a message's title to view it, or a reply link to message the user in return.") . '</p>';
   $output .= l('View your inbox.', $vb_options['bburl'] . '/private.php');
 
-  $result = drupalvb_db_query("SELECT userid, username FROM {user} WHERE username = :username", array(":username" => drupalvb_htmlspecialchars($user->name)) );
+  $result = drupalvb_db_query("SELECT userid, username FROM {user} WHERE username = :username", array(":username" => drupalvb_htmlspecialchars($user->name)));
 
   // If user exists, then grab and display a list of PMs.
   if ($userinfo = db_fetch_array($result)) {
@@ -1046,7 +1042,7 @@ function drupalvb_private_messages() {
       array('data' => t('Operations')),
     );
 
-    $result = drupalvb_db_query("SELECT pm.pmid, pm.userid, pm.messageread, pmtext.fromusername, pmtext.fromuserid, pmtext.title, pmtext.message, pmtext.dateline FROM {pmtext} AS pmtext LEFT JOIN {pm} AS pm ON (pm.pmtextid = pmtext.pmtextid) WHERE pm.userid = :userid AND pm.folderid <> -1 ORDER BY pmtext.dateline DESC", array(":userid" => $userinfo['userid']) );
+    $result = drupalvb_db_query("SELECT pm.pmid, pm.userid, pm.messageread, pmtext.fromusername, pmtext.fromuserid, pmtext.title, pmtext.message, pmtext.dateline FROM {pmtext} AS pmtext LEFT JOIN {pm} AS pm ON (pm.pmtextid = pmtext.pmtextid) WHERE pm.userid = :userid AND pm.folderid <> -1 ORDER BY pmtext.dateline DESC", array(":userid" => $userinfo['userid']));
     while ($pm = db_fetch_array($result)) {
       $rows[] = array(
         l($pm['fromusername'], $vb_options['bburl'] . '/member.php?u=' . $pm['fromuserid']),
@@ -1137,7 +1133,7 @@ function drupalvb_lookup_drupal_user($userid) {
     // the immediate second request tries to do the same again, resulting
     // in an error.
     if ($user->uid) {
-      watchdog('drupalvb', 'New external user: %user (unverified).', array('%user' => $user->name),  WATCHDOG_NOTICE, l(t('edit'), 'user/' . $user->uid . '/edit'));
+      watchdog('drupalvb', 'New external user: %user (unverified).', array('%user' => $user->name), WATCHDOG_NOTICE, l(t('edit'), 'user/' . $user->uid . '/edit'));
 
       // Update the mapping table.
       drupalvb_set_mapping($user->uid, $vbuser['userid']);
@@ -1180,7 +1176,7 @@ function drupalvb_privatemsg($message, $op) {
     case 'sent':
       // Verify that recipient exists in vB.
       $recipient = user_load($message->recipient);
-      
+
       if (!$userid = drupalvb_get_userid($message->recipient)) {
         if (!$userid = drupalvb_create_user($recipient, (array)$recipient)) {
           // Indicates duplicate username (should not happen).
