+ // Found in cache?
+ if (isset($GLOBALS['cache_array']['nick_active'][$uidNick])) {
+ // Use it directly
+ $ret = $GLOBALS['cache_array']['nick_active'][$uidNick];
+
+ // Increment cache counter
+ incrementConfigEntry('cache_hits');
+ } else {
+ // Search in database
+ // @TODO Can we replace this with GET_TOTAL_DATA() ?
+ $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s OR nickname='%s' LIMIT 1",
+ array(bigintval($uidNick), $uidNick), __FUNCTION__, __LINE__);