// 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 .= "<OPTION value=\"".$idx."\"";
if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
} // END - for
} elseif ($DEFAULT == -1) {
// Current year minus 1
- for ($idx = 2003; $idx <= ($YEAR + 1); $idx++)
+ for ($idx = $startYear; $idx <= ($YEAR + 1); $idx++)
{
$OUT .= "<OPTION value=\"".$idx."\">".$idx."</OPTION>\n";
}
} else {
// Get current year and subtract the configured minimum age
- $OUT .= "<OPTION value=\"1929\"><1930</OPTION>\n";
- $YEAR = date('Y', time()) - $_CONFIG['min_age'];
- for ($idx = 1930; $idx <= $YEAR; $idx++)
- {
+ $OUT .= "<OPTION value=\"".($minYear - 1)."\"><".$minYear."</OPTION>\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 .= "<OPTION value=\"".$idx."\"";
if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
$OUT .= ">".$idx."</OPTION>\n";
- }
+ } // END - for
}
break;
$OUT .= "<OPTION value=\"".$idx."\"";
if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
$OUT .= ">".$idx."</OPTION>\n";
- }
+ } // END - for
break;
case "hour":
$OUT .= "<OPTION value=\"".$idx."\"";
if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
$OUT .= ">".$idx."</OPTION>\n";
- }
+ } // END - for
break;
case "yn":