-// Probe for referal ID
-if (isGetRequestElementSet('refid')) $GLOBALS['refid'] = getRequestElement('refid');
-
-// Only check this if refid is provided!
-if (determineReferalId() > 0) {
- // Do we have nickname or userid set?
- if (isNicknameUsed(determineReferalId())) {
- // Nickname in URL, so load the ID
- $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' LIMIT 1",
- array(determineReferalId()), __FILE__, __LINE__);
- } else {
- // Direct userid entered
- $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
- array(determineReferalId()), __FILE__, __LINE__);
- }
-
- // Load data
- list($rid, $status_ref) = SQL_FETCHROW($result);
- $GLOBALS['refid'] = bigintval($rid);
-
- // Free memory
- SQL_FREERESULT($result);
-} // END - if
-
-// Init userid
-$userid = 0;
-
-// If no account was found set default refid and status to CONFIRMED
-if (empty($GLOBALS['refid'])) {
- $GLOBALS['refid'] = getConfig('def_refid');
- $status = 'CONFIRMED';
-} // END - if
-