Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / member / what-nickname.php
index 2741f949f2862de78f33d6c20ee8a018b5b12c31..ba66cb970da059a4378feacbb67aeb1098b6bb32 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -68,14 +68,14 @@ if ($isValid === TRUE) {
        $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",
+       $result = sqlQueryEscaped("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)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Prepare array
                $filterData = array(
                        'history_subject' => 'NICKNAME_CHANGED',
@@ -87,7 +87,7 @@ if ($isValid === TRUE) {
                runFilterChain('add_history_entry', $filterData);
 
                // Nickname not in use, so set it now
-               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `nickname`='%s' WHERE `userid`=%s LIMIT 1",
+               sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `nickname`='%s' WHERE `userid`=%s LIMIT 1",
                        array(
                                postRequestElement('nickname'),
                                getMemberId()
@@ -98,14 +98,14 @@ if ($isValid === TRUE) {
        } // END - if
 
        // Free result
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Load template
        displayMessage($content);
 } else {
        // Is there already submit the form?
        if (isPostRequestElementSet('nickname')) {
-               loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_NICKNAME_IS_INVALID--}');
+               displayErrorMessage('{--MEMBER_NICKNAME_IS_INVALID--}');
        } // END - if
 
        // Load Template