Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1e3e09e1
authored
2011-08-04 16:43:35 +0000
by
Marty Penner
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Promoting user search changes to live.
1 parent
ac8af503
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
lib/UserSearch.php
lib/UserSearch.php
View file @
1e3e09e
...
...
@@ -36,7 +36,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
protected
$userclass
=
'User'
;
public
function
__construct
(
Array
$fields
,
$num_results
=
-
1
,
$page
=
1
,
$sortby
=
null
,
$sortorder
=
'ASC'
,
Array
$field_match
=
null
,
$text_search
=
null
,
Array
$in_groups
=
null
)
{
public
function
__construct
(
Array
$fields
,
$num_results
=
-
1
,
$page
=
1
,
$sortby
=
null
,
$sortorder
=
'ASC'
,
Array
$field_match
=
null
,
$text_search
=
null
,
Array
$in_groups
=
null
,
$search_users_table
=
null
)
{
$this
->
userclass
=
__NAMESPACE__
.
'\User'
;
global
$wpdb
;
...
...
@@ -84,6 +84,13 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
$uam_clause
=
" AND `uam`.`object_type` = 'user' AND `uam`.`group_id` IN ("
.
implode
(
','
,
$in_groups
)
.
") "
;
}
// Users table
if
(
!
is_null
(
$search_users_table
))
{
if
(
!
empty
(
$having_clause
))
{
$having_clause
.=
"
\n
OR `user_id` IN (SELECT `ID` FROM `wp_users` WHERE (`user_login` LIKE '%
{
$search
}
%' OR `user_nicename` LIKE '%
{
$search
}
%'))"
;
}
}
mysql_query
(
"SET SESSION group_concat_max_len = 40960"
,
$wpdb
->
dbh
);
$query
=
"
...
...
@@ -111,6 +118,7 @@ class UserSearch implements ArrayAccess, Iterator, Countable {
{
$order_sort
}
{
$limit_clause
}
"
;
//die(var_dump($query));
/*
?>
<textarea style="width: 95%; height: 35em; font-size: 11px;" autofocus="autofocus">
...
...
Please
register
or
sign in
to post a comment