- // Do we have an entry?
- if (!isUserDataValid()) {
- // No entry, so no referal id
- $GLOBALS['refid'] = getConfig('def_refid');
- } // END - if
- }
- } // END - if
-
- // Update session
- setSession('refid', determineReferalId());
-
- // Is the refid valid?
- if (determineReferalId() > 0) {
- // Update ref counter
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1",
- array(determineReferalId()), __FILE__, __LINE__);
-
- // Base URL for redirection
- switch (getConfig('refid_target')) {
- case 'register':
- $URL = 'modules.php?module=index&what=register';
- break;
-
- case 'index':
- $URL = 'index.php';
- break;
- } // END - switch
- } // END - if