aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2011-08-21 15:17:51 +0200
committerAndreas Fischer <bantu@phpbb.com>2011-08-21 15:17:51 +0200
commit540ca1a8d88279b120b142c244c96c9fae9a867b (patch)
tree723210d7dc2b2b4640b880168f68f784f3c90165 /phpBB
parent91b415dd01095a4a108909b79f35f2146bb9abe7 (diff)
parent3c7dfc7e193200da80d53bd668cded239edf36d3 (diff)
downloadforums-540ca1a8d88279b120b142c244c96c9fae9a867b.tar
forums-540ca1a8d88279b120b142c244c96c9fae9a867b.tar.gz
forums-540ca1a8d88279b120b142c244c96c9fae9a867b.tar.bz2
forums-540ca1a8d88279b120b142c244c96c9fae9a867b.tar.xz
forums-540ca1a8d88279b120b142c244c96c9fae9a867b.zip
Merge remote-tracking branch 'nickvergessen/ticket/8177' into develop-olympus
* nickvergessen/ticket/8177: [ticket/8177] Display birthdays of 29th february on 28th in non-leap years.
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/index.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index 91cbd326b9..c3f7c871d3 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -84,12 +84,20 @@ $birthday_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays'])
{
$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);
+
+ // Display birthdays of 29th february on 28th february in non-leap-years
+ $leap_year_birthdays = '';
+ if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L'))
+ {
+ $leap_year_birthdays = " OR user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'";
+ }
+
$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
FROM ' . USERS_TABLE . ' u
LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
WHERE (b.ban_id IS NULL
OR b.ban_exclude = 1)
- AND u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
+ AND (u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' $leap_year_birthdays)
AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);