diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-05-20 23:57:08 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-05-20 23:57:08 +0000 |
commit | 9ce38e6977c2d295d9646b2e5c171318bf2f34bd (patch) | |
tree | 4ed5bb6e2b6e0ac9a06a055f0e5af0dcd8f0b29b /phpBB/index.php | |
parent | 70634a792e33ca7ae3b695b029303f5841891448 (diff) | |
download | forums-9ce38e6977c2d295d9646b2e5c171318bf2f34bd.tar forums-9ce38e6977c2d295d9646b2e5c171318bf2f34bd.tar.gz forums-9ce38e6977c2d295d9646b2e5c171318bf2f34bd.tar.bz2 forums-9ce38e6977c2d295d9646b2e5c171318bf2f34bd.tar.xz forums-9ce38e6977c2d295d9646b2e5c171318bf2f34bd.zip |
Enable display of birthday listing ... controlled via ACP Load Settings
git-svn-id: file:///svn/phpbb/trunk@4034 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/index.php')
-rw-r--r-- | phpBB/index.php | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/phpBB/index.php b/phpBB/index.php index 0dcc409fa3..c164a2c175 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -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") ); |