- // Found?
- if (SQL_NUMROWS($result) == 1)
- {
- // Load nickname from database
- list($ret) = SQL_FETCHROW($result);
- }
+ // Increment cache counter
+ incrementConfigEntry('cache_hits');
+ } else {
+ // Init result
+ $result = false;
+
+ // 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) {
+ // Load nickname from database
+ list($ret) = SQL_FETCHROW($result);
+
+ // Put it in cche
+ $GLOBALS['cache_array']['nicknames'][$userid] = $ret;
+ } // END - if