Members Hider in memberlist
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #1
Question Members Hider in memberlist
I am using this function

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 !


[Image: logo.png]

[Image: twitter.png]
07-04-2010 09:43 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Members Hider in memberlist
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).

My Blog
07-05-2010 11:47 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #3
RE: Members Hider in memberlist
Thank You Yumi.

[Image: logo.png]

[Image: twitter.png]
07-06-2010 12:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: