aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/index.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2011-05-08 16:41:55 +0200
committerAndreas Fischer <bantu@phpbb.com>2011-05-08 16:43:27 +0200
commit6a7d7285fbee7fd7838f1bf45e631cb3307ac514 (patch)
tree2f2e61dd097228abc14be1629cba60ab4f626858 /phpBB/index.php
parent2f458352b8660386021af6868dcec75943bb8483 (diff)
downloadforums-6a7d7285fbee7fd7838f1bf45e631cb3307ac514.tar
forums-6a7d7285fbee7fd7838f1bf45e631cb3307ac514.tar.gz
forums-6a7d7285fbee7fd7838f1bf45e631cb3307ac514.tar.bz2
forums-6a7d7285fbee7fd7838f1bf45e631cb3307ac514.tar.xz
forums-6a7d7285fbee7fd7838f1bf45e631cb3307ac514.zip
[ticket/10173] Use an array for the legacy birthday list as per rxu.
PHPBB3-10173
Diffstat (limited to 'phpBB/index.php')
-rw-r--r--phpBB/index.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index e5dceeacf2..62c229f0b5 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -81,7 +81,7 @@ $db->sql_freeresult($result);
$legend = implode(', ', $legend);
// Generate birthday list if required ...
-$birthday_list = '';
+$birthday_list = array();
if ($config['load_birthdays'] && $config['allow_birthdays'])
{
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
@@ -96,20 +96,17 @@ if ($config['load_birthdays'] && $config['allow_birthdays'])
while ($row = $db->sql_fetchrow($result))
{
- $birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
- $birthday_list .= (($birthday_list != '') ? ', ' : '') . $birthday_username;
- $birthday_year = (int) substr($row['user_birthday'], -4);
- $birthday_age = $now['year'] - $birthday_year;
-
- if ($birthday_year)
- {
- $birthday_list .= ' (' . $birthday_age . ')';
- }
+ $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;
$template->assign_block_vars('birthdays', array(
'USERNAME' => $birthday_username,
'AGE' => ($birthday_year) ? $birthday_age : '',
));
+
+ // For 3.0 compatibility
+ $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
}
$db->sql_freeresult($result);
}
@@ -122,7 +119,7 @@ $template->assign_vars(array(
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'LEGEND' => $legend,
- 'BIRTHDAY_LIST' => $birthday_list,
+ 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode(', ', $birthday_list),
'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'),
'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'),