diff --git a/phpBB/download.php b/phpBB/download.php index 2ddbd42fe0..c681e5e3b6 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -21,7 +21,7 @@ $download_id = request_var('id', 0); $thumbnail = request_var('t', false); // Start session management -$user->start(); +$user->session_begin(); $auth->acl($user->data); $user->setup('viewtopic'); diff --git a/phpBB/faq.php b/phpBB/faq.php index fe54ab3384..a47751528f 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -16,7 +16,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'.$phpEx); // Start session management -$user->start(); +$user->session_begin(); $auth->acl($user->data); $user->setup(); diff --git a/phpBB/index.php b/phpBB/index.php index e01fdc6809..97bf667475 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -14,13 +14,13 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session management -$user->start(); +$user->session_begin(); $auth->acl($user->data); $user->setup(); -include($phpbb_root_path . 'includes/functions_display.' . $phpEx); display_forums('', $config['load_moderators']); // Set some stats, get posts count from forums data if we... hum... retrieve all forums data diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 4f8d7463ea..a3c065afc9 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -284,7 +284,7 @@ class module */ // Start session management -$user->start(); +$user->session_begin(); $auth->acl($user->data); $user->setup('mcp'); diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 36220b7f26..253907f070 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -16,7 +16,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'.$phpEx); // Start session management -$user->start(); +$user->session_begin(); $auth->acl($user->data); $user->setup(array('memberlist', 'groups')); @@ -56,7 +56,7 @@ $sort_dir = request_var('sd', 'a'); // Grab rank information for later $ranks = array(); -obtain_ranks($ranks); +$cache->obtain_ranks($ranks); // What do you want to do today? ... oops, I think that line is taken ... @@ -275,9 +275,6 @@ switch ($mode) case 'viewprofile': // Display a profile - $page_title = sprintf($user->lang['VIEWING_PROFILE'], $row['username']); - $template_html = 'memberlist_view.html'; - if ($user_id == ANONYMOUS) { trigger_error('NO_USER'); @@ -509,7 +506,12 @@ switch ($mode) $template->assign_block_vars('custom_fields', $field_data); } } - break; + + // Now generate page tilte + $page_title = sprintf($user->lang['VIEWING_PROFILE'], $member['username']); + $template_html = 'memberlist_view.html'; + + break; case 'email': // Send an email @@ -1136,7 +1138,6 @@ switch ($mode) ); } - // Output the page page_header($page_title); diff --git a/phpBB/posting.php b/phpBB/posting.php index 47d4e4547d..2c80ae7a79 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -16,11 +16,12 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); +include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . 'includes/message_parser.'.$phpEx); // Start session management -$user->start(); +$user->session_begin(); $auth->acl($user->data); @@ -915,7 +916,6 @@ if (!sizeof($error) && $preview) // Attachment Preview if (sizeof($message_parser->attachment_data)) { - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); $extensions = $update_count = array(); $template->assign_var('S_HAS_ATTACHMENTS', true); @@ -1631,15 +1631,18 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $db->sql_freeresult($result); } + $sql_insert_ary = array() for ($i = 0, $size = sizeof($poll['poll_options']); $i < $size; $i++) { if (trim($poll['poll_options'][$i])) { if (!$cur_poll_options[$i]) { - $sql = 'INSERT INTO ' . POLL_OPTIONS_TABLE . " (poll_option_id, topic_id, poll_option_text) - VALUES ($i, " . $data['topic_id'] . ", '" . $db->sql_escape($poll['poll_options'][$i]) . "')"; - $db->sql_query($sql); + $sql_insert_ary[] = array( + 'poll_option_id' => (int) $i, + 'topic_id' => (int) $data['topic_id'], + 'poll_option_text' => (string) $poll['poll_options'][$i] + ); } else if ($poll['poll_options'][$i] != $cur_poll_options[$i]) { @@ -1652,6 +1655,25 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } } + if (sizeof($sql_insert_ary)) + { + switch (SQL_LAYER) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + $db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_insert_ary); + break; + + default: + foreach ($sql_insert_ary as $ary) + { + $db->sql_query('INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_insert_ary)); + } + break; + } + } + if (sizeof($poll['poll_options']) < sizeof($cur_poll_options)) { $sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . ' diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index ac16b11e18..8422d226f2 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -17,7 +17,7 @@ include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session -$user->start(); +$user->session_begin(); $auth->acl($user->data); // Start initial var setup @@ -282,7 +282,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) // Grab icons $icons = array(); - obtain_icons($icons); + $cache->obtain_icons($icons); // Grab all topic data $rowset = $announcement_list = $topic_list = array(); diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index d93353236d..510ea827e1 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -16,7 +16,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'.$phpEx); // Start session management -$user->start(); +$user->session_begin(); $auth->acl($user->data); $user->setup(); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1eb4f7e988..7c83cedd46 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -14,9 +14,10 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session management -$user->start(); +$user->session_begin(); $auth->acl($user->data); // Initial var setup @@ -381,17 +382,17 @@ if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('b // Grab ranks $ranks = array(); -obtain_ranks($ranks); +$cache->obtain_ranks($ranks); // Grab icons $icons = array(); -obtain_icons($icons); +$cache->obtain_icons($icons); // Grab extensions $extensions = array(); if ($topic_attachment) { - obtain_attach_extensions($extensions); + $cache->obtain_attach_extensions($extensions); } // Forum rules listing @@ -974,8 +975,6 @@ if (sizeof($attach_list)) { if ($auth->acl_gets('f_download', 'u_download', $forum_id)) { - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); - $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' WHERE post_msg_id IN (' . implode(', ', $attach_list) . ') @@ -1247,7 +1246,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_PROFILE' => $user_cache[$poster_id]['profile'], 'U_SEARCH' => $user_cache[$poster_id]['search'], - 'U_PM' => ($poster_id != ANONYMOUS) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&action=quote&q=1&p=" . $row['post_id'] : '', + 'U_PM' => ($poster_id != ANONYMOUS) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&action=quotepost&p=" . $row['post_id'] : '', 'U_EMAIL' => $user_cache[$poster_id]['email'], 'U_WWW' => $user_cache[$poster_id]['www'], 'U_ICQ' => $user_cache[$poster_id]['icq'],