## EasyMod 0.0.7 compliant
##############################################################
## MOD Title: Disable Registrations (via ACP)
## MOD Author: Flipper <
Flipper@pogoworld.co.uk>
http://www.pogoworld.co.uk
## MOD Description: Allows admin to disable registrations and also set a message.
## MOD Version: 1.0.4
##
## Installation Level: Intermediate
## Installation Time: 10 Minutes
## Files To Edit: admin_board.php, board_config_body.tpl, lang_admin.php, lang_main.php, usercp_register.php
## Included Files: n/a
##############################################################
## Version History:
## 13th December 2002 - Allow "Profile" changes even if Registration is disabled - DSearles
## - Updated for phpBB 2.0.3
## - EasyMod 0.0.7 compliant
## 14th December 2002 - Fixed HTML redirect problem
## - Improved PHP formatting
## 17th December 2002 - Allow Admin to add registrations even if registration is disabled.
## 17th January 2003 - Updated for phpBB 2.0.4, Fixed template issue - Daz
##############################################################
## 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: Via Board Config in ACP, you can select if you wish registrations to be disabled or not. You can also set a message that will be displayed when a user tries to register. If no message is set, then a default message is used. Even if registration is disabled, Administrators will still be able to add users.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ('disable_reg', '0');
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ('disable_reg_msg', 'Registration has been disabled');
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
// ---------------------------------------
// Load agreement template since user has not yet
// agreed to registration conditions/coppa
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
if( isset($HTTP_GET_VARS['mode'] ) || isset($HTTP_POST_VARS['mode']) )
{
$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
if( $mode == 'register' && $board_config['disable_reg'] && $userdata['user_level'] != ADMIN )
{
$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="3;url='.append_sid("index.$phpEx").'">'));
$message = ( $board_config['disable_reg_msg'] ) ? $board_config['disable_reg_msg'] : $lang['disable_reg_msg'];
message_die(GENERAL_ERROR, $message);
}
}
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
$disable_board_yes = ( $new['board_disable'] ) ? "checked=\"checked\"" : "";
$disable_board_no = ( !$new['board_disable'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$disable_reg_yes = ( $new['disable_reg'] ) ? "checked=\"checked\"" : "";
$disable_reg_no = ( !$new['disable_reg'] ) ? "checked=\"checked\"" : "";
#
#-----[ FIND ]------------------------------------------
#
$new['sitename'] = str_replace('"', '"', strip_tags($new['sitename']));
#
#-----[ AFTER, ADD ]------------------------------------------
#
$new['disable_reg_msg'] = str_replace('"', '"', strip_tags($new['disable_reg_msg']));
#
#-----[ FIND ]------------------------------------------
#
"L_SITE_DESCRIPTION" => $lang['Site_desc'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"L_DISABLE_REG" => $lang['disable_reg'],
"L_DISABLE_REG_EXPLAIN" => $lang['disable_reg_explain'],
"L_DISABLE_REG_MSG" => $lang['disable_reg_msg'],
"L_DISABLE_REG_MSG_EXPLAIN" => $lang['disable_reg_msg_explain'],
"S_DISABLE_REG_YES" => $disable_reg_yes,
"S_DISABLE_REG_NO" => $disable_reg_no,
"DISABLE_REG_MSG" => $new['disable_reg_msg'],
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['disable_reg'] = 'Disable registrations';
$lang['disable_reg_explain'] = 'This will disable registrations to your board.';
$lang['disable_reg_msg'] = 'Disabled registration message';
$lang['disable_reg_msg_explain'] = 'This is the message that will be displayed if users try to register when registration is disabled';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Default 'Board Disable' message.
$lang['disable_reg_msg'] = 'The register feature of this board has been disabled';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_SITE_DESCRIPTION}</td>
<td class="row2"><input class="post" type="text" size="40" maxlength="255" name="site_desc" value="{SITE_DESCRIPTION}" /></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_DISABLE_REG}<br />
<span class="gensmall">{L_DISABLE_REG_EXPLAIN}</span></td>
<td class="row2">
<input type="radio" name="disable_reg" value="1" {S_DISABLE_REG_YES} />{L_YES}
<input type="radio" name="disable_reg" value="0" {S_DISABLE_REG_NO} />{L_NO}
</td>
</tr>
<tr>
<td class="row1">{L_DISABLE_REG_MSG}<br />
<span class="gensmall">{L_DISABLE_REG_MSG_EXPLAIN}</span></td>
<td class="row2">
<input type="text" class="post" size="40" maxlength="255" name="disable_reg_msg" value="{DISABLE_REG_MSG}"/>
</td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM