• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How do I allow members to ignore moderators/administrators?

CTXMedia

Formerly CyclingTribe
#1
Since there are no ignore system settings can anyone advise on how I would be able to allow my members to ignore moderators and/or administrators?

Thanks,
Shaun :D
 

CTXMedia

Formerly CyclingTribe
#3
You will need an add-on to do this properly, to override the core functionality.
Fair enough ... I was just wondering if there was a bit of PHP I could edit/comment out that would remove the exclusion and allow people to ignore mods/admins? (y)
 
R

ragtek

Guest
#4
XenForo_Model_UserIgnore::canIgnoreUser and remove/comment out

if ($user['is_moderator'] || $user['is_admin'])
{
if ($setError)
{
$error = new XenForo_Phrase('staff_members_may_not_be_ignored');
}
return false;
}
 

CTXMedia

Formerly CyclingTribe
#11
XenForo_Model_UserIgnore::canIgnoreUser and remove/comment out

if ($user['is_moderator'] || $user['is_admin'])
{
if ($setError)
{
$error = new XenForo_Phrase('staff_members_may_not_be_ignored');
}
return false;
}
Just a though - can I modify that first line so that you can ignore everyone except the Admin/Owner user account? (In my case, User ID: 1)

Cheers,
Shaun :D
 
R

ragtek

Guest
#13
Just a though - can I modify that first line so that you can ignore everyone except the Admin/Owner user account? (In my case, User ID: 1)

Cheers,
Shaun :D
PHP:
class Ragtek_TeamIgnore_Model_UserIgnore extends XFCP_Ragtek_TeamIgnore_Model_UserIgnore
{
public function canIgnoreUser($userId, array $user, &$error = '')
{
 
$return = parent::canIgnoreUser($userId, $user, $error);
if ($return == false AND $error == new XenForo_Phrase('staff_members_may_not_be_ignored') AND $user['user_id'] != 1)
{
return true;
}
return $return;
}
}