Please or Register to create posts and topics.

Memberlist: show only members with certain roles

Is there a way to show on memberlist page only members that have certain roles? I got lots of shop users that should not be listed on memberlist. I need to distinguish between shop users (dont show) and users of the forum (show).

Hello Magma,

can a shop-user also be a forum-user or are those user strictly separated?

I think the simplest solution I can provide at the moment would be a new filter which allows you to only show members inside the list who have at least one post so you can be sure that only active forum-members will be displayed inside the list.

If this would be fine for you, let me know so I can add this in the next update.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Thank you. I strictly need to separate forum user from other users (including shop users). Only users that have been registered via forum register form should be displayed within the forum member list. That would be great. By the way this is a feature all forum plugins lacks (as far as I tested). The ability to seperate forum users from other wordpress users would be distinctive.

Showing only members inside the list who have at least one post would fit better for me than the actual solution. But it  has the negative effect that not all registered forum members would be displayed.

Only users that have been registered via forum register form should be displayed within the forum member list. That would be great. By the way this is a feature all forum plugins lacks (as far as I tested). The ability to seperate forum users from other wordpress users would be distinctive.

This of course depends on the way on how you use it. If I would strictly separate users between WordPress and forum, it would not be a real WordPress-extension anymore. One of the advantages of Asgaros Forum is the integration into WordPress, which means, that you can use your existing user-base, your existing user management, permission-checking, user-meta-data-storage, etc. Separating this entirely from each other means, that I have to implement all of this existing functionality again by myself and that administrators have to take care/synchronize different user-bases for the same site. In this case there would be no difference anymore in using a standalone-forum-system like phpBB or SimpleMachines which you just manually integrate into your website.

Showing only members inside the list who have at least one post would fit better for me than the actual solution. But it  has the negative effect that not all registered forum members would be displayed.

So this sounds more like you need some custom-implementation for it in combination with your existing shop-logic. How do you detect inside your WordPress-system if a user belongs to the shop or not? Do you have some function for it or does the user has a specific database-meta-value assigned to it which can be used to filter those users?

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Do you have some function for it or does the user has a specific database-meta-value assigned to it which can be used to filter those users?

This is the string that locates the shop customer:

SELECT * FROM `wp_usermeta` WHERE `meta_value` LIKE ‘%customer%’

 

Meta value ‘customer’ is the role in Wordpress.

I am not exactly sure how this looks inside your database, but you can try the following:

Open the includes/forum-memberslist.php-file.

Search for:

$allUsers = get_users();

Replace it with:

$allUsers = get_users(array('meta_value' => 'customer'));

I am not sure if this works but you can play a little bit around with it. Here you can find possible parameters for this function:

https://codex.wordpress.org/Function_Reference/get_users#Parameters

If you can find a working implementation, so let me know. This allows me to add a filter for it with a later release.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!