Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / referral-functions.php
index 2e86d58cbd4ccb65401eddb8734d3f425c3479e8..788e40cfa80bbabba4de8349a181f7d283f4f8a5 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Alle zum Referral-System gehoerenden Funktionen  *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -419,7 +414,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Are there some entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Fetch all entries
                while ($row = sqlFetchArray($result)) {
                        // Init click rate with zero
@@ -822,7 +817,7 @@ function determineReferralId () {
        if (isValidReferralId()) {
                // Do not determine it, just return it
                return getReferralId();
-       } elseif ((!isHtmlOutputMode()) && (basename($_SERVER['PHP_SELF']) != 'ref.php')) {
+       } elseif ((!isHtmlOutputMode()) && (getModule() != 'ref')) {
                // Skip this in non-html-mode and outside ref.php
                return FALSE;
        }
@@ -843,7 +838,7 @@ function determineReferralId () {
                // Set refid=ref (the referral link uses such variable)
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using ref from GET data (' . getRequestElement('ref') . ')');
                setReferralId(getRequestElement('ref'));
-       } elseif ((isGetRequestElementSet('user')) && (basename($_SERVER['PHP_SELF']) == 'click.php')) {
+       } elseif ((isGetRequestElementSet('user')) && (getModule() == 'click')) {
                // The variable user comes from  click.php
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using user from GET data (' . getRequestElement('user') . ')');
                setReferralId(bigintval(getRequestElement('user')));