* -------------------------------------------------------------------- *
* 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 *
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`,
`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
`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
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"
} // 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