Hide ONLY memberlist

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
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Hide ONLY memberlist

Post by bennybernaer »

Can see profiles, member list and “who is online”

Is there a possibility for some user groups to hide the member list? This is only about the list of members, not who is online.


It concerns the "User-defined groups" Leden

I have this
subject
found, but it is still for pbpBB3
Last edited by Mick on Sun Sep 01, 2024 7:08 am, edited 1 time in total.
Reason: Solved.
User avatar
Elias
Registered User
Posts: 5152
Joined: Sat Feb 25, 2006 4:31 pm
Name: Elias

Re: Hide ONLY memberlist

Post by Elias »

You'll need to request an extension for this as there isn't one that exists yet.
Or haven't seen one.
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: Hide ONLY memberlist

Post by bennybernaer »

in memberlist.php

Find:

Code: Select all

    default:
        // The basic memberlist  
after Add:

Code: Select all

        if (!$auth->acl_getf_global('m_'))
          { if (!$auth->acl_getf_global('a_'))
           {trigger_error("You don't have permission to view the memberlist.");
           }
          }   

However, one group should be added. And that's Team Members (User-defined group)
An extension is useful, but unnecessary for a small change.
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: Hide ONLY memberlist

Post by bennybernaer »

The above code works perfectly, only that one group of code should be included. The only question is how ...

memberlist.php? mode = group & g = 10


Edit:
And adding this line doesn't help

Code: Select all

  if (!$auth->data['group_id'] == '8')
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: Hide ONLY memberlist

Post by bennybernaer »

Nobody ?
cpg-at-work
Registered User
Posts: 76
Joined: Sat Sep 22, 2012 6:38 pm
Location: Germany

Re: Hide ONLY memberlist

Post by cpg-at-work »

Hallo,

in ACP Group Rights you have to do what you want.

Best rregards
cpg
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Hide ONLY memberlist

Post by david63 »

cpg-at-work wrote: Sat Jun 20, 2020 2:41 pm in ACP Group Rights you have to do what you want.
If by that statement you mean set the permissions then that is impossible as there is no unique permission for the Memberlist (many say that there should be - but that is a different topic!)

If that is not what you mean then please explain how to achieve what the OP wants to do.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
cpg-at-work
Registered User
Posts: 76
Joined: Sat Sep 22, 2012 6:38 pm
Location: Germany

Re: Hide ONLY memberlist

Post by cpg-at-work »

sorry, my mistake
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: Hide ONLY memberlist

Post by bennybernaer »

I've been playing and trying all day and it works. But would anyone be so kind to take a look at the code.

Is this so good you think?
Or is this going to cause problems?
Everything works. Only Admins, Moderators, and a specific user group can view the member list.

Code: Select all

      if (!$auth->acl_getf_global('m_'))
          { if (!$auth->acl_getf_global('a_'))
			 if ($user->acl['group_id'] == '8' || $user->data['group_id'] == '1' || $user->data['group_id'] == '2')
           {trigger_error("You don't have permission to view the memberlist.");
           }
          } 
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: Hide ONLY memberlist

Post by bennybernaer »

Small change, but works perfectly

Code: Select all

if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
		{
			if ($user->acl['group_id'] == '8' || $user->data['group_id'] == '9' || $user->data['group_id'] == '2')
			{
				trigger_error("Je hebt geen permissies om de ledenlijst te bekijken.");
			}
		}
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: Hide ONLY memberlist

Post by bennybernaer »

This code no longer works in 3.3, anyone have any ideas why?

Code: Select all

if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
		{
			if ($user->acl['group_id'] == '8' || $user->data['group_id'] == '9' || $user->data['group_id'] == '2')
			{
				trigger_error("Je hebt geen permissies om de ledenlijst te bekijken.");
			}
		}

Edit: This is how it works:

Code: Select all

            if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
		{
			if ($user->data['group_id'] != 10)

			{
				trigger_error("Je hebt geen permissies om de ledenlijst te bekijken.");
			}
		} 
But how do I add an extra group?

if ($user->data['group_id'] != 10, 12) doesn't work
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6285
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Hide ONLY memberlist

Post by thecoalman »

Code: Select all

if (!in_array($user->data['group_id'], array(10,12)))
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: Hide ONLY memberlist

Post by bennybernaer »

thecoalman wrote: Sat Aug 31, 2024 4:15 pm

Code: Select all

if (!in_array($user->data['group_id'], array(10,12)))
Excellent! Thank you very much!
User avatar
warmweer
Jr. Extension Validator
Posts: 11628
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Hide ONLY memberlist

Post by warmweer »

Whereas there's nothing wrong with the coalman's suggestion, it's custom coding in .php files.

There's another option and that is using the Group Templates Variables extension.
Yes, it also requires editing default phpBB files but only style templates (.html) and if edits have to be undone, they can easily be found .

Disclaimer: it's currently marked as abandoned but I'm using it with phpBB 3.3.11 without issues.
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.
deninho32
Registered User
Posts: 238
Joined: Tue May 21, 2019 8:57 am

Re: Hide ONLY memberlist

Post by deninho32 »

If you use Custom code extension you don't have to touch core files. I use both extensions without any problems on 3.3.12.
phpBB 3.3.7 | PHP Version 7.4.33 | Milk Theme

Return to “phpBB Custom Coding”