Code: Select all
##############################################################
## MOD Title: Use Email as Username
## MOD Author: alexi02 < N/A > (Alejandro Iannuzzi) http://www.uzzisoft.com
## MOD Description: When registering, the email address field is inserted as the users username.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit: includes/usercp_register.php
## templates/subSilver/profile_add_body.tpl
## Included Files: N/A
##
## 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:
##
## Removes the username field.
## The user's email address will be the user's username.
##
##############################################################
## MOD History:
##
## 2007-04-03 - Version 1.0.0
## - Initial Release (for phpBB 2.0.22)
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$username = ( !empty($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
#
#-----[ REPLACE WITH ]------------------------------------------
#
$username = ( !empty($HTTP_POST_VARS['email']) ) ? phpbb_clean_username($HTTP_POST_VARS['email']) : '';
#
#-----[ FIND ]------------------------------------------
#
if ( ($mode == 'register') || ($board_config['allow_namechange']) )
{
$template->assign_block_vars('switch_namechange_allowed', array());
}
else
{
$template->assign_block_vars('switch_namechange_disallowed', array());
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $mode == 'register' )
{
$template->assign_block_vars('switch_namechange_disallowed', array());
}
else if ( $board_config['allow_namechange'] )
{
$template->assign_block_vars('switch_namechange_allowed', array());
}
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN switch_namechange_disallowed -->
<tr>
<td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
<td class="row2"><input type="hidden" name="username" value="{USERNAME}" /><span class="gen"><b>{USERNAME}</b></span></td>
</tr>
<!-- END switch_namechange_disallowed -->
#
#-----[ REPLACE WITH ]------------------------------------------
#
#
#-----[ FIND ]------------------------------------------
#
<td class="row1"><span class="gen">{L_EMAIL_ADDRESS}: *</span></td>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<td class="row1" width="38%"><span class="gen">{L_EMAIL_ADDRESS}: *</span></td>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM