mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-16 21:54:00 +02:00
Enable display of birthday listing ... controlled via ACP Load Settings
git-svn-id: file:///svn/phpbb/trunk@4034 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -110,6 +110,31 @@ while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</span>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
// Generate birthday list if required ...
|
||||
$birthday_list = '';
|
||||
if ($config['load_birthdays'])
|
||||
{
|
||||
$now = getdate();
|
||||
$sql = 'SELECT user_id, username, user_colour, user_birthday
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_birthday LIKE '" . sprintf('%2d-%2d-', $now['mday'], $now['mon']) . "%'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '';
|
||||
$birthday_list .= (($birthday_list != '') ? ', ' : '') . '<a' . $user_colour . " href=\"memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $row['username'] . '</a>';
|
||||
|
||||
if ($age = (int)substr($row['user_birthday'], -4))
|
||||
{
|
||||
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Assign index specific vars
|
||||
$template->assign_vars(array(
|
||||
@@ -117,12 +142,14 @@ $template->assign_vars(array(
|
||||
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
|
||||
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "<a href=\"memberlist.$phpEx$SID&mode=viewprofile&u=$newest_uid \">", $newest_user, '</a>'),
|
||||
'LEGEND' => $legend,
|
||||
'BIRTHDAY_LIST' => ($birthday_list) ? $birthday_list : $user->lang['NO_BIRTHDAYS'],
|
||||
|
||||
'FORUM_IMG' => $user->img('forum', 'NO_NEW_POSTS'),
|
||||
'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'),
|
||||
'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'),
|
||||
|
||||
'S_LOGIN_ACTION' => "ucp.php?$SID&mode=login",
|
||||
'S_LOGIN_ACTION' => "ucp.php?$SID&mode=login",
|
||||
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
|
||||
|
||||
'U_MARK_READ' => "index.$phpEx$SID&mark=forums")
|
||||
);
|
||||
|
Reference in New Issue
Block a user