require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module
$GLOBALS['__module'] = 'ref';
// Check for determined referral id
if ((isExtensionActive('user')) && (isReferralIdValid()) && (isValidUserId(determineReferralId()))) {
- // Update ref counter
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1",
- array(convertZeroToNull(determineReferralId())), __FILE__, __LINE__);
+ // Run filter chain for updating referral data
+ runFilterChain('update_referral_data');
// Base URL for redirection
switch (getConfig('refid_target')) {
case 'index':
$url = 'modules.php?module=index';
break;
+
+ default: // Is not valid
+ reportBug(__FILE__, __LINE__, 'Invalid refid target ' . getConfig('refid_target') . ' detected.');
+ break;
} // END - switch
} // END - if