Viewing Profiles Only [Crossposted from .com]

Custom coding for various phpBB versions as well as other useful scripts.
Array
Dimetrodon
Not A Dinosaur!
Not A Dinosaur!
Posts: 197
Joined: Mon Sep 12, 2022 9:30 am
Verification: ✅ Elon Musk Style

Viewing Profiles Only [Crossposted from .com]

Post by Dimetrodon »

[Dimetrodon] wrote: Sun Jan 29, 2023 12:54 pm Hi.

You're going to have to edit memberlist.php in your board's root directory. Make sure you back the file up first before making any changes,
then find:

Code: Select all

// Check our mode...
if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'contactadmin', 'searchuser', 'team', 'livesearch')))
{
	trigger_error('NO_MODE');
}
Then add the following after it:

Code: Select all

if (in_array($mode, array('','group')))
{
	if ($user->data['group_id'] != 5)
	{
		trigger_error('NO_VIEW_USERS');
	}
}
For any user who is not an Administrator (not in the group administrators), they will receive an error message when they try to view the full memberlist or group memberships.

Of course, to allow users to view profiles, set "can view memberlist, online list, and profiles" to "yes" under the permission settings for registered users. Due to this change, it will only give them the ability to view profiles though.

Administrators and only administrators will be unaffected.
Support Topic on .com: https://www.phpbb.com/community/viewtopic.php?t=2635161