Unofficial modifications
nieoficjalne modyfikacje for?w phpBB by Przemo

Foreign support - Username or E-mail for login

kidzior - Pon 30 Kwi, 2007
Temat postu: Username or E-mail for login
##############################################################
## Mod name: Nazwa U?ytkownik lub E-mail przy logowaniu
## Author: Settafix < settafix@gamesn.pl >
## Translate: kidzior http://www.niezal.org
## Description: Thanks to this mod, users can login by the username or e-mail from the registration form.
##
## Dificulty: ?atwa
## Time for install: 3 Minuty
## Files to edit: 6
## login.php
## includes/page_header.php
## includes/functions.php
## language/lang_polish/lang_main.php
## templates/*.*index_body.tpl
## templates/*.*/admin/login_body.tpl
##############################################################

Wiadomo?? ukryta / Hidden message
Aby zobaczy? wiadomo?? postaw piwo autorowi piwo.
Kod
#
#-----[ OPEN ]------------------------------------------
#
login.php
#
#-----[ FIND ]------------------------------------------
#
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : '';

#
#-----[ AFTER, ADD ]------------------------------------------
#
$email = isset($HTTP_POST_VARS['username']) ? phpbb_clean_email($HTTP_POST_VARS['username']) : '';
$password_select = md5($password);

#-----[ FIND ]------------------------------------------
#
WHERE username = '" . str_replace("\'", "''", $username) . "'";

#
#-----[ REPLACE WITH]------------------------------------------
#
WHERE user_password = '$password_select' AND username = '" . str_replace("\\'", "''", $username) . "' or user_email = '" . str_replace("\\'", "''", $email) . "'";
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
'L_USERNAME' => $lang['Username'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_USERNAME_EMAIL' => $lang['Username_Email'],
#
#-----[ OPEN ]------------------------------------------
#
includes/includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
//
// Pagination routine, generates
// page number sequence
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// added for username and email login mod to properly format the email
function phpbb_clean_email($email)
{
$email = substr(htmlspecialchars(str_replace("\'", "'", trim($email))), 0, 255);
$email = phpbb_rtrim($email, "\\");
$email = str_replace("'", "\'", $email);

return $email;
}

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Username'] = 'Username';
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['Username_Email'] = 'Username or E-mail';
#
#-----[ OPEN ]------------------------------------------
#
templates/*.*/index_body.tpl

#-----[ FIND ]------------------------------------------
#
{L_USERNAME}
#
#-----[ REPLACE WITH ]------------------------------------------
#
{L_USERNAME_EMAIL}
#
#-----[ OPEN ]------------------------------------------
#
templates/*.*/login_body.tpl

#-----[ FIND ]------------------------------------------
#
{L_USERNAME}
#
#-----[ REPLACE WITH ]------------------------------------------
#
{L_USERNAME_EMAIL}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Not much to translate. ;) But now You know, that there is such a modification. ;)


Powered by phpBB modified by Przemo © 2003 phpBB Group