hiding the 'memberlist'

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
jamier
Registered User
Posts: 10
Joined: Thu Mar 10, 2005 3:28 am

hiding the 'memberlist'

Post by jamier »

hi there;

can someone suggest the best method to achieve the following:

I would like it so that the 'memberlist' can only be viewed by 'Administrators' (would like to hide the list from regular users).

thanks
J

User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Post by MHobbit »

Put this after the session_pagestart function in the memberlist.php file:

Code: Select all

if( $userdata['user_level'] != ADMIN )
{
   message_die(GENERAL_ERROR, "You have to be an Administrator to read this page!");
}
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."

jamier
Registered User
Posts: 10
Joined: Thu Mar 10, 2005 3:28 am

Post by jamier »

thanks MennoniteHobbit --- works a treat!

cheers
Jamier

boozer2k
Registered User
Posts: 35
Joined: Tue Sep 03, 2002 8:41 pm
Location: Almere
Contact:

Post by boozer2k »

What do I have to change to only view the memberlist to registered users? I can figure things out for other member types but not for anyone who is registered.

skuipers
Registered User
Posts: 648
Joined: Sun Jan 16, 2005 9:53 pm
Location: Delft, The Netherlands

Post by skuipers »

in memberlist.php:

Code: Select all

//
//Restricts access to page for logged in users only.
//
if ($userdata['user_id'] == ANONYMOUS)
{
   redirect(append_sid('login.'.$phpEx));
}
Add these lines just before // End session management

boozer2k
Registered User
Posts: 35
Joined: Tue Sep 03, 2002 8:41 pm
Location: Almere
Contact:

Post by boozer2k »

skuipers wrote: in memberlist.php:

Code: Select all

//
//Restricts access to page for logged in users only.
//
if ($userdata['user_id'] == ANONYMOUS)
{
   redirect(append_sid('login.'.$phpEx));
}
Add these lines just before // End session management


Can't manage to get it working for some reason it gives me multiple error messages. Will post them later I have to the board first.

Jotne
Registered User
Posts: 364
Joined: Wed Jul 16, 2003 10:18 pm
Location: Norway

Post by Jotne »

Here is how i did hide memerlist from anonymous user:

http://www.phpbb.com/phpBB/viewtopic.php?t=33209

You can also use this:

http://www.phpbb.com/phpBB/viewtopic.php?t=213812
Don’t feed the Troll
Molde Cycleklubb - - http://www.moldeck.no
HP41.org - - http://forum.hp41.org

skuipers
Registered User
Posts: 648
Joined: Sun Jan 16, 2005 9:53 pm
Location: Delft, The Netherlands

Post by skuipers »

boozer2k wrote: Can't manage to get it working for some reason it gives me multiple error messages. Will post them later I have to the board first.


Yes, I'm sorry, it's a MOD and I had forgotten :(

I use the 213812 MOD and it works OK.

boozer2k
Registered User
Posts: 35
Joined: Tue Sep 03, 2002 8:41 pm
Location: Almere
Contact:

Post by boozer2k »

I am getting this message when I try to open the members page:

Warning: Cannot modify header information - headers already sent by (output started at /home2/sub002/sc11016/www/forum/memberlist.php:1) in /home2/sub002/sc11016/www/forum/includes/sessions.php on line 188

Warning: Cannot modify header information - headers already sent by (output started at /home2/sub002/sc11016/www/forum/memberlist.php:1) in /home2/sub002/sc11016/www/forum/includes/sessions.php on line 189

Warning: Cannot modify header information - headers already sent by (output started at /home2/sub002/sc11016/www/forum/memberlist.php:1) in /home2/sub002/sc11016/www/forum/memberlist.php on line 35


and when I am logged in I get this message (followed by the memberlist)

Warning: Cannot modify header information - headers already sent by (output started at /home2/sub002/sc11016/www/forum/memberlist.php:1) in /home2/sub002/sc11016/www/forum/includes/page_header.php on line 475

Warning: Cannot modify header information - headers already sent by (output started at /home2/sub002/sc11016/www/forum/memberlist.php:1) in /home2/sub002/sc11016/www/forum/includes/page_header.php on line 477

Warning: Cannot modify header information - headers already sent by (output started at /home2/sub002/sc11016/www/forum/memberlist.php:1) in /home2/sub002/sc11016/www/forum/includes/page_header.php on line 478

Even when I change everything back to normal (I made a backup of the old file) I get the error messages.

I am confused :D

skuipers
Registered User
Posts: 648
Joined: Sun Jan 16, 2005 9:53 pm
Location: Delft, The Netherlands

Post by skuipers »

Did you apply the mod?

boozer2k
Registered User
Posts: 35
Joined: Tue Sep 03, 2002 8:41 pm
Location: Almere
Contact:

Post by boozer2k »

Euh no I did not, because I missed your remark....

problem is that I cannot download the mod due to a problem on the PHPBB site, its unavailable.

David Palmer
Registered User
Posts: 319
Joined: Tue Nov 23, 2004 5:25 pm

Post by David Palmer »

boozer2k,

From your errors (which mean that a .php file was trying to output data before the other scripts had a chance to process), my guess is that you inserted the mod code (suggested above) in the very top of your memberlist.php file ... it's important to place that code exactly where skuipers suggests, ie. right before the // End session management line.

Good luck,

David
The more details you can provide about your problem, the better people can help you!
phpBB Rules :: Support Request Template

boozer2k
Registered User
Posts: 35
Joined: Tue Sep 03, 2002 8:41 pm
Location: Almere
Contact:

Post by boozer2k »

Well I assume you mean this: (copied from line 20 and on)

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);
init_userprefs($userdata);
//
// End session management <----------------------------------
//

I put the code just BEFORE that and I still get the errors.

David Palmer
Registered User
Posts: 319
Joined: Tue Nov 23, 2004 5:25 pm

Post by David Palmer »

boozer2k,

Okay, well that's good. One other thing that might have happened is your editor might have inserted a space between the beginning of the file and the <?php at the top? Check to make sure that <?php are the very first characters in the file (no carriage returns, no spaces, etc).

Hope that works!

David
The more details you can provide about your problem, the better people can help you!
phpBB Rules :: Support Request Template

ldavis
Registered User
Posts: 16
Joined: Tue Mar 09, 2004 5:46 pm

Post by ldavis »

Jotne wrote: Here is how i did hide memerlist from anonymous user:

http://www.phpbb.com/phpBB/viewtopic.php?t=33209

You can also use this:

http://www.phpbb.com/phpBB/viewtopic.php?t=213812


The link for the download is not working.
Levi Davis
President
Fantasy Makers Industries
http://www.fantasymakersindustries.com

Cry Havoc!! And Let Loose your Imagination!

Locked

Return to “2.0.x Support Forum”