Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Members list - Admins&Members but no Moderators
Avatar
ernohannink
Doetinchem, Netherlands
Member
Free Members
sp_UserOfflineSmall Offline
Feb 2, 2012 - 1:34 am

Thank you - you mean directly in spMembersView.php?

Or do you do this in functions.php?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 2, 2012 - 5:52 am

No. How much do you know about using WordPress filters? If not a lot... then first step would be to check them out in the WP Codex.

The members list class provides a filter named 'sph_members_list_query' which passes a query object. So in the theme spFunctions.php file you can use the

 

add_filter('sph_members_list_query', 'your_function_name');

call to create your own function to manipulate the SQL.

function your_function_name($spdb)

The $spdb object contains the following properties:

$spdb->table
$spdb->fields
$spdb->found_rows
$spdb->distinct
$spdb->left_join
$spdb->where
$spdb->orderby
$spdb->limits

I warn you though that this query is somewhat complex and is due to be reviewed in a future release (i.e., a 5.1 or later) to make it simpler - possibly breaking into more than one query.

andy-signature.png
YELLOW
SWORDFISH
Avatar
chantalcoolsma
Hellevoetsluis, Netherlands
Member
Free Members
sp_UserOfflineSmall Offline
Feb 2, 2012 - 6:03 am

Will take a look into it. Thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 2, 2012 - 6:11 am

Let us know how you get on.

andy-signature.png
YELLOW
SWORDFISH
Avatar
chantalcoolsma
Hellevoetsluis, Netherlands
Member
Free Members
sp_UserOfflineSmall Offline
Feb 2, 2012 - 6:34 am

Easiest way would be if you could give the admins group a different class than spMemberGroupsSection. Then you could just hide it using CSS. Now all membergroups have the same class spMemberGroupsSection.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 2, 2012 - 7:17 am

Giving each group it's own class based on the group name is not a bad idea and I will open a ticket to do that.

And yes this would be the easiest. But it doesn't do things properly.

The main problem would be if you had quite a few admins then the first page would look a little odd with only a small number of members showing as the paging controls will still include the missing rows.

andy-signature.png
YELLOW
SWORDFISH
Avatar
chantalcoolsma
Hellevoetsluis, Netherlands
Member
Free Members
sp_UserOfflineSmall Offline
Feb 2, 2012 - 7:26 am

True.

Avatar
chantalcoolsma
Hellevoetsluis, Netherlands
Member
Free Members
sp_UserOfflineSmall Offline
Feb 20, 2012 - 1:43 pm

Mr Papa said

no, sorry...  admins are visible to all users in the member list...

there is a filter on the query, so you could add a function that filters the query based on the current user and their memberships...

Can you give me an example? I have looked into the query, but I can't see how to use that filter. Any help would be appreciated!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 20, 2012 - 8:06 pm

chantalcoolsma, first please explain what you want to do...  remove admins from the moderator list? or one of the other points discussed in this topic?

your post #15 item is already included in the released 5.0...

Avatar
chantalcoolsma
Hellevoetsluis, Netherlands
Member
Free Members
sp_UserOfflineSmall Offline
Feb 21, 2012 - 1:55 am

Great! Didn't notice the new CSS classes. Solved!

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626