]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/bonus_functions.php
Fixed a lot typos, thanks to profi-concept
[mailer.git] / inc / libs / bonus_functions.php
index 68ac09ada8360a0b6dbe58180dbe8ba14a1b9716..f97467bf1bc37c71e0cec5d5fecb1215045ec220 100644 (file)
@@ -38,11 +38,9 @@ if (!defined('__SECURITY')) {
 }
 
 // This function must be run *BEFORE* a link is removed from table 'mxchange_user_links' !
-function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) {
-       global $_CONFIG;
-
+function BONUS_ADD_TURBO_POINTS ($mid, $uid, $type) {
        // Shall we add bonus points?
-       if (getConfig('bonus_active') == "N") return false;
+       if (getConfig('bonus_active') != "Y") return false;
 
        // Init variables
        $SQL = ""; $bonys = 0; $mail = 0; $column = "";
@@ -112,7 +110,6 @@ function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) {
 }
 //
 function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
-       global $_CONFIG;
        $self = false; $OUT = "";
 
        // How many ranks do we have?
@@ -188,18 +185,13 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
 }
 //
 function BONUS_POINTS_HANDLER ($MODE) {
-       global $_CONFIG;
-
        // Shall we add bonus points?
-       if (getConfig('bonus_active') == "N") return;
+       if (getConfig('bonus_active') != "Y") return;
 
        // Switch to jackpot-mode when no UID is supplied but userid-mode is selected
        if ((getConfig('bonus_mode') == "UID") && (getConfig('bonus_uid') == "0")) {
-               // Update database
-               UPDATE_CONFIG(array('bonus_mode'), array("JACKPOT"));
-
-               // Update configuration
-               $_CONFIG['bonus_mode'] = "JACKPOT";
+               // Update database & config
+               UPDATE_CONFIG('bonus_mode', "JACKPOT");
        } // END - if
 
        if ($MODE == "login_bonus") {
@@ -237,11 +229,9 @@ function BONUS_POINTS_HANDLER ($MODE) {
                break;
        }
 }
-//
-function BONUS_PURGE_EXPIRED_TURBO_BONUS()
-{
-       global $_CONFIG;
 
+//
+function BONUS_PURGE_EXPIRED_TURBO_BONUS() {
        // Remove entries
        $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FILE__, __LINE__);
        if (SQL_AFFECTEDROWS() > 0) {