X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fbonus_functions.php;h=e1e6fee8762ac691aa8394b39ce3ee945073eebb;hp=7b3e26ddd3fd93455c816111713f6ae67959116d;hb=ca256746fe0757a23df4064824c8fe2087ad5634;hpb=0bf0f6a180c9869b4551076337965260bf2104ad diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 7b3e26ddd3..e1e6fee876 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -215,7 +215,7 @@ function handleBonusPoints ($mode, $userid) { $return = FALSE; // Switch to jackpot-mode when no UID is supplied but userid-mode is selected - if ((getBonusMode() == 'UID') && ($userid == '0') && (isExtensionActive('jackpot'))) { + if ((getBonusMode() == 'UID') && (!isValidId($userid)) && (isExtensionActive('jackpot'))) { // Update database & config updateConfiguration('bonus_mode', 'JACKPOT'); } // END - if @@ -238,7 +238,7 @@ function handleBonusPoints ($mode, $userid) { break; case 'JACKPOT': // ... jackpot - if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) === FALSE) && (isValidUserId($userid))) { + if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) === FALSE) && (isValidId($userid))) { if ($total >= $points) { // Subtract points from userid's account $return = subtractPointsFromJackpot('bonus_payout_jackpot', $userid, $points); @@ -496,6 +496,18 @@ function getBonusIncludeOwn () { return $GLOBALS[__FUNCTION__]; } +// Checks whether bonus_include_own is set to 'Y' +function isBonusIncludeOwnEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getBonusIncludeOwn() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // Getter for bonus_disable_notify function getBonusDisableNotify () { // Is there cache? @@ -532,6 +544,18 @@ function getIncludeBonusClick () { return $GLOBALS[__FUNCTION__]; } +// Checks whether include_bonus_click is set to 'Y' +function isIncludeBonusClickEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getIncludeBonusClick() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // Getter for include_bonus_login function getIncludeBonusLogin () { // Is there cache? @@ -544,6 +568,18 @@ function getIncludeBonusLogin () { return $GLOBALS[__FUNCTION__]; } +// Checks whether include_bonus_login is set to 'Y' +function isIncludeBonusLoginEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getIncludeBonusLogin() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // Getter for include_bonus_order function getIncludeBonusOrder () { // Is there cache? @@ -556,6 +592,18 @@ function getIncludeBonusOrder () { return $GLOBALS[__FUNCTION__]; } +// Checks whether include_bonus_order is set to 'Y' +function isIncludeBonusOrderEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getIncludeBonusOrder() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // Getter for include_bonus_Ref function getIncludeBonusRef () { // Is there cache? @@ -568,6 +616,18 @@ function getIncludeBonusRef () { return $GLOBALS[__FUNCTION__]; } +// Checks whether include_bonus_ref is set to 'Y' +function isIncludeBonusRefEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getIncludeBonusRef() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // Getter for include_bonus_stats function getIncludeBonusStats () { // Is there cache? @@ -580,5 +640,17 @@ function getIncludeBonusStats () { return $GLOBALS[__FUNCTION__]; } +// Checks whether include_bonus_stats is set to 'Y' +function isIncludeBonusStatsEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getIncludeBonusStats() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // [EOF] ?>