Display a list of users/members in a block

Permalink 1 user found helpful
Hello,
Our site has a group of users (we call members) that need to be listed on our site for everyone to see. We do not want anyone to login to see the list.

The users belong to one group in concrete5.
Is there a built in option to display a list of the users in the group?
I haven't found anything that works.

Will I need to make a block?
With only knowing the group name, how do I go about finding all the users and then display their attributes (ideally specific attributes) for everyone to see?

dstew99
 
dstew99 replied on at Permalink Reply
dstew99
I must not be describing my problem well.

User1, User2, and User3 all belong to Group1.

I want to have a simple list displayed on the website, for everyone to see, that shows all of the users in the group.

Is there something to built into Concrete5 for this?
Tony replied on at Permalink Reply
Tony
you don't necessarily need to make a block. You can just use a single page instead if you want. but basically you'll just need to use the UserList class, in the /concrete/models/ directory. It provides an easy way to get all users for a group.
dstew99 replied on at Permalink Reply
dstew99
Again, thanks for the response.

<?php   
Loader::model('user_list'); 
$userList = new UserList(); 
$userList->filterByGroup('members');
var_dump($userList->get());?>


This will give me an array of each user. Yay!

What to do with that?

<?php echo $userList->getUserGender()?>
zoinks replied on at Permalink Reply
Is this the answer up above? The quoted code + the php echo line is all I need to make this happen?

Thanks!
zoinks replied on at Permalink Reply
bump
mgraves10 replied on at Permalink Best Answer Reply
@Zoinks: Yes, this is how you get users by group. It would probably have saved you time if you put this code into a file and ran it, rather than waiting a month for a response.
andrew replied on at Permalink Reply
andrew
Hah. I really wanted to mark this as the best answer.
ScottC replied on at Permalink Reply
ScottC
too slow.
jem1516 replied on at Permalink Reply
Any updates on this, as it does not seem to work on fresh installations of C5.

Thanks.
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
You can have a look into http://www.concrete5.org/marketplace/addons/enhanced-user-list/...

Though this add-on says "No Longer Available", but still I purchase this and do some customization to make it working. Now its working fine and fulfill the requirements.

Rony