QueenMother305

help appreciated. 

Be the first person to like this.
Jonathan Mitchell

I have 2 ways of doing this

1. Hides the group within the website and hides the group in the admincp

2. Hides the group within the website and shows the group in the admincp (recommended).

Im not sure how to post code here, so if you want to msg me, feel free

 

Last update on October 17, 2021 by Jonathan Mitchell.
Be the first person to like this.
Jonathan Mitchell

1st off, I use these on my site and have had no problems with them

I would also like to credit these codes/plugins to WebWolf and Steward

You would need to add a plugin called "user.component_controller_browse_filter_process.php"
containing the code (between php tags):

<?php $oFilter->setCondition('AND u.user_group_id != \'2\''); ?>

Place in the module/user/include/plugin/ folder. If there is already a plugin with that name there, the code can be added to the existing plugin.

Change the 2 to the user_group_id number that you do not want to appear in the search results.

This code will hide the selected group in both the website browse and the admincp browse. (to hide just in the websites browse, scroll down to update
-----------------------------------
example groups:
1  support
2  registered
3  guest
4  staff
5  banned

-----------------------------------------------


Update:

To hide in users browse , but to still show in admincp browse use:

if (!(defined('PHPFOX_IS_ADMIN_SEARCH'))) { $oFilter->setCondition('AND u.user_group_id != \'2\''); }


-----------


If you need to exclude multiple groups, so the sql is a little different:

if (!(defined('PHPFOX_IS_ADMIN_SEARCH'))) { $oFilter->setCondition('AND u.user_group_id NOT IN (1,2,6,7)'); }

If the above code for hiding multiple groups doesnt work for you, enter each group separately as shown below
 

<?php $oFilter->setCondition('AND u.user_group_id != \'1\''); $oFilter->setCondition('AND u.user_group_id != \'2\''); $oFilter->setCondition('AND u.user_group_id != \'6\''); $oFilter->setCondition('AND u.user_group_id != \'7\''); ?>

JohnJr

Good stuff!

Be the first person to like this.