diff options
| author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:38 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:38 +0100 |
| commit | 5324afeffd84810db3cac6e1d8dfec3678ab99c6 (patch) | |
| tree | 35c93b2056006be40f9e4660cedd52d45eb6d342 /phpBB/includes | |
| parent | 0434ccf303e1313e0b157012da9fb8ded26e886b (diff) | |
| parent | 4ff33f5d49597e5168223cf17b0d595b4df3b8da (diff) | |
| download | forums-5324afeffd84810db3cac6e1d8dfec3678ab99c6.tar forums-5324afeffd84810db3cac6e1d8dfec3678ab99c6.tar.gz forums-5324afeffd84810db3cac6e1d8dfec3678ab99c6.tar.bz2 forums-5324afeffd84810db3cac6e1d8dfec3678ab99c6.tar.xz forums-5324afeffd84810db3cac6e1d8dfec3678ab99c6.zip | |
Merge commit 'release-3.0.1'
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 8 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_board.php | 6 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_database.php | 1 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 48 | ||||
| -rw-r--r-- | phpBB/includes/functions_user.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/session.php | 17 |
7 files changed, 65 insertions, 21 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index d6f32bda53..c60f453238 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -99,9 +99,13 @@ class acp_attachments $display_vars = array( 'title' => 'ACP_ATTACHMENT_SETTINGS', 'vars' => array( - 'img_max_width' => false, 'img_max_height' => false, 'img_link_width' => false, 'img_link_height' => false, - 'legend1' => 'ACP_ATTACHMENT_SETTINGS', + + 'img_max_width' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'img_max_height' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'img_link_width' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'img_link_height' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'wpath', 'type' => 'text:25:100', 'explain' => true), diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index c1e94000db..1b7ae383cc 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -102,7 +102,11 @@ class acp_board 'title' => 'ACP_AVATAR_SETTINGS', 'vars' => array( 'legend1' => 'ACP_AVATAR_SETTINGS', - 'avatar_min_height' => false, 'avatar_min_width' => false, 'avatar_max_height' => false, 'avatar_max_width' => false, + + 'avatar_min_width' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'avatar_min_height' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'avatar_max_width' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), 'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 62331fbca2..1600aa266d 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -341,6 +341,7 @@ class acp_database break; case 'postgres': + $delim = ";\n"; while (($sql = $fgetd($fp, $delim, $read, $seek, $eof)) !== false) { $query = trim($sql); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index e61df309b3..1baa7abd9a 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2945,7 +2945,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) { if (@extension_loaded('zlib') && !headers_sent()) { - ob_flush(); + @ob_flush(); } } @@ -3116,8 +3116,8 @@ function obtain_guest_count($forum_id = 0) $reading_sql = ''; } $time = (time() - (intval($config['load_online_time']) * 60)); - - // Get number of online guests + + // Get number of online guests if ($db->sql_layer === 'sqlite') { @@ -3215,7 +3215,7 @@ function obtain_users_online($forum_id = 0) */ function obtain_users_online_string($online_users, $forum_id = 0) { - global $db, $user, $auth; + global $config, $db, $user, $auth; $user_online_link = $online_userlist = ''; @@ -3256,34 +3256,45 @@ function obtain_users_online_string($online_users, $forum_id = 0) { $online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist; } - else + else if ($config['load_online_guests']) { $l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_FORUM_GUEST'] : $user->lang['BROWSING_FORUM_GUESTS']; $online_userlist = sprintf($l_online, $online_userlist, $online_users['guests_online']); } - + else + { + $online_userlist = sprintf($user->lang['BROWSING_FORUM'], $online_userlist); + } // Build online listing $vars_online = array( - 'ONLINE' => array('total_online', 'l_t_user_s'), - 'REG' => array('visible_online', 'l_r_user_s'), - 'HIDDEN' => array('hidden_online', 'l_h_user_s'), - 'GUEST' => array('guests_online', 'l_g_user_s') + 'ONLINE' => array('total_online', 'l_t_user_s', 0), + 'REG' => array('visible_online', 'l_r_user_s', !$config['load_online_guests']), + 'HIDDEN' => array('hidden_online', 'l_h_user_s', $config['load_online_guests']), + 'GUEST' => array('guests_online', 'l_g_user_s', 0) ); foreach ($vars_online as $l_prefix => $var_ary) { + if ($var_ary[2]) + { + $l_suffix = '_AND'; + } + else + { + $l_suffix = ''; + } switch ($online_users[$var_ary[0]]) { case 0: - ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL']; + ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL' . $l_suffix]; break; case 1: - ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL']; + ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL' . $l_suffix]; break; default: - ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL']; + ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL' . $l_suffix]; break; } } @@ -3292,7 +3303,13 @@ function obtain_users_online_string($online_users, $forum_id = 0) $l_online_users = sprintf($l_t_user_s, $online_users['total_online']); $l_online_users .= sprintf($l_r_user_s, $online_users['visible_online']); $l_online_users .= sprintf($l_h_user_s, $online_users['hidden_online']); - $l_online_users .= sprintf($l_g_user_s, $online_users['guests_online']); + + if ($config['load_online_guests']) + { + $l_online_users .= sprintf($l_g_user_s, $online_users['guests_online']); + } + + return array( 'online_userlist' => $online_userlist, @@ -3645,6 +3662,9 @@ function exit_handler() } } + // As a pre-caution... some setups display a blank page if the flush() is not there. + @flush(); + exit; } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 55cf45505e..1d1a24389c 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -182,7 +182,7 @@ function user_add($user_row, $cp_data = false) 'user_timezone' => $config['board_timezone'], 'user_dateformat' => $config['default_dateformat'], 'user_lang' => $config['default_lang'], - 'user_style' => $config['default_style'], + 'user_style' => (int) $config['default_style'], 'user_allow_pm' => 1, 'user_actkey' => '', 'user_ip' => '', diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index e1820aa7ce..a1b8de2c98 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -164,7 +164,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $sql = "SELECT t.*$read_tracking_select FROM " . TOPICS_TABLE . " t $read_tracking_join - WHERE " . $db->sql_in_set('t.topic_id', $topic_list); + WHERE " . $db->sql_in_set('t.topic_id', $topic_list, false, true); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -389,7 +389,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) return; } - $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 382f76aca3..da54a6c512 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -311,9 +311,24 @@ class session $sql_ary['session_forum_id'] = $this->page['forum']; } + $db->sql_return_on_error(true); + $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE session_id = '" . $db->sql_escape($this->session_id) . "'"; - $db->sql_query($sql); + $result = $db->sql_query($sql); + + $db->sql_return_on_error(false); + + // If the database is not yet updated, there will be an error due to the session_forum_id + // @todo REMOVE for 3.0.2 + if ($result === false) + { + unset($sql_ary['session_forum_id']); + + $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE session_id = '" . $db->sql_escape($this->session_id) . "'"; + $db->sql_query($sql); + } } $this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false; |
