diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-06 20:53:46 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-06 20:53:46 +0000 |
commit | dd9ad539fdab80badedf801a816b8a0beafbbf5c (patch) | |
tree | db8ae8a184b060d5576604cc0dfa723773daedb8 /phpBB/index.php | |
parent | 2c8afb820e3842bed2ab6cec4053e71b5c566985 (diff) | |
download | forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.gz forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.bz2 forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.xz forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.zip |
ok, this one is rather large... the most important change:
re-introduce append_sid: old style continues to work, not a performance hog as it was in 2.0.x -> structure is different
apart from this, code cleanage, bug fixing, etc.
git-svn-id: file:///svn/phpbb/trunk@6015 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/index.php')
-rw-r--r-- | phpBB/index.php | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/phpBB/index.php b/phpBB/index.php index 81fe6aa356..862eb5234f 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -14,7 +14,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session management @@ -25,11 +25,11 @@ $user->setup('viewforum'); display_forums('', $config['load_moderators']); // Set some stats, get posts count from forums data if we... hum... retrieve all forums data -$total_posts = $config['num_posts']; -$total_topics = $config['num_topics']; -$total_users = $config['num_users']; -$newest_user = $config['newest_username']; -$newest_uid = $config['newest_user_id']; +$total_posts = $config['num_posts']; +$total_topics = $config['num_topics']; +$total_users = $config['num_users']; +$newest_user = $config['newest_username']; +$newest_uid = $config['newest_user_id']; $l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER'; $l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER'; @@ -45,7 +45,7 @@ $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { - $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . "{$phpbb_root_path}memberlist.$phpEx$SID" . '&mode=group&g=' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>'; + $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>'; } $db->sql_freeresult($result); @@ -56,16 +56,16 @@ 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']) . "%' + WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $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=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $row['username'] . '</a>'; + $birthday_list .= (($birthday_list != '') ? ', ' : '') . '<a' . $user_colour . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '">' . $row['username'] . '</a>'; - if ($age = (int)substr($row['user_birthday'], -4)) + if ($age = (int) substr($row['user_birthday'], -4)) { $birthday_list .= ' (' . ($now['year'] - $age) . ')'; } @@ -78,19 +78,19 @@ $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts), 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics), 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users), - 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$newest_uid \">", $newest_user, '</a>'), + 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $newest_uid) . '">', $newest_user, '</a>'), 'LEGEND' => $legend, 'BIRTHDAY_LIST' => $birthday_list, - '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'), + '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' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=login", + 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, - 'U_MARK_FORUMS' => "{$phpbb_root_path}index.$phpEx$SID&mark=forums", - 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=front" : '') + 'U_MARK_FORUMS' => append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums'), + 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '') ); // Output page |