]> git.mxchange.org Git - mailer.git/blobdiff - ref.php
Rewrote new extension detection:
[mailer.git] / ref.php
diff --git a/ref.php b/ref.php
index c91ff65364b07531d0a7a6016c05e988df7e90d3..02fc5fa734fca9e688f59c096a0b1b645c5c75eb 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -39,7 +39,7 @@
 require('inc/libs/security_functions.php');
 
 // Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
 
 // Set module
 $GLOBALS['__module']      = 'ref';
@@ -55,10 +55,9 @@ setContentType('text/html');
 $url = 'modules.php?module=index';
 
 // 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__);
+if ((isExtensionActive('user')) && (isReferralIdValid()) && (isValidId(determineReferralId()))) {
+       // Run filter chain for updating referral data
+       runFilterChain('update_referral_data');
 
        // Base URL for redirection
        switch (getConfig('refid_target')) {
@@ -69,6 +68,10 @@ if ((isExtensionActive('user')) && (isReferralIdValid()) && (isValidUserId(deter
                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