* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2012 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 *
// Don't run on daily reset
if ((isResetModeEnabled()) || (!isHtmlOutputMode())) {
// Skip here
- return false;
-} elseif (!isExtensionActive('bonus')) {
- // Abort if extension bonus is not active
- return false;
+ return FALSE;
+} elseif ((!isExtensionActive('bonus')) || (!isExtensionActive('other'))) {
+ // Abort if extension bonus/other are not active
+ return FALSE;
}
// Only send bonus mail when bonus extension is active and maximum send-mails is not reached
// Default is ext-html_mail is gone
$add = '';
- // Do we need to send out bonus mails?
+ // Send out bonus mails?
if (isExtensionActive('html_mail')) {
// With HTML support
$add = ', `html_msg`';
} // END - if
// Run query
- $result_main = SQL_QUERY("SELECT
+ $result_main = sqlQuery("SELECT
`id`,
`subject`,
`text`,
`timestamp` DESC", __FILE__, __LINE__);
// Some mails left?
- if (!SQL_HASZERONUMS($result_main)) {
+ if (!ifSqlHasZeroNumRows($result_main)) {
// Init SQLs here
initSqls();
// Send these mails away...
$count2 = '';
- while ($mailData = SQL_FETCHARRAY($result_main)) {
+ while ($mailData = sqlFetchArray($result_main)) {
// Message is active in queue
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='QUEUE' WHERE `id`=%s LIMIT 1",
+ sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='QUEUE' WHERE `id`=%s LIMIT 1",
array(bigintval($mailData['id'])), __FILE__, __LINE__);
// Default is no users left
//* DEBUG: */ debugOutput('OK!/L:'.__LINE__);
// Remove receiver from list
- $status = removeReceiver($temporaryReceivers, $key, $userid, $mailData['id'], $mailData['id'], true);
+ $status = removeReceiver($temporaryReceivers, $key, $userid, $mailData['id'], $mailData['id'], TRUE);
// Did it work?
switch ($status) {
//* DEBUG: */ debugOutput('-L:'.__LINE__.'/'.countSelection($temporaryReceivers).'-');
if (countSelection($temporaryReceivers) == 0) {
// Queue reached!
- SQL_QUERY_ESC("UPDATE
+ sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_bonus`
SET
`data_type`='SEND',
} // END - if
} elseif ($GLOBALS['pool_cnt'] >= getMaxSend()) {
// Update bonus pool
- SQL_QUERY_ESC("UPDATE
+ sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_bonus`
SET
`data_type`='NEW',
implode(';', $temporaryReceivers),
bigintval($mailData['id'])
), __FILE__, __LINE__);
- //* DEBUG: */ debugOutput('*L:'.__LINE__.'<pre>'.print_r($temporaryReceivers, true).'</pre>!!!');
+ //* DEBUG: */ debugOutput('*L:'.__LINE__.'<pre>'.print_r($temporaryReceivers, TRUE).'</pre>!!!');
// Run any SQLs
runFilterChain('run_sqls');
} // END - if
// Free memory
- SQL_FREERESULT($result_main);
+ sqlFreeResult($result_main);
// Remove variable
unset($mailText);