From: Roland Häder Date: Wed, 23 Jan 2013 14:33:16 +0000 (+0000) Subject: Also 'min_age' is now wrapped X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ec0f04e64a8fdac50913692615198e68ff77b078;p=mailer.git Also 'min_age' is now wrapped --- diff --git a/inc/libs/other_functions.php b/inc/libs/other_functions.php index a2b9fffed7..d8542186cb 100644 --- a/inc/libs/other_functions.php +++ b/inc/libs/other_functions.php @@ -160,5 +160,17 @@ function getDisplayDebugSqls () { return $GLOBALS[__FUNCTION__]; } +// "Getter" for min_age +function getMinAge () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('min_age'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // [EOF] ?> diff --git a/inc/template-functions.php b/inc/template-functions.php index 9e9a252d18..9c9059d314 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -787,7 +787,7 @@ function addSelectionBox ($type, $default, $prefix = '', $id = NULL, $class = 'f // Use configured min age or fixed? if (isExtensionInstalledAndNewer('other', '0.2.1')) { // Configured - $startYear = $year - getConfig('min_age'); + $startYear = $year - getMinAge(); } else { // Fixed 16 years $startYear = $year - 16;