X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fnickname_functions.php;h=45b48d04c792b6cdd3b62dcf49ddc31b3ab880ab;hb=696752855f56f329984904e7794aebd77bfb5845;hp=6fdb1916d77dd531aa672129157c21bb21a1b170;hpb=5e4fd904c6045b66540a4e8fd77bf4f2f04537eb;p=mailer.git diff --git a/inc/libs/nickname_functions.php b/inc/libs/nickname_functions.php index 6fdb1916d7..45b48d04c7 100644 --- a/inc/libs/nickname_functions.php +++ b/inc/libs/nickname_functions.php @@ -80,21 +80,14 @@ function getNickname ($userid) { // Nickname or userid used? if (''.round($userid).'' === ''.$userid.'') { - // Userid given - $result = SQL_QUERY_ESC("SELECT `nickname` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1", - array(bigintval($userid)), __FUNCTION__, __LINE__); - - // Found? - if (SQL_NUMROWS($result) == 1) { + // Userid given, so try to load user data + if (fetchUserData($userid)) { // Load nickname from database - list($ret) = SQL_FETCHROW($result); + $ret = getUserData('nickname'); // Put it in cche $GLOBALS['nicknames'][$userid] = $ret; } // END - if - - // Free result - SQL_FREERESULT($result); } else { // Direct nickname found! $ret = $userid;