- if (!empty($ref))
- {
- // Test if nickname ($test == "0") or ID
- $test = "".round($ref)."";
- if ((EXT_IS_ACTIVE("nickname")) && ($test != $ref))
- {
- // Nickname in URL, so load the ID
- $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' LIMIT 1", array($ref), __FILE__, __LINE__);
- list($ref) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ // Do we have an entry?
+ if (!isUserDataValid()) {
+ // No entry, so no referal id
+ $GLOBALS['refid'] = getConfig('def_refid');
+ } // END - if