HOW to hide memberlist and leaders from members

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
PrinceWords
Registered User
Posts: 104
Joined: Wed Oct 22, 2008 12:40 pm

HOW to hide memberlist and leaders from members

Post by PrinceWords » Sun Dec 21, 2008 8:35 am

hello, i want to hide memberlist link from members...and just show it to admin only..and the same for leaders link in the bottom..this is cause i can't find permissions options for this in the Control panel
how can i do this? :roll: thanks.
Last edited by ameeck on Sun Feb 15, 2009 2:09 pm, edited 1 time in total.
Reason: Topic icon changed
If You Still have The power to smile..You have everything... :)

User avatar
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: HOW to hide memberlist and leaders from members

Post by ameeck » Sun Dec 21, 2008 8:44 am

With the standard phpBB you limit access to the memberlist/user profiles and viewonline pages at once. You cannot set them specifically without modifying the code.

Here is a quick hack, which should enable the leaders and memberlist pages only to administrators:
Find in memberlist.php:

Code: Select all

            if ($user->data['user_id'] != ANONYMOUS)
            {
                trigger_error('NO_VIEW_USERS');
            } 
Add after:

Code: Select all

            if (!$auth->acl_get('a_') && in_array($mode, array('', 'leaders')))
            {
        trigger_error('NO_VIEW_USERS');
            } 

PrinceWords
Registered User
Posts: 104
Joined: Wed Oct 22, 2008 12:40 pm

Re: HOW to hide memberlist and leaders from members

Post by PrinceWords » Sun Dec 21, 2008 3:39 pm

well, when I made what you said it lead to an error when user try to view page

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/content/MYSITEPATH/forum path/memberlist.php on line 52


can't I just hide it from members without disabling ? if disable gonna make problems like this, maybe if it can lead to some message say : ( you can't view this page ) it would be better :roll:
If You Still have The power to smile..You have everything... :)

User avatar
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: HOW to hide memberlist and leaders from members

Post by ameeck » Mon Dec 22, 2008 9:11 am

That's exactly what this piece of code does, it says the users can't view the page. Please copy and paste the code once more, a dollar sign for a variable slipped out of the code, causing the error.

PrinceWords
Registered User
Posts: 104
Joined: Wed Oct 22, 2008 12:40 pm

Re: HOW to hide memberlist and leaders from members

Post by PrinceWords » Tue Dec 23, 2008 9:38 pm

ameeck wrote:That's exactly what this piece of code does, it says the users can't view the page. Please copy and paste the code once more, a dollar sign for a variable slipped out of the code, causing the error.
well, I tried it again, edited the memberlist.php and then deleted all the temp, and signed as normal test user, no wrong message this time, but everyone can see member list and leaders pages...nothing changed at all :?
If You Still have The power to smile..You have everything... :)

User avatar
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: HOW to hide memberlist and leaders from members

Post by ameeck » Sun Feb 15, 2009 11:28 am

I'm sorry, please put the code I posted after:

Code: Select all

// Check our mode...
if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'searchuser', 'leaders')))
{
    trigger_error('NO_MODE');
} 

PrinceWords
Registered User
Posts: 104
Joined: Wed Oct 22, 2008 12:40 pm

Re: HOW to hide memberlist and leaders from members

Post by PrinceWords » Sun Feb 15, 2009 1:54 pm

wow! much thanks for all your help..now it did the job exactly.. :)
If You Still have The power to smile..You have everything... :)

Locked

Return to “[3.0.x] Support Forum”