mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10173] Only calculate age if year is not false as per nn-.
PHPBB3-10173
This commit is contained in:
parent
6a7d7285fb
commit
a072526890
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue