this is based on [url="http://torrenttrader.org/index.php?showtopic=4591&hl=birthday"]http://torrenttrader.org/index.php?showtopic=4591&hl=birthday[/url]
and [url="http://torrenttrader.org/topic/11611-date-of-birth-at-registration"]http://torrenttrader.org/topic/11611-date-of-birth-at-registration[/url]
I did not create it, I just fixed it to work with 2.08
If you dont know what this does then prob not for you.
1st sql
ALTER TABLE `users` ADD dob DATE NOT NULL default '0000-00-00';
Then languages.find
$LANG["AGE"] = "Age";
after add
account.phpchange
<b><?php echo T_("AGE"); ?>:</b> <?php echo $CURUSER["age"]; ?><br />to
remove
account-details.phpreplace
<?php echo T_("AGE"); ?>: <?php echo htmlspecialchars($user["age"])?><br />with
account-signup.phpreplace
with
farther down replace
with
and
with
and [url="http://torrenttrader.org/topic/11611-date-of-birth-at-registration"]http://torrenttrader.org/topic/11611-date-of-birth-at-registration[/url]
I did not create it, I just fixed it to work with 2.08
If you dont know what this does then prob not for you.
1st sql
ALTER TABLE `users` ADD dob DATE NOT NULL default '0000-00-00';
Then languages.find
$LANG["AGE"] = "Age";
after add
$LANG["DATE_OF_BIRTHDAY"] = "Birth Date";
$LANG["DOB_FAILED_MSG"] = "Do not leave any required Birthday Fields blank.";
account.phpchange
<b><?php echo T_("AGE"); ?>:</b> <?php echo $CURUSER["age"]; ?><br />to
<?php
///////////////// BIRTHDAY MOD /////////////////////
if ($CURUSER[dob] != "0000-00-00") {
$current = gmdate("Y-m-d", time() + $CURUSER['tzoffset'] * 60);
$birthday = $CURUSER["dob"];
list($year2, $month2, $day2) = preg_split('/[-]/', $current);
list($year1, $month1, $day1) = preg_split('/[-]/', $birthday);
if ($month2 < $month1) {
$age = $year2 - $year1 - 1;
}
if ($month2 == $month1) {
if ($day2 < $day1) {
$age = $year2 - $year1 - 1;
} else {
$age = $year2 - $year1;
}
}
if ($month2 > $month1) {
$age = $year2 - $year1;
}
print(T_("AGE").": $agen");
print(T_("DATE_OF_BIRTHDAY").": $birthdayn<br />");
}
///////////////// BIRTHDAY MOD /////////////////////
?>
remove
if (is_valid_id($age))
$updateset[] = "age = '$age'";
account-details.phpreplace
<?php echo T_("AGE"); ?>: <?php echo htmlspecialchars($user["age"])?><br />with
<?php
if ($user[dob] != "0000-00-00") {
$current = gmdate("Y-m-d", time() + $CURUSER['tzoffset'] * 60);
$birthday = $user["dob"];
list($year2, $month2, $day2) = preg_split('/[-]/', $current);
list($year1, $month1, $day1) = preg_split('/[-]/', $birthday);
if ($month2 < $month1) {
$age = $year2 - $year1 - 1;
}
if ($month2 == $month1) {
if ($day2 < $day1) {
$age = $year2 - $year1 - 1;
} else {
$age = $year2 - $year1;
}
}
if ($month2 > $month1) {
$age = $year2 - $year1;
}
print(T_("AGE").": $agen");
if ($user["id"] == $CURUSER["id"] || $CURUSER["control_panel"] == "yes") {
print(T_("DATE_OF_BIRTHDAY").": $birthdayn<br />");
} else {
print("n<br />");
}
}
///////////////// BIRTHDAY MOD /////////////////////
?>
account-signup.phpreplace
$age = (int) $_POST["age"];
with
$year = (int) $_POST["year"];
$month = (int) $_POST["month"];
$day = (int) $_POST["day"];
if (!$year || !$month || !$day)
$message = T_("DOB_FAILED_MSG");
$dob = "$year-$month-$day";
farther down replace
, agewith
, doband
, $agewith
, $dob
