]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-nickname.php
Even more rewrites to EL
[mailer.git] / inc / modules / member / what-nickname.php
index c69d7eec520b23f2e181aa68da2c6f93926d6e1a..7a9e7b511447e4500b7b0f879c56f1101be9f766 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -58,7 +59,7 @@ if (isFormSent()) {
        if (isPostRequestParameterSet('nickname')) {
                // Check if nickname is valid
                $PATTERN = '[' . getConfig('nickname_pattern') . ']{' . getConfig('nickname_len') . ',}';
-               if (ereg($PATTERN, postRequestParameter('nickname'), $array)) {
+               if (isInString($PATTERN, postRequestParameter('nickname'), $array)) {
                        // Entered nickname is valid?
                        $isValid = ($array[0] == postRequestParameter('nickname'));
                } // END - if
@@ -69,7 +70,7 @@ if ($isValid === true) {
        // 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(postRequestParameter('nickname'), getMemberId()), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Nickname not in use, so set it now
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `nickname`='%s' WHERE `userid`=%s LIMIT 1",
                        array(postRequestParameter('nickname'), getMemberId()), __FILE__, __LINE__);