aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-08-06 17:25:29 +0000
committerNils Adermann <naderman@naderman.de>2006-08-06 17:25:29 +0000
commit8b079894f3e528c9ffe652f8f3a041599d8cbdc0 (patch)
tree04efd5c2cf97e16a3540b9ff5c09a1944cf4b963 /phpBB/viewtopic.php
parent4af44652aced7c601cdfeff93dc03e6672e8b2c3 (diff)
downloadforums-8b079894f3e528c9ffe652f8f3a041599d8cbdc0.tar
forums-8b079894f3e528c9ffe652f8f3a041599d8cbdc0.tar.gz
forums-8b079894f3e528c9ffe652f8f3a041599d8cbdc0.tar.bz2
forums-8b079894f3e528c9ffe652f8f3a041599d8cbdc0.tar.xz
forums-8b079894f3e528c9ffe652f8f3a041599d8cbdc0.zip
- finally making the age calculation work [Bug #3582]
- replacing all occurances of L_NONE with a more specific string [Bug #3494] - a few corrections to html id attributes in the installer - using correct permission in mcp_report [Bug #2471] - allow deleting the avatar, when no upload method is enabled and hide the delete button if no avatar is set git-svn-id: file:///svn/phpbb/trunk@6241 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 694f173268..43aca88ade 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1072,7 +1072,18 @@ while ($row = $db->sql_fetchrow($result))
if ($bday_year)
{
- $user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - (($today['month'] - $bday_month < 0) ? 1 : (($today['day'] - $bday_day < 0) ? 1 : 0)));
+ $diff = $today['month'] - $bday_month;
+ if ($diff == 0)
+ {
+ $diff = ($today['day'] - $bday_day < 0) ? 1 : 0;
+ }
+ else
+ {
+ $diff = ($diff < 0) ? 1 : 0;
+ }
+
+ $age = (int) (date('Y', $time) - $bday_year - $diff);
+ $user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - $diff);
}
}
}