-if ($VALID) {
- // Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" !
- $result = SQL_QUERY_ESC("SELECT userid FROM `"._MYSQL_PREFIX."_user_data` WHERE nickname='%s' AND userid != '%s' LIMIT 1",
- array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 0) {
+if ($isValid === true) {
+ // Nickname already in use which is the default
+ $content = '{--MEMBER_NICKNAME_ALREADY_IN_USE--}';
+
+ // Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" !)
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' AND `userid` != %s LIMIT 1",
+ array(postRequestElement('nickname'), getMemberId()), __FILE__, __LINE__);
+
+ // Is it not in use?
+ if (SQL_HASZERONUMS($result)) {