Hide Memberlist but show Team and Who's online

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
JanPi2020
Registered User
Posts: 26
Joined: Mon Dec 21, 2020 6:56 pm

Hide Memberlist but show Team and Who's online

Post by JanPi2020 »

I want to hide only the memberlist (the link in the footer to be precise), but I want to show the Team link (and page) and the Who's online list
The permission "Can view profiles, memberlist and online list" would hide too much.
This seemed to be posible in earlier phpBB versions by MODs and such.
Are there any possibilities with version 3.3.x?

My interest is to use only the Team page for member information since I can group users by their groups and also show if someone is in more than one group. I can't pimp the memberlist in any way, can I ?
BTW, my forum is very small, round about 30 people and it's closed to guests.

Thanks for helping and ideas!
Last edited by HiFiKabin on Sun Jan 10, 2021 11:01 am, edited 1 time in total.
Reason: Moved to Custom Coding
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6731
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James

Re: Hide Memberlist but show Team and Who's online

Post by HiFiKabin »

OPEN

navbar_footer.html

FIND AND DELETE (~line 42)

Code: Select all

			<!-- IF S_DISPLAY_MEMBERLIST -->
				<li class="rightside" data-last-responsive="true">
					<a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}" role="menuitem">
						<i class="icon fa-group fa-fw" aria-hidden="true"></i><span>{L_MEMBERLIST}</span>
					</a>
				</li>
			<!-- ENDIF -->
SAVE > UPLOAD > PURGE CACHE

Remember to back up FIRST
JanPi2020
Registered User
Posts: 26
Joined: Mon Dec 21, 2020 6:56 pm

Re: Hide Memberlist but show Team and Who's online

Post by JanPi2020 »

Thanks, that works perfectly!

Do I have to repeat that whenever an update of phpBB or the style I'm using comes along?
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6731
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James

Re: Hide Memberlist but show Team and Who's online

Post by HiFiKabin »

Yes, if either of that file is changed in a new version, then you must repeat the edits.
User avatar
RMcGirr83
Former Team Member
Posts: 22034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Hide Memberlist but show Team and Who's online

Post by RMcGirr83 »

Even simpler just change this line in includes/functions.php

'S_DISPLAY_MEMBERLIST' => (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0,

To this

'S_DISPLAY_MEMBERLIST' => false,

though people will still be able to get to the memberlist and view it simply by typing in the browser bar http://myforum.com/memberlist.php
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer 🍺
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

Is it ok that I rename memberlist.php file to something else, so that only me/admin can see by typing ?
Or is it connected to few other files ?
User avatar
warmweer
Jr. Extension Validator
Posts: 11450
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Hide Memberlist but show Team and Who's online

Post by warmweer »

exemplary1 wrote: Mon Feb 19, 2024 8:06 am Is it ok that I rename memberlist.php file to something else, so that only me/admin can see by typing ?
Or is it connected to few other files ?
Changing the name of the file called, does not change the code calling that file. In short: result = file not found
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
ssl
Registered User
Posts: 1842
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: Hide Memberlist but show Team and Who's online

Post by ssl »

Other solution, open memberlist.php file and find:

Code: Select all

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

Code: Select all

if (in_array($mode, array('','group')))
{
	if ($user->data['group_id'] != 5)
	{
		trigger_error('NO_VIEW_USERS');
	}
}
Save and purge the cache.

For any user who is not an administrator, they will receive an error message when trying to view the full list of members or group memberships.
Sorry for my English ... I do my best!

phpBB: 3.3.12 | PHP: 8.3.7
[Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

warmweer wrote: Mon Feb 19, 2024 8:28 am
exemplary1 wrote: Mon Feb 19, 2024 8:06 am Is it ok that I rename memberlist.php file to something else, so that only me/admin can see by typing ?
Or is it connected to few other files ?
Changing the name of the file called, does not change the code calling that file. In short: result = file not found
So it is connected to other files somehow.
ssl wrote: Mon Feb 19, 2024 8:37 am Other solution, open memberlist.php file and find:

Code: Select all

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

Code: Select all

if (in_array($mode, array('','group')))
{
	if ($user->data['group_id'] != 5)
	{
		trigger_error('NO_VIEW_USERS');
	}
}
Save and purge the cache.

For any user who is not an administrator, they will receive an error message when trying to view the full list of members or group memberships.
Cool, its working.Thank you.
User avatar
warmweer
Jr. Extension Validator
Posts: 11450
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Hide Memberlist but show Team and Who's online

Post by warmweer »

exemplary1 wrote: Mon Feb 19, 2024 8:52 am
warmweer wrote: Mon Feb 19, 2024 8:28 am
Changing the name of the file called, does not change the code calling that file. In short: result = file not found
So it is connected to other files somehow.
memberlist.php is a default file in phpBB referenced by other files so you'll get a
file not found
in various places.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

ssl wrote: Mon Feb 19, 2024 8:37 am Other solution, open memberlist.php file and find:

Code: Select all

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

Code: Select all

if (in_array($mode, array('','group')))
{
	if ($user->data['group_id'] != 5)
	{
		trigger_error('NO_VIEW_USERS');
	}
}
Save and purge the cache.

For any user who is not an administrator, they will receive an error message when trying to view the full list of members or group memberships.
The code doesn't work if added following,

Code: Select all

 /memberlist.php?mode=searchuser
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

Ok, did changes according to this, and its working.
viewtopic.php?p=8603275#p8603275
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

Cannot hide from this :

Code: Select all

 /memberlist.php?mode=viewprofile&u=2
any idea ?
exemplary1
Registered User
Posts: 109
Joined: Mon Feb 05, 2024 11:41 am

Re: Hide Memberlist but show Team and Who's online

Post by exemplary1 »

Have added following in memberlist.php and it works.
Line number around 500

Code: Select all

	case 'viewprofile':
		// Display a profile
		if ($user_id == 2)
		{
			trigger_error('NO_USER');
		}
Is it ok to add like this ? Can an expert comment on this please.
User avatar
ssl
Registered User
Posts: 1842
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: Hide Memberlist but show Team and Who's online

Post by ssl »

Finally, at a given moment, users of a forum who do not have access to the list of members will not spend hours with our friend Google to get around the problem.
Because with your prohibition methods each user ID is listed in the code to prohibit access to the profile, imagine if this manipulation had to be done on this forum?
Sorry for my English ... I do my best!

phpBB: 3.3.12 | PHP: 8.3.7
[Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"

Return to “phpBB Custom Coding”