Member search

Member search [Paid] 2.2

No permission to buy ($35.00)
Hi @AndyB,

Any chance you could please add an option to exclude results from a specific user group?

I have an inactive members group and I don't want them showing up in the results.

Thanks :)
 
Hi @AndyB,

Any chance you could please add an option to exclude results from a specific user group?

I have an inactive members group and I don't want them showing up in the results.

Thanks :)
if you're prepared to do modifications to the add-on code
you can do the following:

in the /src/addons/Andy/MemberSearch/Pub/Controller/MemberSearch.php file
search for // get users,
then add the lines:
PHP:
$finder = $this->finder('XF:User');
$inSet = $finder->expression("NOT FIND_IN_SET(3, secondary_group_ids)");
Don't forget to change the usergroup to the one you want to hide results from...

then, in both of the finders that follow add:
PHP:
->where($inSet)

this is what it looks like in my file:
PHP:
if (!$sortByLastActivity)
{
    $finder = $this->finder('XF:User')
        ->with('Profile', true)
        ->with('Activity')
        ->isValidUser()
        ->where($inSet)
        ->order('username', 'ASC')
        ->limit($limit);
}
       
if ($sortByLastActivity)
{
    $finder = $this->finder('XF:User')
        ->with('Profile', true)
        ->with('Activity')
        ->isValidUser()
        ->where($inSet)
        ->order('last_activity', 'DESC')
        ->limit($limit);
}

It works for me :)
Thank you @AndyB for your add-on!
 
Top Bottom