-if (isValidUserId(determineReferalId())) {
- // Test if nickname or numeric id
- if (isExtensionActive('nickname')) {
- // Nickname in URL, so load the id
- fetchUserData(determineReferalId(), 'nickname');
-
- // Do we have an entry?
- if (isUserDataValid()) {
- // Load userid
- $GLOBALS['refid'] = getUserData('userid');
- } else {
- // So do we have a userid?
- fetchUserData(determineReferalId());
-
- // Do we have an entry?
- if (!isUserDataValid()) {
- // No entry, so no referal id
- $GLOBALS['refid'] = getDefRefid();
- } // END - if
- }
- } // END - if
-
- // Update session
- setSession('refid', determineReferalId());
+// Check for determined referral id
+if ((isExtensionActive('user')) && (isReferralIdValid()) && (isValidUserId(determineReferralId()))) {
+ // Run filter chain for updating referral data
+ runFilterChain('update_referral_data');