* *
* -------------------------------------------------------------------- *
* File : monthly_bonus.php *
* *
* -------------------------------------------------------------------- *
* File : monthly_bonus.php *
* Needs to be in all Files and every File needs "svn propset *
* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Needs to be in all Files and every File needs "svn propset *
* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
- require($INC);
-} elseif (!EXT_IS_ACTIVE('bonus')) {
+ die();
+} elseif (!isExtensionActive('bonus')) {
return;
}
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
return;
}
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
// Get current month (2 digits)
$curr = date('m', time());
// Get current month (2 digits)
$curr = date('m', time());
if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && (getOutputMode() != 1)) {
// Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
$whereStatement1 = "WHERE `status`='CONFIRMED'";
if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && (getOutputMode() != 1)) {
// Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
$whereStatement1 = "WHERE `status`='CONFIRMED'";
// Use last online stamp only when autopurge for inactive members is activated
if (getConfig('ap_inactive_since') > 0) {
// Okay, include last online timestamp
// Use last online stamp only when autopurge for inactive members is activated
if (getConfig('ap_inactive_since') > 0) {
// Okay, include last online timestamp
- if (getConfig('bonus_click_yn') == 'Y') $add .= " + `turbo_bonus`";
- if (getConfig('bonus_login_yn') == 'Y') $add .= " + `login_bonus`";
- if (getConfig('bonus_order_yn') == 'Y') $add .= " + `bonus_order`";
- if (getConfig('bonus_stats_yn') == 'Y') $add .= " + `bonus_stats`";
- if (getConfig('bonus_ref_yn') == 'Y') $add .= " + `bonus_ref`";
+ if (getConfig('bonus_click_yn') == 'Y') $add .= ' + `turbo_bonus`';
+ if (getConfig('bonus_login_yn') == 'Y') $add .= ' + `login_bonus`';
+ if (getConfig('bonus_order_yn') == 'Y') $add .= ' + `bonus_order`';
+ if (getConfig('bonus_stats_yn') == 'Y') $add .= ' + `bonus_stats`';
+ if (getConfig('bonus_ref_yn') == 'Y') $add .= ' + `bonus_ref`';
- $result_main = SQL_QUERY_ESC("SELECT `userid`, `email`, `gender`, `surname`, `family`, (0".$add.") AS points
+ $result_main = SQL_QUERY("SELECT
+ `userid`, `email`, `gender`, `surname`, `family`, (0" . $add . ") AS points
// Make sure zero points are not mailed
if ($content['points'] > 0) {
// Add points to user's account directly
// Make sure zero points are not mailed
if ($content['points'] > 0) {
// Add points to user's account directly
- ADD_POINTS_REFSYSTEM_DIRECT('monthly_bonus', $content['uid'], $content['points']);
-
- // Translate gender/points
- $content['gender'] = translateGender($content['gender']);
- $content['points'] = translateComma($content['points']);
+ addPointsDirectly('monthly_bonus', $content['userid'], $content['points']);
- // Reset accounts
- $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0", __FILE__, __LINE__);
+ // Reset all accounts
+ $result = SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_user_data`
+SET
+ `turbo_bonus`=0,
+ `login_bonus`=0,
+ `bonus_order`=0,
+ `bonus_stats`=0,
+ `bonus_ref`=0', __FILE__, __LINE__);