1.0.0 版 http://phpbb-tw.net/phpbb/viewtopic.php ... memberlist
代碼: 選擇全部
## EasyMod 0.0.7 compliant
##############################################################
## MOD Title: Restrict Guest Access
## MOD Author: Flipper < flipper@pogoworld.co.uk > (Duncan Campbell) http://www.pogoworld.co.uk
## MOD Author, Secondary: darbyrob < rob@wombatmedia.com > (Rob Chojnacki)
## MOD Description: Denies guests access to member profiles, usergroup, memberlist pages and hides the personal information displayed at the bottom of posts.
## MOD Version: 1.1.0
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: memberlist.php, groupcp.php, profile.php, viewtopic.php
## Included Files: viewtopic_body_guest.tpl
##############################################################
## 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/
##############################################################
## Version History:
## 17th January 2003 - Updated for phpBB 2.0.4
## - Changed name from Restrict Usergroup / Memberlist pages to Restrict Guest Access
## - Added profile changes (Herbalite & Netclectic)
## - EasyMod 0.0.7 Compliant
## 16th February 2003 - Fixed Invalid Session Errors (Luciouslinda)
## 21st February 2003 - Added removal of 'Personal Info' (IM, PM, AIM, etc) buttons from bottom of each post (darbyrob)
##############################################################
## Author Notes: For use with phpBB 2.0.4 and above only.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
copy viewtopic_body_guest.tpl to templates/subSilver/
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Load templates
//
$template->set_filenames(array(
'body' => 'viewtopic_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);
#
#-----[ BEFORE, ADD ]------------------------------------
#
/*
* Original Code - Restrict Guest Access *
#
#-----[ AFTER, ADD ]------------------------------------
#
* End Original Code - Begin MOD code
*/
//
// Load templates
// One version for members, one version for guests
//
if ( $userdata['session_logged_in'] )
{
$template->set_filenames(array(
'body' => 'viewtopic_body.tpl'));
}
else
{
$template->set_filenames(array(
'body' => 'viewtopic_body_guest.tpl'));
}
make_jumpbox('viewforum.'.$phpEx, $forum_id);
#
#-----[ OPEN ]------------------------------------------
#
memberlist.php
#
#-----[ FIND ]------------------------------------------
#
//
// End session management
//
#
#-----[ AFTER, ADD ]------------------------------------
#
// Begin 'Restrict Guest Access' MOD
if ( !$userdata['session_logged_in'] )
{
redirect(append_sid("login.".$phpEx."?redirect=memberlist.".$phpEx, true));
exit;
}
// End 'Restrict Guest Access' MOD
#
#-----[ OPEN ]------------------------------------------
#
groupcp.php
#
#-----[ FIND ]------------------------------------------
#
//
// End session management
//
#
#-----[ AFTER, ADD ]------------------------------------
#
// Begin 'Restrict Guest Access' MOD
if ( !$userdata['session_logged_in'])
{
redirect(append_sid("login.".$phpEx."?redirect=groupcp.".$phpEx, true));
exit;
}
// End 'Restrict Guest Access' MOD
#
#-----[ OPEN ]------------------------------------------
#
profile.php
#
#-----[ FIND ]------------------------------------------
#
if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
{
$sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
}
else
{
$sid = '';
}
#
#-----[ AFTER, ADD ]------------------------------------
#
// Begin 'Restrict Guest Access' MOD
$u = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? intval($HTTP_GET_VARS[POST_USERS_URL]) : intval($HTTP_POST_VARS[POST_USERS_URL]);
$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
if ( !$userdata['session_logged_in'] && $mode == 'viewprofile')
{
redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=viewprofile&".POST_USERS_URL."=".$u, true));
exit;
}
// End 'Restrict Guest Access' MOD
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM
代碼: 選擇全部
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />
<span class="gensmall"><b>{PAGINATION}</b><br />
</span></td>
</tr>
</table>
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
</tr>
</table>
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
<tr align="right">
<td class="catHead" colspan="2" height="28"><span class="nav"><a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a> </span></td>
</tr>
{POLL_DISPLAY}
<tr>
<th class="thLeft" width="150" height="26" nowrap="nowrap">{L_AUTHOR}</th>
<th class="thRight" nowrap="nowrap">{L_MESSAGE}</th>
</tr>
<!-- BEGIN postrow -->
<tr>
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>
<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
</table></td>
</tr>
<tr>
<td class="{postrow.ROW_CLASS}" width="150" align="left" valign="middle"><span class="nav"><a href="#top" class="nav">{L_BACK_TO_TOP}</a></span></td>
<td class="{postrow.ROW_CLASS}" width="100%" height="28"> </td>
</tr>
<tr>
<td class="spaceRow" colspan="2" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<!-- END postrow -->
<tr align="center">
<td class="catBottom" colspan="2" height="28"><table cellspacing="0" cellpadding="0" border="0">
<tr><form method="post" action="{S_POST_DAYS_ACTION}">
<td align="center"><span class="gensmall">{L_DISPLAY_POSTS}: {S_SELECT_POST_DAYS} {S_SELECT_POST_ORDER} <input type="submit" value="{L_GO}" class="liteoption" name="submit" /></span></td>
</form></tr>
</table></td>
</tr>
</table>
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span>
</td>
</tr>
<tr>
<td align="left" colspan="3"><span class="nav">{PAGE_NUMBER}</span></td>
</tr>
</table>
<table width="100%" cellspacing="2" border="0" align="center">
<tr>
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}</span><br />
<br />
{S_TOPIC_ADMIN}</td>
<td align="right" valign="top" nowrap="nowrap">{JUMPBOX}<span class="gensmall">{S_AUTH_LIST}</span></td>
</tr>
</table>