X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=d5a4f20347509cd0f2b2833ad90ad51290228827;hp=66324337f68d134e09d79940aba79f6620e04568;hb=6586600d8020147192e5f28ca2a3a0153f774d3c;hpb=0b0f1ec06f8dda4617f231a208ee30204e041e07
diff --git a/inc/functions.php b/inc/functions.php
index 66324337f6..d5a4f20347 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1139,8 +1139,20 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0") {
// Get current year
$YEAR = date('Y', time());
+ // Use configured min age or fixed?
+ if (GET_EXT_VERSION("other") >= "0.2.1") {
+ // Configured
+ $startYear = $YEAR - $_CONFIG['min_age'];
+ } else {
+ // Fixed 16 years
+ $startYear = $YEAR - 16;
+ }
+
+ // Calculate earliest year (100 years old people can still enter Internet???)
+ $minYear = $YEAR - 100;
+
// Check if the default value is larger than minimum and bigger than actual year
- if (($DEFAULT > 1930) && ($DEFAULT >= $YEAR)) {
+ if (($DEFAULT > $minYear) && ($DEFAULT >= $YEAR)) {
for ($idx = $YEAR; $idx < ($YEAR + 11); $idx++) {
$OUT .= "\n";
}
} else {
// Get current year and subtract the configured minimum age
- $OUT .= "\n";
- $YEAR = date('Y', time()) - $_CONFIG['min_age'];
- for ($idx = 1930; $idx <= $YEAR; $idx++)
- {
+ $OUT .= "\n";
+ // Calculate earliest year depending on extension version
+ if (GET_EXT_VERSION("other") >= "0.2.1") {
+ // Use configured minimum age
+ $YEAR = date('Y', time()) - $_CONFIG['min_age'];
+ } else {
+ // Use fixed 16 years age
+ $YEAR = date('Y', time()) - 16;
+ }
+
+ // Construct year selection list
+ for ($idx = $minYear; $idx <= $YEAR; $idx++) {
$OUT .= "