diff options
author | Andreas Fischer <bantu@phpbb.com> | 2011-08-21 15:18:01 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2011-08-21 15:18:01 +0200 |
commit | 8ad58645fe87a77cbc79f25ef2aff7a3785d24eb (patch) | |
tree | 2fc492d5fc2f415c3be4c0e556e1bba4fa52da95 | |
parent | 0b9fe01cce56cd8421e8eb43cdadc63f1d244987 (diff) | |
parent | 540ca1a8d88279b120b142c244c96c9fae9a867b (diff) | |
download | forums-8ad58645fe87a77cbc79f25ef2aff7a3785d24eb.tar forums-8ad58645fe87a77cbc79f25ef2aff7a3785d24eb.tar.gz forums-8ad58645fe87a77cbc79f25ef2aff7a3785d24eb.tar.bz2 forums-8ad58645fe87a77cbc79f25ef2aff7a3785d24eb.tar.xz forums-8ad58645fe87a77cbc79f25ef2aff7a3785d24eb.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/8177] Display birthdays of 29th february on 28th in non-leap years.
-rw-r--r-- | phpBB/index.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/index.php b/phpBB/index.php index 63361c43c7..b7079d3e88 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -85,12 +85,20 @@ $birthday_list = array(); 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); |