- // SQL string to check for accounts
- $result_main = SQL_QUERY_ESC("SELECT userid, email, (turbo_bonus + login_bonus + bonus_order + bonus_stats + bonus_ref) AS active_bonus
-FROM "._MYSQL_PREFIX."_user_data
-".$whereStatement1."".$ADD."
-ORDER BY active_bonus DESC, userid LIMIT %s",
- array($whereStatement2), __FILE__, __LINE__);
-
- if (SQL_NUMROWS($result_main) > 0)
- {
- // Load our winners...
- $UIDs = "";
- while(list($uid, $email, $points) = SQL_FETCHROW($result_main))
- {
- // Add userids in a row
- $UIDs .= ",'".$uid."'";
-
- // Add points to user's account directly
- ADD_POINTS_REFSYSTEM($uid, $points, false, "0", false, "direct");
-
- // Load email template and email it away
- $msg = LOAD_EMAIL_TEMPLATE("member_bonus", $points, bigintval($uid));
- SEND_EMAIL($email, BONUS_MONTHLY_ONLINE_BONUS, $msg);
- }
+ // Is ext-holiday installed?
+ if (isExtensionActive('holiday')) {
+ // Exclude those as well
+ $whereStatement .= " AND `d`.`holiday_active`='N'";
+ } // END - if