1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 07:35:29 +02:00

[ticket/10173] Only calculate age if year is not false as per nn-.

PHPBB3-10173
This commit is contained in:
Andreas Fischer 2011-05-08 21:31:19 +02:00
parent 6a7d7285fb
commit a072526890

View File

@ -98,15 +98,15 @@ if ($config['load_birthdays'] && $config['allow_birthdays'])
{
$birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
$birthday_year = (int) substr($row['user_birthday'], -4);
$birthday_age = $now['year'] - $birthday_year;
$birthday_age = ($birthday_year) ? $now['year'] - $birthday_year : '';
$template->assign_block_vars('birthdays', array(
'USERNAME' => $birthday_username,
'AGE' => ($birthday_year) ? $birthday_age : '',
'AGE' => $birthday_age,
));
// For 3.0 compatibility
$birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
$birthday_list[] = $birthday_username . (($birthday_age) ? ' (' . $birthday_age . ')' : '');
}
$db->sql_freeresult($result);
}