MyBB Hacks

Full Version: Members Hider in memberlist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using this function

PHP Code:
function mem_hide()
{
	global $db, $mybb, $usergroup, $groupscache, $uid, $user;
	$enable = $mybb->settings['mem_hide_enable'];
	$uid = $user['uid'];
	$xuid = explode(",",$mybb->settings['mem_hide_uid']);
	$gid = $user['usergroup'];
	$xgid = explode(",",$mybb->settings['mem_hide_gid']);

	if ($enable != '0')
	{
		if (in_array($uid,$xuid) && in_array($gid,$xgid) && $mybb->user['usergroup'] != '4')
		{
			continue;
		}
	}
}


and plugin hooked to:

PHP Code:
$plugins->add_hook("memberlist_user", "mem_hide");


But it comes up empty ! Ouch

Help Zinga !

The "continue" statement just returns to the top of a loop, however, there is no loop in your plugin (it cannot magically span to loops outside your plugin).

Doing what you're trying to do isn't the easiest thing.  Looking at your approach, perhaps you could hack the memberlist_user template cache (eg $templates->cache['memberlist_user'] = '';) to hide the user (don't forget to restore it for normal users).
This isn't really ideal, however, is it can mess up the number of users on each page displayed, but perhaps this is suffice for your purposes.  A better fix would require editing the query - you could either re-query, or do object hacking (which is generally what I do).
Thank You Yumi.
Reference URL's