From ec0f04e64a8fdac50913692615198e68ff77b078 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 23 Jan 2013 14:33:16 +0000 Subject: [PATCH] Also 'min_age' is now wrapped --- inc/libs/other_functions.php | 12 ++++++++++++ inc/template-functions.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) 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; -- 2.39.5