How do I only show users according to profile roles and not "all users"?
Rajaito - April 23, 2009 - 18:40
| Project: | User List |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I would like to use user list to show only the artist profiles I have created on my site.
However by default the module lists all users, but it does allow me to filter by the profile roles I have setup.
I would simply like to tell user list not to display "all users".
Can you tell me where I can adjust this in the code or template or wherever?
Thank you very much.

#1
No-one knows how to do this?
#2
Hi Rajaito,
I installed this module and I got the same error.
I fixed this patching the file user_list.module, inserting the follow lines:
$op = 'roles';
$role_type = 'your role';
inside the _user_list function.
And I selected the role in the admin page: ?q=admin/settings/user_list
regards,
Tiago
#3
Thank you for the advice Tiago, but I need a little more explanation. Where exactly do I put that code?
#4
Edit this file:
/sites/all/modules/user_list/user_list.module
Search for "function _user_list" and right after the opening bracket insert:
$op = 'roles';
$role_type = 'your role';
So the function code looks like this initially:
--- start - line 54 or so---
function _user_list($op = 'all', $number = NULL, $paginated = TRUE, $include_more_link = NULL, $default_header = NULL, $default_empty_msg = NULL, $content_type = NULL, $embed_menu = NULL, $from_block = FALSE, $element_override = NULL, $role_type = NULL) {
...
--- end ---
change it to this:
--- start - line 54 or so---
function _user_list($op = 'all', $number = NULL, $paginated = TRUE, $include_more_link = NULL, $default_header = NULL, $default_empty_msg = NULL, $content_type = NULL, $embed_menu = NULL, $from_block = FALSE, $element_override = NULL, $role_type = NULL) {
$op = 'roles';
$role_type = 'your role';
...
--- end ---
You can of course customize this for a particular site so one site has one user list display and another a different one.