X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fautopurge_functions.php;h=e66c107b61f9a6ee07da4ab8dd20549251dbbaaa;hb=45799353e6886efecaa6fe169848321a81a08c6e;hp=249a4e70cbd7926aa30a81dab63698bf6f110122;hpb=6c763653e88b9d10627e651ca59c7201d4b7d62b;p=mailer.git diff --git a/inc/libs/autopurge_functions.php b/inc/libs/autopurge_functions.php index 249a4e70cb..e66c107b61 100644 --- a/inc/libs/autopurge_functions.php +++ b/inc/libs/autopurge_functions.php @@ -1,7 +1,7 @@ $points), $userid); + sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message); +} + +// ---------------------------------------------------------------------------- +// Wrapper for configuration entries +// ---------------------------------------------------------------------------- + +// Checks whether auto-purging is enabled +function isAutoPurgingActive () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getConfig('auto_purge_active') == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Wrapper for 'autopurge_inactive +function getAutopurgeInactive () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getConfig('autopurge_inactive') == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Checks whether purging of inactive accounts is enabled +function isAutopurgeInactiveEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getAutopurgeInactive() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; } -function AUTOPURGE_ADD_POINTS($uid, $points) -{ - global $jackpot; - // Check if he has locked points or not - $result = SQL_QUERY_ESC("SELECT ref_payout FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); - list($payout) = SQL_FETCHROW($result); - SQL_FREERESULT($result); - if (($payout > 0) && (!empty($payout))) - { - // Yes, he has. - $target = "locked_points"; - } - elseif ($payout == "0") - { - // No, he has not - $target = "points"; - } - // Add points... - if (empty($payout)) - { - // ... to jackpot account - ADD_JACKPOT($points); - if (empty($jackpot)) $jackpot = 0; - $jackpot += $points; - } - else - { - // .. to user's account - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET %s=%s+%s WHERE userid=%s AND ref_depth=0 LIMIT 1", - array($target, $target, $points, bigintval($uid)), __FILE__, __LINE__); - - // Update mediadata as well - if ((GET_EXT_VERSION("mediadata") >= "0.0.4") && ($target == "points")) - { - // Update database - MEDIA_UPDATE_ENTRY(array("total_points"), "add", $points); - } - - // Send out mail to user - $msg = LOAD_EMAIL_TEMPLATE("member_autopurge_points", TRANSLATE_COMMA($points), $uid); - SEND_EMAIL($uid, AUTOPURGE_MEMBER_SUBJECT, $msg); - } +// "Getter" for ap_inactive_time +function getApInactiveTime () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('ap_inactive_time'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for auto_purge +function getAutoPurge () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('auto_purge'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for ap_dm_timeout +function getApDmTimeout () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('ap_dm_timeout'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for ap_tasks_time +function getApTasksTime () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('ap_tasks_time'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for ap_unconfirmed_time +function getApUnconfirmedTime () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('ap_unconfirmed_time'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; } -// +// [EOF] ?>