X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilter%2Fbonus_filter.php;h=0f865670303fd75687c26592c21a5ea68054bb05;hb=5942a52ee1b26fdf495dc9c0946d616afc649607;hp=63aafff99354db6470c986d60810f664a774cadc;hpb=60929c313ccc10e74e2724373f7bc9ee00d774d1;p=mailer.git diff --git a/inc/filter/bonus_filter.php b/inc/filter/bonus_filter.php index 63aafff993..0f86567030 100644 --- a/inc/filter/bonus_filter.php +++ b/inc/filter/bonus_filter.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -50,11 +50,11 @@ function FILTER_ADD_LOGIN_BONUS ($filterData) { } // END - if // Bonus is not given by default ;-) - $bonus = false; - if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('include_bonus_login') == 'Y')) { + $bonus = FALSE; + if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (isIncludeBonusLoginEnabled())) { // 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! - SQL_QUERY_ESC('UPDATE + sqlQueryEscaped('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `last_login`=UNIX_TIMESTAMP() @@ -68,10 +68,10 @@ LIMIT 1', ); // Updated entry? - $bonus = (!SQL_HASZEROAFFECTED()); + $bonus = (!ifSqlHasZeroAffectedRows()); } // END - if - if (($bonus === true) && (getRequestElement('do') == 'bonus')) { + if (($bonus === TRUE) && (getRequestElement('do') == 'bonus')) { // Output message with added points $GLOBALS['message'] .= '
{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}
'; } else { @@ -88,10 +88,10 @@ LIMIT 1', function FILTER_GENERATE_BONUS_MAIL_LINKS ($filterData) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); - // Is the type 'bid'? - if ($filterData['type'] == 'bid') { + // Is the type 'bonus'? + if ($filterData['type'] == 'bonus') { // Load template - $filterData['__output'] .= loadTemplate('admin_links_bonus_mail', true, $filterData); + $filterData['__output'] .= loadTemplate('admin_links_bonus_mail', TRUE, $filterData); } // END - if // Return data @@ -110,11 +110,11 @@ function FILTER_ADD_BONUS_POINTS_USER_COLUMNS ($add = '') { } // END - if // Add more columns only when the corresponding configuration is enabled, too - if (getConfig('include_bonus_click') == 'Y') $add .= ' + `turbo_bonus`'; - if (getConfig('include_bonus_login') == 'Y') $add .= ' + `login_bonus`'; - if (getConfig('include_bonus_order') == 'Y') $add .= ' + `bonus_order`'; - if (getConfig('include_bonus_stats') == 'Y') $add .= ' + `bonus_stats`'; - if (getConfig('include_bonus_ref') == 'Y') $add .= ' + `bonus_ref`'; + if (isIncludeBonusClickEnabled()) $add .= ' + `turbo_bonus`'; + if (isIncludeBonusLoginEnabled()) $add .= ' + `login_bonus`'; + if (isIncludeBonusOrderEnabled()) $add .= ' + `bonus_order`'; + if (isIncludeBonusRefEnabled() ) $add .= ' + `bonus_ref`'; + if (isIncludeBonusStatsEnabled()) $add .= ' + `bonus_stats`'; // Return $add //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); @@ -133,7 +133,7 @@ function FILTER_BONUS_USER_REGISTRATION_ADD_SQL_COLUMNS ($filterData) { // Return filter data //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); - //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=
'.print_r($filterData,true).'
'; + //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=
'.print_r($filterData,TRUE).'
'; return $filterData; } @@ -148,7 +148,19 @@ function FILTER_SEND_BONUS_NOTIFICATIONS ($filterData) { // Return filter data //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); - //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=
'.print_r($filterData,true).'
'; + //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=
'.print_r($filterData,TRUE).'
'; + return $filterData; +} + +// Filter to add exclusion SQL for configured userid +function FILTER_EXLCUDE_BONUS_USERID ($filterData = array()) { + // Is it valid? + if (isValidId(getBonusUserid())) { + // Exclude it + array_push($filterData, '{?bonus_userid?}'); + } // END - if + + // Return it return $filterData; }