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

How to view banned members in forum

Phillip

Active member
#1
What is the best way to give mods the ability to see that members have banned without control panel access? Is there a reliable add-on that will let mods see on the forum (like user pages, member cards, etc.) if a member has banned?

It appears that the only way to view banned info by default is through the admin control panel. I'd like to adjust this so that mods can view whether a member has been banned or not on the forum itself.
 

Phillip

Active member
#3
Set a high styling priority for your Banned Users usergroup, and then configure User Title or User Name CSS for that usergroup.
Thank you for the help. If it's not too much trouble, can you please post step-by-step instructions on how to do this?
 

Russ

Well-known member
#4
Thank you for the help. If it's not too much trouble, can you please post step-by-step instructions on how to do this?

Click Users - > List User Groups -> Banned

Display Styling Priority:
10
User Title Override:
BANNED
User Name CSS:
color: #ea1600;
font-weight: bold;
 

Jake Bunce

XenForo moderator
Staff member
#5
Here is one option:

http://xenforo.com/community/threads/template-files-see-if-user-is-banned.18026/#post-234310

That template edit affects avatars in posts.

Mouth is talking about setting a user title. You would have to create a new group for banned users and then specify it as the banned group:

Admin CP -> Home -> Options -> User Discouragement and Discipline -> Add User Group on Ban

Then set an appropriate user title and high display priority (higher than other groups) for the banned group:

Admin CP -> Users -> List User Groups -> [click the group]
> Display Styling Priority
> User Title Override
 
#6
Is there any way to let registered users view banned profiles? If I check "Bypass user privacy: Allow" for this group it also makes possible for them to view invisible members online.
 

Jake Bunce

XenForo moderator
Staff member
#7
Is there any way to let registered users view banned profiles? If I check "Bypass user privacy: Allow" for this group it also makes possible for them to view invisible members online.
library/XenForo/Model/UserProfile.php

Remove (or comment) the red code:

Code:
	public function canViewFullUserProfile(array $user, &$errorPhraseKey = '', array $viewingUser = null)
	{
		$this->standardizeViewingUserReference($viewingUser);

		if ($viewingUser['user_id'] == $user['user_id'])
		{
			return true; // always let a user view their own profile
		}

		if (!XenForo_Permission::hasPermission($viewingUser['permissions'], 'general', 'viewProfile'))
		{
			return false;
		}

		$userModel = $this->_getUserModel();

		if (!$userModel->passesPrivacyCheck($user['allow_view_profile'], $user, $viewingUser))
		{
			$errorPhraseKey = 'member_limits_viewing_profile';
			return false;
			// TODO: we should do a limited profile at some point
		}

		// don't display the profiles of unconfirmed users
		if ($user['user_state'] != 'valid' & $user['user_state'] != 'email_confirm_edit' && !$userModel->canByPassUserPrivacy($user['user_id']))
		{
			$errorPhraseKey = 'this_users_profile_is_not_available';
			return false;
		}

		// user profiles of permanently-banned users should be unavailable to all but privacy-bypassing users
		if ($user['is_banned'])
		{
			$ban = $this->getModelFromCache('XenForo_Model_Banning')->getBannedUserById($user['user_id']);

			if ($ban && $ban['end_date'] == 0 && !$userModel->canBypassUserPrivacy($null, $viewingUser))
			{
				$errorPhraseKey = 'this_users_profile_is_not_available';
				return false;
			}
		}

		return true;
	}
That will make it so banned user profiles are viewable to all (who have permission to view profiles).

This can be made into an addon by extending XenForo_Model_UserProfile.