MyBB Community Forums

Full Version: Hide banned members from memberlist?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to hide banned members on the member list?
Not in the stock code. However... (Assuming 1.6.5 or later) this should do the trick
Hello

I just added the above and activated the plugin but I am now getting these errors:

Warning [2] Missing argument 1 for DB_MySQLi::free_result(), called in /home/dan9/public_html/forum/inc/plugins/dymy_hide_banned_users.php on line 57 and defined - Line: 873 - File: inc/db_mysqli.php PHP 5.2.17 (Linux)

Warning [2] mysqli_free_result() expects parameter 1 to be mysqli_result, null given - Line: 875 - File: inc/db_mysqli.php PHP 5.2.17 (Linux)
Me to, this is what my members list looks using this plugin.
[Image: wv289u.png]

Can someone help us?
Is there any update to this?

Or is there a way to turn off the 'Banned' class from being displayed in the members list without a plugin?

Seems strange to have this display by default to everyone rather than just admins.
You could edit the query to have a where clause. If you didn't delete the ban group you should be able to put WHERE gid!=7 in the WHERE clause.
Which php file are you referring to? I can't see WHERE in the code of 'memberlist'. Ah you want me to add a clause in. Where do I put that and what do I put in?
Find in memberlist.php line: 224
$query = $db->query("
		SELECT u.*, f.*
		FROM ".TABLE_PREFIX."users u
		LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
		WHERE {$search_query}
		ORDER BY {$sort_field} {$sort_order}
		LIMIT {$start}, {$per_page}
	");

Replace:

$query = $db->query("
		SELECT u.*, f.*
		FROM ".TABLE_PREFIX."users u
		LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
		WHERE `usergroup`!=7 {$search_query}
		ORDER BY {$sort_field} {$sort_order}
		LIMIT {$start}, {$per_page}
	");

That should work.
Thank you.

Though my memberlist.php only goes to 110 lines and that's for both my theme memberlist and the root default one.
So wait is this 100% working and will this also subtract the number of banned user in the forum homepage stats where it shows the number of members?