http://gamania.idv.tw/Lineage/viewtopic.php?t=3350
代碼: 選擇全部
#################################################################
## MOD Title: Registration Stopper
## MOD Author: Fountain of Apples < webmacster87@gmail.com > (Douglas Bell) http://www.webmacster87.info
## MOD Description: Allows you to prevent additional registrations to your board if set in the ACP.
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: profile.php
## admin/admin_board.php
## includes/page_header.php
## language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
## templates/subSilver/overall_header.tpl
## templates/subSilver/admin/board_config_body.tpl
## Included Files: admin/avc_mods/avc_stopreg.php
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This MOD adds a configuration setting to your ACP which will let
## you disallow registrations to your board. If registrations are
## disallowed, the Register link in the header will be hidden, and
## if a user attempts to register, they will receive an error. This
## is totally transparent to registered users; they will still be
## able to login and edit their profiles and do everything else as
## normal. This MOD is great to have installed for a demo board.
##
## This MOD is compatible with my ACP User Registration MOD.
##
## UPGRADES:
## Upgrades from previous versions of Registration Stopper can be
## found within the upgrades/directory contained in this zip. See
## upgrades/versions.txt within this zip to determine which script
## to install.
##
## Support for this MOD is available at its phpBB.com topic at
## < http://www.phpbb.com/phpBB/viewtopic.php?t=313879 >. You
## can also download this MOD from my website at
## < http://mods.webmacster87.info >.
##############################################################
## MOD History:
##
## 2006-01-01 - Version 1.0.1
## - Repackage and re-release of the MOD to try to fix errors that users have been receiving with opening the install script and installing with EasyMOD. No changes to code.
## - Updated Author's Notes and contact info.
##
## 2005-08-06 - Version 1.0.0
## - No new features; just repackaged as 1.0.0.
##
## 2005-07-25 - Version 0.2.0 (Release Candidate)
## - Fixed an error where no message was displaying when the register page was accessed & registrations were disabled.
## - Configuration option language has been re-written to be easier to understand.
## - Fixed an error in the install file where the lang tags were being added to the wrong files.
## - MOD install script updated to the new MOD Template changes effective on July 23rd, 2005.
##
## 2005-07-06 - Version 0.1.0 (beta)
## - Initial Release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO `phpbb_config` VALUES ('registrations_accept', '1');
#
#-----[ COPY ]---------------------------------------------
# This will add a version checker for this MOD compatible with the
# Advanced Version Check MOD, if you do not have this MOD you do not
# HAVE to upload this file
#
copy root/admin/avc_mods/avc_stopreg.php to admin/avc_mods/avc_stopreg.php
#
\n#-----[ OPEN ]---------------------------------------------
#
profile.php
#
#-----[ FIND ]---------------------------------------------
#
else if ( $mode == 'editprofile' || $mode == 'register' )
#
#-----[ BEFORE, ADD ]---------------------------------------------
#
// MOD: Registration Stopper
// Here we added
// && $board_config['registrations_accept']
#
#-----[ IN-LINE FIND ]---------------------------------------------
# Do this to the FIND we just did.
#
'register'
#
#-----[ IN-LINE AFTER, ADD ]---------------------------------------------
#
&& $board_config['registrations_accept']
#
#-----[ AFTER, ADD ]---------------------------------------------
# This is also done to the FIND we did above.
#
// END MOD: Registration Stopper
#
#-----[ FIND ]---------------------------------------------
#
else if ( $mode == 'confirm' )
#
#-----[ BEFORE, ADD ]---------------------------------------------
#
// MOD: Registration Stopper
else if ( $mode == 'register' && !$board_config['registrations_accept'] )
{
$message .= $lang['Registrations_disabled'] . "<br /><br />" . sprintf($lang['Click_return_forum_index'], "<a href="" . append_sid("index.".$phpEx) . "">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
// END MOD: Registration Stopper
#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]---------------------------------------------
#
$disable_board_no = ( !$new['board_disable'] ) ? "checked="checked"" : "";
#
#-----[ AFTER, ADD ]---------------------------------------------
#
// MOD: Registration Stopper
$registrations_enable_yes = ( $new['registrations_accept'] ) ? "checked="checked"" : "";
$registrations_enable_no = ( !$new['registrations_accept'] ) ? "checked="checked"" : "";
// END MOD: Registration Stopper
#
#-----[ FIND ]---------------------------------------------
#
"L_OVERRIDE_STYLE_EXPLAIN" => $lang['Override_style_explain'],
#
#-----[ AFTER, ADD ]---------------------------------------------
#
// MOD: Registration Stopper
"L_REGISTRATIONS_ENABLE" => $lang['Registrations_enable'],
"L_REGISTRATIONS_ENABLE_EXPLAIN" => $lang['Registrations_enable_explain'],
// END MOD: Registration Stopper
#
#-----[ FIND ]---------------------------------------------
#
"OVERRIDE_STYLE_NO" => $override_user_style_no,
#
#-----[ AFTER, ADD ]---------------------------------------------
#
// MOD: Registration Stopper
"S_REGISTRATIONS_ENABLE_YES" => $registrations_enable_yes,
"S_REGISTRATIONS_ENABLE_NO" => $registrations_enable_no,
// END MOD: Registration Stopper
#
#-----[ OPEN ]---------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]---------------------------------------------
#
//
// The following assigns all _common_ variables that may be used at any point
#
#-----[ BEFORE, ADD ]---------------------------------------------
#
// MOD: Registration Stopper
if ( $board_config['registrations_accept'] && !$userdata['session_logged_in'] )
{
$template->assign_block_vars('switch_register', array());
}
// END MOD: Registration Stopper
#
#-----[ OPEN ]---------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]---------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]---------------------------------------------
#
// MOD: Registration Stopper
// Registrations Enable Setting for Board Configuration Panel
$lang['Registrations_enable'] = '討論區註冊';
$lang['Registrations_enable_explain'] = '關閉註冊時將不允許會員註冊,這個動作不會影響已經註冊的會員';
// END MOD: Registration Stopper
#
#-----[ OPEN ]---------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]---------------------------------------------
#
//
// That's all, Folks!
#
#-----[ BEFORE, ADD ]---------------------------------------------
#
// MOD: Registration Stopper
// Lang tags for "Registrations Disabled" Message
$lang['Registrations_disabled'] = '抱歉,討論區目前暫停註冊';
$lang['Click_return_forum_index'] = '點選 %s這裡%s 返回討論區'; // a href, /a tags
// END MOD: Registration Stopper
#
#-----[ OPEN ]---------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]---------------------------------------------
# If your style has been edited, this line MAY appear multiple times
# (it shouldn't in the default phpBB installation). If so, search
# for: {L_REGISTER} The next 2 FINDs will be before and after that
# line.
#
<!-- BEGIN switch_user_logged_out -->
#
#-----[ REPLACE WITH ]---------------------------------------------
#
<!-- Registration Stopper -->
<!-- BEGIN switch_register -->
#
#-----[ FIND ]---------------------------------------------
#
<!-- END switch_user_logged_out -->
#
#-----[ REPLACE WITH ]---------------------------------------------
#
<!-- END switch_register -->
#
#-----[ OPEN ]---------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]---------------------------------------------
#
<td class="row2"><input type="radio" name="override_user_style" value="1" {OVERRIDE_STYLE_YES} /> {L_YES} <input type="radio" name="override_user_style" value="0" {OVERRIDE_STYLE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]---------------------------------------------
#
<!-- Registration Stopper -->
<tr>
<td class="row1">{L_REGISTRATIONS_ENABLE}<br /><span class="gensmall">{L_REGISTRATIONS_ENABLE_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="registrations_accept" value="1" {S_REGISTRATIONS_ENABLE_YES} /> {L_ENABLED} <input type="radio" name="registrations_accept" value="0" {S_REGISTRATIONS_ENABLE_NO} /> {L_DISABLED}</td>
</tr>
#
#-----[ DIY INSTRUCTIONS ]---------------------------------------------
#
At this point, the MOD is installed, but registrations by default have not been disabled. To disable registrations, go to your General Configuration panel in the ACP and set Registrations to Disabled.
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
外掛下載位置 : http://www.phpbb.com/phpBB/catdb.php?mo ... id=1705723