6
that's my test site ;)
in modules/profile/userinfo.php
$xoopsTpl->assign('lang_birth', _US_AGE);
$xoopsTpl->assign('user_age', CalcAge($thisUser->getVar('user_birth')));
then calcage is done through XOOPS root/include/functions.php
// ----------- added by m0nty for profile fields hack ----------------
function CalcAge($date_of_birth) { // YYYY-MM-DD
$cur_year=date("Y");
$cur_month=date("m");
$cur_day=date("d");
$dob_year=substr($date_of_birth, 0, 4);
$dob_month=substr($date_of_birth, 5, 2);
$dob_day=substr($date_of_birth, 8, 2);
if($cur_month>$dob_month || ($dob_month==$cur_month && $cur_day>=$dob_day) )
return $cur_year-$dob_year;
else
return $cur_year-$dob_year-1;
}
// ----------- end of profile fields hack ----------------
although that's all for XOOPS 2.0.13 and 2.0.10 etc.. it will certainly need changing somewhat to work with 2.2.3 and i haven't had a look at how yet, but it should be simple enough. (don't forget the language definitions too)