MyBB Hacks

Full Version: Remove group from memberslist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I know by default MyBB doesn't have a way for people to choose which groups are displayed on the memberslist, however I think that would be a great plugin.

I need a plugin to stop the members in awaiting activation (not activated their account) from being displayed on the memberslist.

Could someone develop the plugin, or tell me he core edit to do so please.

Many thanks!
Found the core hack Smile

PHP Code:
if($user['usergroup'] == 5 && $mybb->user['usergroup'] != 4)
        {
            continue;
        } 

Which shows them only to admins which will do Smile

The above isn't exactly the best solution because paging won't necessarily work correctly for non-admins - that is, if you have 20 users per page, and there's 2 awaiting activation, normal users will see 18 on that particular page.
But it may be sufficient for your needs.
Something like this?

memberlist.php, line #188:

PHP Code:
// Yahoo! Messenger address
if(trim($mybb->input['yahoo']))
{
	$search_query .= " AND u.yahoo LIKE '%".$db->escape_string_like($mybb->input['yahoo'])."%'";
	$search_url .= "&yahoo=".urlencode($mybb->input['yahoo']);
}


And add this code after the code above:

PHP Code:
if($mybb->user['usergroup'] != 4){
	$search_query .= ' AND u.usergroup!=5';
}

Open memberlist.php and find:

PHP Code:
eval("\$users .= \"".$templates->get("memberlist_user")."\";");


replace with:

PHP Code:
if($user['usergroup'] != "5") {
		eval("\$users .= \"".$templates->get("memberlist_user")."\";");
		}


After that all users in group "Awaiting Avtivation" will not displayed in memberlist.

Regards
TriTop

Reference URL's