- // Found?
- if (SQL_NUMROWS($result) == 1)
- {
- // Load nickname from database
- list($ret) = SQL_FETCHROW($result);
- }
+ // Nickname or userid used?
+ if ('' . round($userid) . '' === '' . $userid . '') {
+ // Userid given, so try to load user data
+ if (fetchUserData($userid)) {
+ // Load nickname from database
+ $ret = getUserData('nickname');
+
+ // Put it in cche
+ $GLOBALS['nicknames'][$userid] = $ret;
+ } // END - if
+ } else {
+ // Direct nickname found
+ $ret = $userid;