--- profileplus.module.ori	Tue Apr 25 12:56:42 2006
+++ profileplus.module	Tue Mar 20 08:08:11 2007
@@ -1,4 +1,4 @@
-<?php
+﻿<?php
 // profileplus.module,v 1.2 2006/04/23 01:07:50 budda Exp
 /*
  * ProfilePlus adds additional functionality to the core profile.module
@@ -19,6 +19,7 @@ function profileplus_help($section) {
 /**
  * Hide the default 'users' tab from the search page as it is useless
  */
+
 function profileplus_menu() {
   $items = array();
 
@@ -44,8 +45,8 @@ function profile_search($op = 'search', 
         $keys = preg_replace('!\*+!', '%', $keys);
         if (user_access('administer users')) {
           // administrators don't have restrictions
-          $sql = "FROM {users} u INNER JOIN {profile_values} pv ON u.uid = pv.uid INNER JOIN {profile_fields} pf ON pv.fid = pf.fid WHERE LOWER(pv.value) LIKE LOWER('%%%s%%')";
-          $result = pager_query('SELECT DISTINCT u.* '.$sql, 15, 0, 'SELECT COUNT(DISTINCT u.uid) '.$sql, $keys);
+          $sql = "FROM {users} u INNER JOIN {profile_values} pv ON u.uid = pv.uid INNER JOIN {profile_fields} pf ON pv.fid = pf.fid WHERE (LOWER(pv.value) LIKE LOWER('%%%s%%') OR u.name LIKE '%%%s%%')";
+          $result = pager_query('SELECT DISTINCT u.* '.$sql, 15, 0, 'SELECT COUNT(DISTINCT u.uid) '.$sql, $keys, $keys);
         }
         else {
           // non-administrators can only search public fields and active users
