]> git.mxchange.org Git - mailer.git/blobdiff - inc/mails/doubler_mails.php
Opps, not all elements for sprintf() has been set.
[mailer.git] / inc / mails / doubler_mails.php
index 92606bfba89f384615ec89d93ae5f38633684f29..32d57d36c7356181c74adace6213d5e8a0cf76de 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Sendet Mails bei vergueteter Verdoppelung aus    *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
@@ -68,16 +63,6 @@ unsetPostRequestElement('DOUBLER_USERID');
 setSession('DOUBLER_USERID', '');
 if (empty($GLOBALS['local_doubler_userid'])) $GLOBALS['local_doubler_userid'] = '0';
 
-// Init additional WHERE statement
-$whereStatement = ' ';
-
-// Is ext-holiday installed?
-// @TODO Rewrite these if() blocks to a filter
-if (isExtensionActive('holiday')) {
-       // Exclude those as well
-       $whereStatement .= " AND `d`.`holiday_active`='N'";
-} // END - if
-
 // Check for doubles which we can pay out
 $result_total = sqlQueryEscaped("SELECT
        COUNT(`do`.`id`) AS `cnt`,
@@ -89,7 +74,7 @@ ON
        `do`.`userid`=`d`.`userid`
 WHERE
        `d`.`status`='CONFIRMED'
-       " . runFilterChain('user_exclusion_sql', $whereStatement) . " AND
+       " . runFilterChain('user_exclusion_sql', ' ' . $whereStatement) . " AND
        `do`.`points` <= %s AND
        `do`.`points` >= ({?doubler_min?} * 2) AND
        `do`.`completed`='N' AND
@@ -121,7 +106,7 @@ ON
        `do`.`userid`=`d`.`userid`
 WHERE
        `d`.`status`='CONFIRMED'
-       " . runFilterChain('user_exclusion_sql', $whereStatement) . " AND
+       " . runFilterChain('user_exclusion_sql', ' ' . $whereStatement) . " AND
        `do`.`points` <= %s AND
        `do`.`points` >= ({?doubler_min?} * 2) AND
        `do`.`completed`='N' AND
@@ -167,7 +152,7 @@ if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((sqlNumRow
                        if ($content['userid'] != getDoublerUserid()) {
                                // Add points
                                initReferralSystem();
-                               addPointsThroughReferralSystem(sprintf("doubler_%s", strtolower(getDoublerSendMode())), $content['userid'], $content['points']);
+                               addPointsThroughReferralSystem(sprintf('doubler_%s', strtolower(getDoublerSendMode())), $content['userid'], $content['points']);
                        } // END - if
 
                        // Set entry as "payed"
@@ -184,7 +169,7 @@ if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((sqlNumRow
                        } // END - if
 
                        // Exclude also webmaster's id in taking points from webmaster's account
-                       if (($userPoints > 0) && ($userPoints >= $content['points']) && ($okay === FALSE) && (getDoublerUserid() > 0) && ($content['userid'] != getDoublerUserid())) {
+                       if (($userPoints > 0) && ($userPoints >= $content['points']) && ($okay === FALSE) && (isValidId(getDoublerUserid())) && ($content['userid'] != getDoublerUserid())) {
                                // Subtract points
                                $okay = subtractPoints('doubler_payout', getDoublerUserid(), $content['points']);
                        } // END - if