aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/index.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-08-18 17:46:31 -0400
committerNils Adermann <naderman@naderman.de>2011-08-18 17:46:31 -0400
commitd06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b (patch)
treefc60cf66ef1544b6fc72ac1b5f57d0bf4ae1d923 /phpBB/index.php
parent9589fbffe4cdad9fa35df2597c21fc0753ed1d52 (diff)
parent6330153937b9321ce71226a7692403b64ad8e0c7 (diff)
downloadforums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.tar
forums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.tar.gz
forums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.tar.bz2
forums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.tar.xz
forums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/8571] Show age as 0 in birthday list when birthday is in the future. [ticket/8571] Show 'Age: 0' on viewprofile when birthday is in the future. [ticket/8571] Also display age on memberlist/viewprofile when age is 0. Conflicts: phpBB/index.php
Diffstat (limited to 'phpBB/index.php')
-rw-r--r--phpBB/index.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index 419b66cfdb..63361c43c7 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -98,7 +98,7 @@ 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 = ($birthday_year) ? $now['year'] - $birthday_year : '';
+ $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
$template->assign_block_vars('birthdays', array(
'USERNAME' => $birthday_username,
@@ -106,7 +106,10 @@ if ($config['load_birthdays'] && $config['allow_birthdays'])
));
// For 3.0 compatibility
- $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
+ if ($age = (int) substr($row['user_birthday'], -4))
+ {
+ $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
+ }
}
$db->sql_freeresult($result);
}