From 66eb4b2c1694a7fcbee5016dd42e25f5b735bb56 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Wed, 6 Mar 2002 00:40:31 +0000 Subject: Localise days/months, fix bug in validate_username ... this doesn't see functions.php split, working on that separately git-svn-id: file:///svn/phpbb/trunk@2274 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c6bff2ce34..244f4d579a 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -329,7 +329,20 @@ function decode_ip($int_ip) // function create_date($format, $gmepoch, $tz) { - return @gmdate($format, $gmepoch + (3600 * $tz)); + global $board_config, $lang; + + $result = @gmdate($format, $gmepoch + (3600 * $tz)); + + if ( $board_config['default_lang'] != 'english' ) + { + @reset($lang['datetime']); + while ( list($match, $replace) = @each($lang['datetime']) ) + { + $result = str_replace($match, $replace, $result); + } + } + + return $result; } // @@ -448,7 +461,10 @@ function validate_username($username) { if ( $row = $db->sql_fetchrow($result) ) { - return ( $userdata['session_logged_in'] ) ? ( ( $row['username'] != $userdata['username'] ) ? array('error' => true, 'error_msg' => $lang['Username_taken']) : array('error' => false, 'error_msg' => '') ) : array('error' => true, 'error_msg' => $lang['Username_taken']); + if ( ( $userdata['session_logged_in'] && $row['username'] != $userdata['username'] ) || !$userdata['session_logged_in'] ) + { + return array('error' => true, 'error_msg' => $lang['Username_taken']); + } } } -- cgit v1.2.1