1 頁 (共 1 頁)

[外掛]限制觀看會員列表和群組頁<加強版>

發表於 : 2002-09-20 17:22
ckm
這個和之前darwinnis
所貼的「禁止訪客觀看會員列表和會員群組」類似\r
但這個mod會把網頁指向登入頁面\r
登入會再回到會員列表或群組頁

代碼: 選擇全部

############################################################## 
## MOD Title: Restrict Memberlist / Usergroup Pages 
## MOD Author: Flipper <Flipper@pogoworld.co.uk> http://php.pogoworld.co.uk 
## MOD Description: Allows only registered users view Memberlist and/or Usergroups pages. 
## MOD Version: 1.0.0
## 
## Installation Level: Easy 
## Installation Time: 2 Minutes 
## Files To Edit: memberlist.php, groupcp.php 
## Included Files: n/a
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
############################################################## 
## Author Notes: If a user is not logged in and they wish to view the memberlist and/or Usergroup pages they will simply be redirected to the login page. If log in is successful, they will be redirected back to Memberlist and/or Usergroup pages. Instructions are given on how to apply this mod to both Memberlist and Usergroups, however you can install it to just the Memberlist or Grouplist page if you wish. 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ OPEN ]------------------------------------------ 
#

memberlist.php

# 
#-----[ FIND ]------------------------------------------ 
#
 
//
// End session management
//

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Begin 'Restrict Memberlist/Grouplist' MOD
if ( !$userdata['session_logged_in'] )
	{
		$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
		header($header_location . append_sid("login.$phpEx?redirect=memberlist.php", true));
		exit;
	}
// End 'Restrict Memberlist/Grouplist' MOD

#-----[ OPEN ]------------------------------------------ 
#

groupcp.php

# 
#-----[ FIND ]------------------------------------------ 
#
 
//
// End session management
//

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Begin 'Restrict Memberlist/Grouplist' MOD
if ( !$userdata['session_logged_in'] )
	{
		$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
		header($header_location . append_sid("login.$phpEx?redirect=groupcp.php", true));
		exit;
	}
// End 'Restrict Memberlist/Grouplist' MOD

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 

發表於 : 2003-02-19 09:51
動機不明
補強一個地方

開啟 profile.php

尋找\r
[php]<?php
if ( $mode == 'viewprofile' )
{
include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
exit;
}
?>[/php]

取代為\r
[php]<?php
if ( $mode == 'viewprofile' )
{
// Begin 'Restrict Memberlist/Grouplist' MOD
if ( !$userdata['session_logged_in'] )
{
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=profile.php", true));
exit;
}
// End 'Restrict Memberlist/Grouplist' MOD

include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
exit;
}
?>[/php]


這樣便連個人資料,訪客都無法取得了