* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
if (!isMember()) {
// Do only run for logged in members
- debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
+ reportBug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
} // END - if
// Bonus is not given by default ;-)
- $bonus = false;
+ $bonus = FALSE;
if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('include_bonus_login') == 'Y')) {
// Update last login if far enougth away
// @TODO This query isn't right, it will only update if the user was for a longer time away!
$bonus = (!SQL_HASZEROAFFECTED());
} // END - if
- if (($bonus === true) && (getRequestElement('mode') == 'bonus')) {
+ if (($bonus === TRUE) && (getRequestElement('do') == 'bonus')) {
// Output message with added points
$GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
} else {
// Filter for generating admin mail links for bonus mails
function FILTER_GENERATE_BONUS_MAIL_LINKS ($filterData) {
- // Is the type 'bid'?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+ // Is the type 'bid'?
if ($filterData['type'] == 'bid') {
// Load template
- $filterData['__output'] .= loadTemplate('admin_links_bonus_mail', true, $filterData);
+ $filterData['__output'] .= loadTemplate('admin_links_bonus_mail', TRUE, $filterData);
} // END - if
// Return data
// Filter for adding bonus columns with a plus (+) sign
function FILTER_ADD_BONUS_POINTS_USER_COLUMNS ($add = '') {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
// Skip out-dated extension, because this causes an error
if (isExtensionInstalledAndOlder('bonus', '0.9.7')) {
// Skip this silently
if (getConfig('include_bonus_ref') == 'Y') $add .= ' + `bonus_ref`';
// Return $add
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
return $add;
}
+// Filter for adding SQL columns on user registration for bonus/"active" rallye notification
+function FILTER_BONUS_USER_REGISTRATION_ADD_SQL_COLUMNS ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+ // Next: active rallye
+ if (!isBonusNewMemberNotifyEnabled()) {
+ addExtraRegistrationColumns(', `bonus_rallye_enable_notify`, `bonus_rallye_disable_notify`');
+ $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
+ } // END - if
+
+ // Return filter data
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
+ return $filterData;
+}
+
+// Filter for sending out bonus rallye notifications
+function FILTER_SEND_BONUS_NOTIFICATIONS ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ // Check for bonus rallye is active and send mails out
+ if ((isBonusRallyeActive()) && (isBonusNewMemberNotifyEnabled())) {
+ // Include file for sending out mails
+ addIncludeToPool('notify', 'inc/mails/bonus_mails.php');
+ } // END - if
+
+ // Return filter data
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
+ return $filterData;
+}
+
// [EOF]
?>