diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 1d3149c958..4d254bb084 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -194,14 +194,16 @@ class acp_email } } - // Initial selection - $sql = 'SELECT group_id, group_type, group_name - FROM ' . GROUPS_TABLE . ' - ORDER BY group_type DESC, group_name ASC'; + // Exclude bots... + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS'"; $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); $select_list = ''; - $select_list .= group_select_options($group_id); + $select_list .= group_select_options($group_id, array($bot_group_id)); $s_priority_options = ''; $s_priority_options .= ''; diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 9ca25c8cf7..f42a03ba15 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -861,14 +861,14 @@ class acp_permissions { foreach ($forum_ary as $auth_option => $user_ary) { - $perms += $user_ary; + $perms = array_merge($perms, $user_ary); } } if (sizeof($perms)) { $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' - WHERE zebra_id IN (' . implode(', ', $perms) . ') + WHERE zebra_id IN (' . implode(', ', array_unique($perms)) . ') AND foe = 1'; $db->sql_query($sql); } @@ -882,21 +882,21 @@ class acp_permissions { global $db, $template, $user, $auth; - $sql = 'SELECT username + $sql = 'SELECT user_id, username, user_type FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user_id; $result = $db->sql_query($sql); - $username = (string) $db->sql_fetchfield('username'); + $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$username) + if (!$user_row) { trigger_error('NO_USERS'); } $template->assign_vars(array( 'PERMISSION' => $user->lang['acl_' . $permission]['lang'], - 'PERMISSION_USERNAME' => $username) + 'PERMISSION_USERNAME' => $user_row['username']) ); $template->assign_block_vars('trace', array( @@ -990,9 +990,9 @@ class acp_permissions $total = ACL_NO; break; } - + $template->assign_block_vars('trace', array( - 'WHO' => $username, + 'WHO' => $user_row['username'], 'INFORMATION' => $information, 'S_SETTING_UNSET' => ($auth_setting == ACL_UNSET) ? true : false, @@ -1002,6 +1002,22 @@ class acp_permissions 'S_TOTAL_YES' => ($total == ACL_YES) ? true : false, 'S_TOTAL_NO' => ($total == ACL_NO) ? true : false) ); + + // Take founder status into account, overwriting the default values + if ($user_row['user_type'] == USER_FOUNDER && strpos($permission, 'a_') === 0) + { + $template->assign_block_vars('trace', array( + 'WHO' => $user_row['username'], + 'INFORMATION' => $user->lang['TRACE_USER_FOUNDER'], + + 'S_SETTING_UNSET' => ($auth_setting == ACL_UNSET) ? true : false, + 'S_SETTING_YES' => ($auth_setting == ACL_YES) ? true : false, + 'S_SETTING_NO' => ($auth_setting == ACL_NO) ? true : false, + 'S_TOTAL_UNSET' => false, + 'S_TOTAL_YES' => true, + 'S_TOTAL_NO' => false) + ); + } } } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 75ac50cdcb..7e0601d1dc 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1302,6 +1302,10 @@ class acp_users $filename = ''; $type = $width = $height = 0; } + else + { + $data = array(); + } } if (!sizeof($error)) diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 7e31bea815..da19cfde4d 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -132,78 +132,79 @@ define('FIELD_DATE', 6); // Additional constants -// Table names - do not set if in installation -if (defined('IN_INSTALL')) +// Table names - only set if not in installation +if (!defined('IN_INSTALL')) { - return; + // Table names + define('ACL_GROUPS_TABLE', $table_prefix . 'auth_groups'); + define('ACL_OPTIONS_TABLE', $table_prefix . 'auth_options'); + define('ACL_ROLES_TABLE', $table_prefix . 'auth_roles'); + define('ACL_ROLES_DATA_TABLE', $table_prefix . 'auth_roles_data'); + define('ACL_USERS_TABLE', $table_prefix . 'auth_users'); + define('ATTACHMENTS_TABLE', $table_prefix . 'attachments'); + define('BANLIST_TABLE', $table_prefix . 'banlist'); + define('BBCODES_TABLE', $table_prefix . 'bbcodes'); + define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks'); + define('BOTS_TABLE', $table_prefix . 'bots'); + define('CACHE_TABLE', $table_prefix . 'cache'); + define('CONFIG_TABLE', $table_prefix . 'config'); + define('CONFIRM_TABLE', $table_prefix . 'confirm'); + define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields'); + define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang'); + define('PROFILE_DATA_TABLE', $table_prefix . 'profile_fields_data'); + define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang'); + define('DISALLOW_TABLE', $table_prefix . 'disallow'); + define('DRAFTS_TABLE', $table_prefix . 'drafts'); + define('EXTENSIONS_TABLE', $table_prefix . 'extensions'); + define('EXTENSION_GROUPS_TABLE', $table_prefix . 'extension_groups'); + define('FORUMS_TABLE', $table_prefix . 'forums'); + define('FORUMS_ACCESS_TABLE', $table_prefix . 'forum_access'); + define('FORUMS_TRACK_TABLE', $table_prefix . 'forums_marking'); + define('FORUMS_WATCH_TABLE', $table_prefix . 'forums_watch'); + define('GROUPS_TABLE', $table_prefix . 'groups'); + define('ICONS_TABLE', $table_prefix . 'icons'); + define('LANG_TABLE', $table_prefix . 'lang'); + define('LOG_TABLE', $table_prefix . 'log'); + define('MODERATOR_TABLE', $table_prefix . 'moderator_cache'); + define('MODULES_TABLE', $table_prefix . 'modules'); + define('POSTS_TABLE', $table_prefix . 'posts'); + define('PRIVMSGS_TABLE', $table_prefix . 'privmsgs'); + define('PRIVMSGS_TO_TABLE', $table_prefix . 'privmsgs_to'); + define('PRIVMSGS_FOLDER_TABLE', $table_prefix . 'privmsgs_folder'); + define('PRIVMSGS_RULES_TABLE', $table_prefix . 'privmsgs_rules'); + define('RANKS_TABLE', $table_prefix . 'ranks'); + define('RATINGS_TABLE', $table_prefix . 'ratings'); + define('REPORTS_TABLE', $table_prefix . 'reports'); + define('REASONS_TABLE', $table_prefix . 'reports_reasons'); + define('SEARCH_TABLE', $table_prefix . 'search_results'); + define('SEARCH_WORD_TABLE', $table_prefix . 'search_wordlist'); + define('SEARCH_MATCH_TABLE', $table_prefix . 'search_wordmatch'); + define('SESSIONS_TABLE', $table_prefix . 'sessions'); + define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys'); + define('SITELIST_TABLE', $table_prefix . 'sitelist'); + define('SMILIES_TABLE', $table_prefix . 'smilies'); + define('STYLES_TABLE', $table_prefix . 'styles'); + define('STYLES_TPL_TABLE', $table_prefix . 'styles_template'); + define('STYLES_TPLDATA_TABLE', $table_prefix . 'styles_template_data'); + define('STYLES_CSS_TABLE', $table_prefix . 'styles_theme'); + define('STYLES_IMAGE_TABLE', $table_prefix . 'styles_imageset'); + define('TOPICS_TABLE', $table_prefix . 'topics'); + define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted'); + define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch'); + define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_marking'); + define('USER_GROUP_TABLE', $table_prefix . 'user_group'); + define('USERS_TABLE', $table_prefix . 'users'); + define('USERS_NOTES_TABLE', $table_prefix . 'users_notes'); + define('WARNINGS_TABLE', $table_prefix . 'warnings'); + define('WORDS_TABLE', $table_prefix . 'words'); + define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_results'); + define('POLL_VOTES_TABLE', $table_prefix . 'poll_voters'); + define('ZEBRA_TABLE', $table_prefix . 'zebra'); + + // Additional tables + + + // Additional tables end } -// Table names -define('ACL_GROUPS_TABLE', $table_prefix.'auth_groups'); -define('ACL_OPTIONS_TABLE', $table_prefix.'auth_options'); -define('ACL_ROLES_TABLE', $table_prefix.'auth_roles'); -define('ACL_ROLES_DATA_TABLE', $table_prefix.'auth_roles_data'); -define('ACL_USERS_TABLE', $table_prefix.'auth_users'); -define('ATTACHMENTS_TABLE', $table_prefix.'attachments'); -define('BANLIST_TABLE', $table_prefix.'banlist'); -define('BBCODES_TABLE', $table_prefix.'bbcodes'); -define('BOOKMARKS_TABLE', $table_prefix.'bookmarks'); -define('BOTS_TABLE', $table_prefix.'bots'); -define('CACHE_TABLE', $table_prefix.'cache'); -define('CONFIG_TABLE', $table_prefix.'config'); -define('CONFIRM_TABLE', $table_prefix.'confirm'); -define('PROFILE_FIELDS_TABLE', $table_prefix.'profile_fields'); -define('PROFILE_LANG_TABLE', $table_prefix.'profile_lang'); -define('PROFILE_DATA_TABLE', $table_prefix.'profile_fields_data'); -define('PROFILE_FIELDS_LANG_TABLE', $table_prefix.'profile_fields_lang'); -define('DISALLOW_TABLE', $table_prefix.'disallow'); // -define('DRAFTS_TABLE', $table_prefix.'drafts'); -define('EXTENSIONS_TABLE', $table_prefix.'extensions'); -define('EXTENSION_GROUPS_TABLE', $table_prefix.'extension_groups'); -define('FORUMS_TABLE', $table_prefix.'forums'); -define('FORUMS_ACCESS_TABLE', $table_prefix.'forum_access'); -define('FORUMS_TRACK_TABLE', $table_prefix.'forums_marking'); -define('FORUMS_WATCH_TABLE', $table_prefix.'forums_watch'); -define('GROUPS_TABLE', $table_prefix.'groups'); -define('ICONS_TABLE', $table_prefix.'icons'); -define('LANG_TABLE', $table_prefix.'lang'); -define('LOG_TABLE', $table_prefix.'log'); -define('MODERATOR_TABLE', $table_prefix.'moderator_cache'); -define('MODULES_TABLE', $table_prefix . 'modules'); -define('POSTS_TABLE', $table_prefix.'posts'); -define('PRIVMSGS_TABLE', $table_prefix.'privmsgs'); -define('PRIVMSGS_TO_TABLE', $table_prefix.'privmsgs_to'); -define('PRIVMSGS_FOLDER_TABLE', $table_prefix.'privmsgs_folder'); -define('PRIVMSGS_RULES_TABLE', $table_prefix.'privmsgs_rules'); -define('RANKS_TABLE', $table_prefix.'ranks'); -define('RATINGS_TABLE', $table_prefix.'ratings'); -define('REPORTS_TABLE', $table_prefix.'reports'); -define('REASONS_TABLE', $table_prefix.'reports_reasons'); -define('SEARCH_TABLE', $table_prefix.'search_results'); -define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist'); -define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch'); -define('SESSIONS_TABLE', $table_prefix.'sessions'); -define('SESSIONS_KEYS_TABLE', $table_prefix.'sessions_keys'); -define('SITELIST_TABLE', $table_prefix.'sitelist'); -define('SMILIES_TABLE', $table_prefix.'smilies'); -define('STYLES_TABLE', $table_prefix.'styles'); -define('STYLES_TPL_TABLE', $table_prefix.'styles_template'); -define('STYLES_TPLDATA_TABLE', $table_prefix.'styles_template_data'); -define('STYLES_CSS_TABLE', $table_prefix.'styles_theme'); -define('STYLES_IMAGE_TABLE', $table_prefix.'styles_imageset'); -define('TOPICS_TABLE', $table_prefix.'topics'); -define('TOPICS_POSTED_TABLE', $table_prefix.'topics_posted'); -define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch'); -define('TOPICS_TRACK_TABLE', $table_prefix.'topics_marking'); -define('USER_GROUP_TABLE', $table_prefix.'user_group'); -define('USERS_TABLE', $table_prefix.'users'); -define('USERS_NOTES_TABLE', $table_prefix.'users_notes'); -define('WARNINGS_TABLE', $table_prefix.'warnings'); -define('WORDS_TABLE', $table_prefix.'words'); -define('POLL_OPTIONS_TABLE', $table_prefix.'poll_results'); -define('POLL_VOTES_TABLE', $table_prefix.'poll_voters'); -define('ZEBRA_TABLE', $table_prefix.'zebra'); - -// Additional tables - ?> \ No newline at end of file diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 83e08a9d9a..4ccdc1b3ec 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -141,8 +141,8 @@ function unique_id($extra = 'c') $val = $config['rand_seed'] . microtime(); $val = md5($val); $config['rand_seed'] = md5($config['rand_seed'] . $val . $extra); - - if($dss_seeded !== true) + + if ($dss_seeded !== true) { set_config('rand_seed', $config['rand_seed']); $dss_seeded = true; @@ -2194,7 +2194,12 @@ function msg_handler($errno, $msg_text, $errfile, $errline) echo '

General Error

'; echo '

' . $msg_text . '

'; - echo '

Please notify the board administrator or webmaster : ' . $config['board_contact'] . '

'; + + if (!empty($config['board_contact'])) + { + echo '

Please notify the board administrator or webmaster : ' . $config['board_contact'] . '

'; + } + echo ' '; echo ' '; echo ' '; @@ -2597,7 +2602,7 @@ function page_footer() $db->sql_report('display'); } - $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off' ) . ' | Load : ' . (($user->load) ? $user->load : 'N/A'), $totaltime); + $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) { diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index b64e2b2ad0..3292e9a43f 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -396,7 +396,13 @@ function generate_forum_rules(&$forum_data) */ function generate_forum_nav(&$forum_data) { - global $db, $user, $template, $phpEx, $SID, $phpbb_root_path; + global $db, $user, $template, $auth; + global $phpEx, $SID, $phpbb_root_path; + + if (!$auth->acl_get('f_list', $forum_data['forum_id'])) + { + return; + } // Get forum parents $forum_parents = get_forum_parents($forum_data); @@ -406,6 +412,12 @@ function generate_forum_nav(&$forum_data) { list($parent_name, $parent_type) = array_values($parent_data); + // Skip this parent if the user does not have the permission to view it + if (!$auth->acl_get('f_list', $parent_forum_id)) + { + continue; + } + $template->assign_block_vars('navlinks', array( 'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false, 'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false, @@ -575,7 +587,7 @@ function get_moderators(&$forum_moderators, $forum_id = false) */ function gen_forum_auth_level($mode, $forum_id, $forum_status) { - global $SID, $template, $auth, $user; + global $SID, $template, $auth, $user, $config; $locked = ($forum_status == ITEM_LOCKED && !$auth->acl_get('m_edit', $forum_id)) ? true : false; @@ -584,9 +596,13 @@ function gen_forum_auth_level($mode, $forum_id, $forum_status) ($auth->acl_get('f_reply', $forum_id) && !$locked) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'], ($auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'], ($auth->acl_gets('f_delete', 'm_delete', $forum_id) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'], - ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach') && !$locked) ? $user->lang['RULES_ATTACH_CAN'] : $user->lang['RULES_ATTACH_CANNOT'] ); + if ($config['allow_attachments']) + { + $rules[] = ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach') && !$locked) ? $user->lang['RULES_ATTACH_CAN'] : $user->lang['RULES_ATTACH_CANNOT']; + } + foreach ($rules as $rule) { $template->assign_block_vars('rules', array('RULE' => $rule)); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 03f1c962ee..904a56d090 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -810,10 +810,10 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $poster = $row['username']; // Handle anon users posting with usernames - if ($poster_id == ANONYMOUS && $row['post_username']) + if ($poster_id == ANONYMOUS) { - $poster = $row['post_username']; - $poster_rank = $user->lang['GUEST']; + $poster = ($row['post_username']) ? $row['post_username'] : $user->lang['GUEST']; + $poster_rank = ($row['post_username']) ? $user->lang['GUEST'] : ''; } $post_subject = $row['post_subject']; diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index b94d873a88..59cf1715a4 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -93,6 +93,11 @@ class mcp_queue // Set some vars $poster = ($post_info['user_colour']) ? '' . $post_info['username'] . '' : $post_info['username']; + if ($post_info['user_id'] == ANONYMOUS) + { + $poster = ($post_info['post_username']) ? $post_info['post_username'] : $user->lang['GUEST']; + } + // Process message, leave it uncensored $message = $post_info['post_text']; if ($post_info['bbcode_bitfield']) @@ -112,7 +117,7 @@ class mcp_queue 'S_POST_LOCKED' => $post_info['post_edit_locked'], 'S_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? true : false, - 'U_VIEW_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'], + 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'] : '', 'U_MCP_USER_NOTES' => "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'], 'U_MCP_WARN_USER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $post_info['user_id'], 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '', diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 9b43b4d43c..1fc21ffc8b 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -196,7 +196,7 @@ class fulltext_mysql extends search_backend for ($i = 0, $n = sizeof($text); $i < $n; $i++) { $text[$i] = trim($text[$i]); - if (strlen($text[$i]) < $config['fulltext_mysql_min_word_len'] || strlen($text[$i]) > $this->config['fulltext_mysql_max_word_len']) + if (strlen($text[$i]) < $config['fulltext_mysql_min_word_len'] || strlen($text[$i]) > $config['fulltext_mysql_max_word_len']) { unset($text[$i]); } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 88a7c6563c..3ea20541ab 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -139,16 +139,28 @@ class session $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : ''; // Load limit check (if applicable) - if (@file_exists('/proc/loadavg') && @is_readable('/proc/loadavg')) + if ($config['limit_load']) { - if ($load = @file_get_contents('/proc/loadavg')) + if (@file_exists('/proc/loadavg') && @is_readable('/proc/loadavg')) { - $this->load = floatval(array_slice(explode(' ', $load), 0, 1)); - - if ($config['limit_load'] && $this->load > floatval($config['limit_load'])) + if ($load = @file_get_contents('/proc/loadavg')) { - trigger_error('BOARD_UNAVAILABLE'); + $this->load = array_slice(explode(' ', $load), 0, 1); + $this->load = floatval($this->load[0]); + + if ($config['limit_load'] && $this->load > floatval($config['limit_load'])) + { + trigger_error('BOARD_UNAVAILABLE'); + } } + else + { + set_config('limit_load', '0'); + } + } + else + { + set_config('limit_load', '0'); } } @@ -1075,7 +1087,7 @@ class user extends session { global $SID; - if (strpos($this->page['page_query'], 'mode=reg_details') !== false && $this->page['page_name'] == "ucp.$phpEx") + if (strpos($this->page['query_string'], 'mode=reg_details') !== false && $this->page['page_name'] == "ucp.$phpEx") { redirect("ucp.$phpEx$SID&i=profile&mode=reg_details"); } diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 4f87ba8983..d8a131d09f 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -565,6 +565,10 @@ class ucp_profile $filename = ''; $type = $width = $height = 0; } + else + { + $data = array(); + } } if (!sizeof($error)) diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index e061aa590c..1b42030839 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -70,8 +70,7 @@ class ucp_zebra $db->sql_freeresult($result); $add = array_diff($add, $friends, $foes, array($user->data['username'])); - unset($friends); - unset($foes); + unset($friends, $foes); $add = implode(', ', preg_replace('#^[\s]*?(.*?)[\s]*?$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", $add)); @@ -102,10 +101,12 @@ class ucp_zebra { foreach ($forum_ary as $auth_option => $user_ary) { - $perms += $user_ary; + $perms = array_merge($perms, $user_ary); } } + $perms = array_unique($perms); + // This may not be right ... it may yield true when perms equate to deny $user_id_ary = array_diff($user_id_ary, $perms); unset($perms); @@ -115,32 +116,33 @@ class ucp_zebra { $sql_mode = ($mode == 'friends') ? 'friend' : 'foe'; - switch (SQL_LAYER) + $sql_ary = array(); + foreach ($user_id_ary as $zebra_id) { - case 'mysql': - $sql = 'INSERT INTO ' . ZEBRA_TABLE . " (user_id, zebra_id, $sql_mode) - VALUES " . implode(', ', preg_replace('#^([0-9]+)$#', '(' . $user->data['user_id'] . ", \\1, 1)", $user_id_ary)); - $db->sql_query($sql); + $sql_ary[] = array( + 'user_id' => $user->data['user_id'], + 'zebra_id' => (int) $zebra_id, + $sql_mode => 1 + ); + } + + if (sizeof($sql_ary)) + { + switch (SQL_LAYER) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + $db->sql_query('INSERT INTO ' . ZEBRA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); break; - case 'mysql4': - case 'mysqli': - case 'mssql': - case 'mssql_odbc': - case 'sqlite': - $sql = 'INSERT INTO ' . ZEBRA_TABLE . " (user_id, zebra_id, $sql_mode) - VALUES " . implode(' UNION ALL ', preg_replace('#^([0-9]+)$#', '(' . $user->data['user_id'] . ", \\1, 1)", $user_id_ary)); - $db->sql_query($sql); - break; - - default: - foreach ($user_id_ary as $zebra_id) - { - $sql = 'INSERT INTO ' . ZEBRA_TABLE . " (user_id, zebra_id, $sql_mode) - VALUES (" . $user->data['user_id'] . ", $zebra_id, 1)"; - $db->sql_query($sql); - } + default: + foreach ($sql_ary as $ary) + { + $db->sql_query('INSERT INTO ' . ZEBRA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); + } break; + } } } else diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 1ce066aac4..5915712c62 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -145,6 +145,7 @@ $lang = array_merge($lang, array( 'TRACE_GROUP_YES_TOTAL_YES' => 'This group\'s permission is set to YES, and the total permission is already set to YES, so the total result is kept.', 'TRACE_PERMISSION' => 'Trace permission - %s', 'TRACE_SETTING' => 'Trace setting', + 'TRACE_USER_FOUNDER' => 'The user has the founder type set, therefore admin permissions are set to YES by default.', 'TRACE_USER_KEPT' => 'The user permission is UNSET so the old total value is kept.', 'TRACE_USER_NO_TOTAL_NO' => 'The user permission is set to no and the total value is set to no, so nothing is changed.', 'TRACE_USER_NO_TOTAL_UNSET' => 'The user permission is set to no which becomes the total value because it wasn\'t set yet.', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 88c50c7858..377415c221 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -573,88 +573,88 @@ $lang = array_merge($lang, array( ), 'tz' => array( - '-12' => 'GMT - 12 hours', - '-11' => 'GMT - 11 hours', - '-10' => 'GMT - 10 hours', - '-9.5' => 'GMT - 9:30 hours', - '-9' => 'GMT - 9 hours', - '-8' => 'GMT - 8 hours', - '-7' => 'GMT - 7 hours', - '-6' => 'GMT - 6 hours', - '-5' => 'GMT - 5 hours', - '-4' => 'GMT - 4 hours', - '-3.5' => 'GMT - 3:30 hours', - '-3' => 'GMT - 3 hours', - '-2' => 'GMT - 2 hours', - '-1' => 'GMT - 1 hour', - '0' => 'GMT', - '1' => 'GMT + 1 hour', - '2' => 'GMT + 2 hours', - '3' => 'GMT + 3 hours', - '3.5' => 'GMT + 3:30 hours', - '4' => 'GMT + 4 hours', - '4.5' => 'GMT + 4:30 hours', - '5' => 'GMT + 5 hours', - '5.5' => 'GMT + 5:30 hours', - '5.75' => 'GMT + 5:45 hours', - '6' => 'GMT + 6 hours', - '6.5' => 'GMT + 6:30 hours', - '7' => 'GMT + 7 hours', - '8' => 'GMT + 8 hours', - '8.75' => 'GMT + 8:45 hours', - '9' => 'GMT + 9 hours', - '9.5' => 'GMT + 9:30 hours', - '10' => 'GMT + 10 hours', - '10.5' => 'GMT + 10:30 hours', - '11' => 'GMT + 11 hours', - '11.5' => 'GMT + 11:30 hours', - '12' => 'GMT + 12 hours', - '12.75' => 'GMT + 12:45 hours', - '13' => 'GMT + 13 hours', - '14' => 'GMT + 14 hours', + '-12' => 'UTC - 12 hours', + '-11' => 'UTC - 11 hours', + '-10' => 'UTC - 10 hours', + '-9.5' => 'UTC - 9:30 hours', + '-9' => 'UTC - 9 hours', + '-8' => 'UTC - 8 hours', + '-7' => 'UTC - 7 hours', + '-6' => 'UTC - 6 hours', + '-5' => 'UTC - 5 hours', + '-4' => 'UTC - 4 hours', + '-3.5' => 'UTC - 3:30 hours', + '-3' => 'UTC - 3 hours', + '-2' => 'UTC - 2 hours', + '-1' => 'UTC - 1 hour', + '0' => 'UTC', + '1' => 'UTC + 1 hour', + '2' => 'UTC + 2 hours', + '3' => 'UTC + 3 hours', + '3.5' => 'UTC + 3:30 hours', + '4' => 'UTC + 4 hours', + '4.5' => 'UTC + 4:30 hours', + '5' => 'UTC + 5 hours', + '5.5' => 'UTC + 5:30 hours', + '5.75' => 'UTC + 5:45 hours', + '6' => 'UTC + 6 hours', + '6.5' => 'UTC + 6:30 hours', + '7' => 'UTC + 7 hours', + '8' => 'UTC + 8 hours', + '8.75' => 'UTC + 8:45 hours', + '9' => 'UTC + 9 hours', + '9.5' => 'UTC + 9:30 hours', + '10' => 'UTC + 10 hours', + '10.5' => 'UTC + 10:30 hours', + '11' => 'UTC + 11 hours', + '11.5' => 'UTC + 11:30 hours', + '12' => 'UTC + 12 hours', + '12.75' => 'UTC + 12:45 hours', + '13' => 'UTC + 13 hours', + '14' => 'UTC + 14 hours', 'dst' => '[ DST ]', ), 'tz_zones' => array( - '-12' => '[GMT-12] Eniwetok, Kwaialein', - '-11' => '[GMT-11] Midway Island, Samoa', - '-10' => '[GMT-10] Hawaii, Honolulu', - '-9.5' => '[GMT-9:30] Marquesas Is.', - '-9' => '[GMT-9] Alaska, Anchorage', - '-8' => '[GMT-8] Los Angeles, San Francisco, Seattle', - '-7' => '[GMT-7] Denver, Edmonton, Phoenix, Salt Lake City, Santa Fe', - '-6' => '[GMT-6] Chicago, Guatemala, Mexico City, Saskatchewan East', - '-5' => '[GMT-5] Bogota, Kingston, Lima, New York', - '-4' => '[GMT-4] Caracas, Labrador, La Paz, Maritimes, Santiago', - '-3.5' => '[GMT-3:30] Standard Time [Canada], Newfoundland', - '-3' => '[GMT-3] Brazilia, Buenos Aires, Georgetown, Rio de Janero', - '-2' => '[GMT-2] Mid-Atlantic', - '-1' => '[GMT-1] Azores, Cape Verde Is.', - '0' => '[GMT] Dublin, Edinburgh, Iceland, Lisbon, London, Casablanca', - '1' => '[GMT+1] Amsterdam, Berlin, Bern, Brussells, Madrid, Paris, Rome, Oslo, Vienna', - '2' => '[GMT+2] Athens, Bucharest, Harare, Helsinki, Israel, Istanbul', - '3' => '[GMT+3] Ankara, Baghdad, Bahrain, Beruit, Kuwait, Moscow, Nairobi, Riyadh', - '3.5' => '[GMT+3:30] Iran', - '4' => '[GMT+4] Abu Dhabi, Kabul, Muscat, Tbilisi, Volgograd', - '4.5' => '[GMT+4:30] Afghanistan', - '5' => '[GMT+5] Pakistan', - '5.5' => '[GMT+5:30] Calcutta, India, Madras, New Dehli', - '5.75' => '[GMT+5:45] Kathmandu, Nepal', - '6' => '[GMT+6] Almaty, Dhakar, Sri Lanka', - '6.5' => '[GMT+6:30] Rangoon', - '7' => '[GMT+7] Bangkok, Hanoi, Jakarta, Phnom Penh', - '8' => '[GMT+8] Beijing, Hong Kong, Kuala Lumpar, Manila, Perth, Singapore, Taipei', - '8.75' => '[GMT+8:45] Caiguna, Eucla', - '9' => '[GMT+9] Osaka, Sapporo, Seoul, Tokyo, Yakutsk', - '9.5' => '[GMT+9:30] Adelaide, Darwin', - '10' => '[GMT+10] Brisbane, Canberra, Guam, Hobart, Melbourne, Port Moresby, Sydney', - '10.5' => '[GMT+10:30] Lord Howe Is.', - '11' => '[GMT+11] Magadan, New Caledonia, Solomon Is.', - '11.5' => '[GMT+11:30] Norfolk Is.', - '12' => '[GMT+12] Auckland, Fiji, Kamchatka, Marshall Is., Suva, Wellington', - '12.75' => '[GMT+12:45] Chatham Is.', - '13' => '[GMT+13] Tonga, Phoenix Is.', - '14' => '[GMT+14] Line Is.', + '-12' => '[UTC - 12, Y] Baker Island Time', + '-11' => '[UTC - 11, X] Niue Time, Samoa Standard Time', + '-10' => '[UTC - 10, W] Hawaii-Aleutian Standard Time, Cook Island Time', + '-9.5' => '[UTC - 9:30, V*] Marquesas Islands Time', + '-9' => '[UTC - 9, V] Alaska Standard Time, Gambier Island Time', + '-8' => '[UTC - 8, U] Pacific Standard Time', + '-7' => '[UTC - 7, T] Mountain Standard Time', + '-6' => '[UTC - 6, S] Central Standard Time', + '-5' => '[UTC - 5, R] Eastern Standard Time', + '-4' => '[UTC - 4, Q] Atlantic Standard Time', + '-3.5' => '[UTC - 3:30, P*] Newfoundland Standard Time', + '-3' => '[UTC - 3, P] Amazon Standard Time, Central Greenland Time', + '-2' => '[UTC - 2, O] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time', + '-1' => '[UTC - 1, N] Azores Standard Time, Cape Verde Time, Eastern Greenland Time', + '0' => '[UTC, Z] Western European Time, Greenwich Mean Time', + '1' => '[UTC + 1, A] Central European Time, West African Time', + '2' => '[UTC + 2, B] Eastern European Time, Central African Time', + '3' => '[UTC + 3, C] Moscow Standard Time, Eastern African Time', + '3.5' => '[UTC + 3:30, C*] Iran Standard Time', + '4' => '[UTC + 4, D] Gulf Standard Time, Samara Standard Time', + '4.5' => '[UTC + 4:30, D*] Afghanistan Time', + '5' => '[UTC + 5, E] Pakistan Standard Time, Yekaterinburg Standard Time', + '5.5' => '[UTC + 5:30, E*] Indian Standard Time, Sri Lanka Time', + '5.75' => '[UTC + 5:45, E‡] Nepal Time', + '6' => '[UTC + 6, F] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time', + '6.5' => '[UTC + 6:30, F*] Cocos Islands Time, Myanmar Time', + '7' => '[UTC + 7, G] Indochina Time, Krasnoyarsk Standard Time', + '8' => '[UTC + 8, H] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time', + '8.75' => '[UTC + 8:45, H‡] Southeastern Western Australia Standard Time', + '9' => '[UTC + 9, I] Japan Standard Time, Korea Standard Time, Chita Standard Time', + '9.5' => '[UTC + 9:30, I*] Australian Central Standard Time', + '10' => '[UTC + 10, K] Australian Eastern Standard Time, Vladivostok Standard Time', + '10.5' => '[UTC + 10:30, K*] Lord Howe Standard Time', + '11' => '[UTC + 11, L] Solomon Island Time, Magadan Standard Time', + '11.5' => '[UTC + 11:30, L*] Norfolk Island Time', + '12' => '[UTC + 12, M] New Zealand Time, Fiji Time, Kamchatka Standard Time', + '12.75' => '[UTC + 12:45, M‡] Chatham Islands Time', + '13' => '[UTC + 13, M*] Tonga Time, Phoenix Islands Time', + '14' => '[UTC + 14, M†] Line Island Time', ), // The value is only an example and will get replaced by the current time on view diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index 204fb91adf..09155f5b03 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -82,10 +82,11 @@ $lang = array_merge($lang, array( 'JABBER' => 'Jabber', - 'LAST_ACTIVE' => 'Last active', - 'LESS_THAN' => 'Less than', - 'LIST_USER' => '1 User', - 'LIST_USERS' => '%d Users', + 'LAST_ACTIVE' => 'Last active', + 'LESS_THAN' => 'Less than', + 'LIST_USER' => '1 User', + 'LIST_USERS' => '%d Users', + 'LOGIN_EXPLAIN_LEADERS' => 'The board administrator requires you to be registered and logged in to view the team listing.', 'LOGIN_EXPLAIN_VIEWPROFILE' => 'The board administrator requires you to be registered and logged in to view profiles.', 'MORE_THAN' => 'More than', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 692c43a3fe..3ff773ab20 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -39,7 +39,7 @@ $lang = array_merge($lang, array( 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)', 'BBCODE_A_HELP' => 'Close all open bbCode tags', - 'BBCODE_B_HELP' => 'Bold text: [b]text[/b] (alt+b)', + 'BBCODE_B_HELP' => 'Bold text: [b]text[/b] \' (alt+b)', 'BBCODE_C_HELP' => 'Code display: [code]code[/code] (alt+c)', 'BBCODE_E_HELP' => 'List: Add list element', 'BBCODE_F_HELP' => 'Font size: [size=x-small]small text[/size]', diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php index b211fc82bf..b1ee86a42a 100644 --- a/phpBB/language/en/viewtopic.php +++ b/phpBB/language/en/viewtopic.php @@ -29,7 +29,8 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ATTACHMENT' => 'Attachment', + 'ATTACHMENT' => 'Attachment', + 'ATTACHMENT_FUNCTIONALITY_DISABLED' => 'Attachment has been disabled', 'BOOKMARK_ADDED' => 'Bookmarked Topic successfully.', 'BOOKMARK_REMOVED' => 'Removed Bookmarked Topic successfully.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b2a3e2a29c..99ba5fd8f5 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -929,14 +929,21 @@ switch ($mode) $pagination_url = "{$phpbb_root_path}memberlist.$phpEx$SID"; // Build a relevant pagination_url - $global_var = ($submit) ? '_POST' : '_GET'; - foreach ($$global_var as $key => $var) + foreach (array('_POST', '_GET') as $global_var) { - if (in_array($key, array('submit', 'start', 'mode')) || !$var) + foreach ($$global_var as $key => $var) { - continue; + if ($global_var == '_POST') + { + unset($_GET[$key]); + } + + if (in_array($key, array('submit', 'start', 'mode')) || !$var) + { + continue; + } + $pagination_url .= '&' . $key . '=' . urlencode(htmlspecialchars($var)); } - $pagination_url .= '&' . $key . '=' . urlencode(htmlspecialchars($var)); } $u_hide_find_member = $pagination_url; diff --git a/phpBB/posting.php b/phpBB/posting.php index 12566f6c7f..09b4ddeca3 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -529,7 +529,7 @@ if ($submit || $preview || $refresh) $message_parser->message = request_var('message', '', true); $username = (isset($_POST['username'])) ? request_var('username', '', true) : $username; - $post_edit_reason = (isset($_POST['edit_reason']) && !empty($_POST['edit_reason']) && $mode == 'edit' && $user->data['user_id'] != $poster_id) ? request_var('edit_reason', '', true) : ''; + $post_edit_reason = (!empty($_POST['edit_reason']) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? request_var('edit_reason', '', true) : ''; $topic_type = (isset($_POST['topic_type'])) ? (int) $_POST['topic_type'] : (($mode != 'post') ? $topic_type : POST_NORMAL); $topic_time_limit = (isset($_POST['topic_time_limit'])) ? (int) $_POST['topic_time_limit'] : (($mode != 'post') ? $topic_time_limit : 0); @@ -1156,11 +1156,11 @@ $template->assign_vars(array( 'U_VIEWTOPIC' => ($mode != 'post') ? "viewtopic.$phpEx$SID&$forum_id&t=$topic_id" : '', 'U_PROGRESS_BAR' => "posting.$phpEx$SID&f=$forum_id&mode=popup", // do NOT replace & with & here - 'S_PRIVMSGS' => false, - 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), - 'S_EDIT_POST' => ($mode == 'edit'), - 'S_EDIT_REASON' => ($mode == 'edit' && $user->data['user_id'] != $poster_id), - 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_username)), + 'S_PRIVMSGS' => false, + 'S_CLOSE_PROGRESS_WINDOW' => (isset($_POST['add_file'])) ? true : false, + 'S_EDIT_POST' => ($mode == 'edit') ? true : false, + 'S_EDIT_REASON' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, + 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_username)) ? true : false, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $topic_last_post_id && $poster_id == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))), 'S_BBCODE_ALLOWED' => $bbcode_status, @@ -1532,16 +1532,16 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u { case 'post': $sql_data[TOPICS_TABLE]['sql'] = array( - 'topic_poster' => (int) $user->data['user_id'], - 'topic_time' => $current_time, - 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], - 'icon_id' => $data['icon_id'], - 'topic_approved' => ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, - 'topic_title' => $subject, - 'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? stripslashes($username) : $user->data['username'], - 'topic_type' => $topic_type, - 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, - 'topic_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0 + 'topic_poster' => (int) $user->data['user_id'], + 'topic_time' => $current_time, + 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], + 'icon_id' => $data['icon_id'], + 'topic_approved' => ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, + 'topic_title' => $subject, + 'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? stripslashes($username) : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), + 'topic_type' => $topic_type, + 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, + 'topic_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0 ); if (isset($poll['poll_options']) && !empty($poll['poll_options'])) @@ -1638,7 +1638,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_last_post_id' => $data['post_id'], 'topic_last_post_time' => $current_time, 'topic_last_poster_id' => (int) $user->data['user_id'], - 'topic_last_poster_name'=> (!$user->data['is_registered'] && $username) ? stripslashes($username) : $user->data['username'] + 'topic_last_poster_name'=> (!$user->data['is_registered'] && $username) ? stripslashes($username) : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '') ); } diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index 2e9cb623f1..308c26a906 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -11,7 +11,7 @@ {L_REPORTER}: - {REPORTER_NAME}   [ {L_READ_PROFILE} | {L_VIEW_NOTES} | {L_WARN_USER} ] + {REPORTER_NAME}   [ {L_READ_PROFILE} | {L_VIEW_NOTES} | {L_WARN_USER} ] {L_REPORTED}: @@ -47,7 +47,7 @@ {L_POSTER}: - {POSTER_NAME}   [ {L_READ_PROFILE} | {L_VIEW_NOTES} | {L_WARN_USER} ] + {POSTER_NAME}   [ {L_READ_PROFILE} | {L_VIEW_NOTES} | {L_WARN_USER} ] diff --git a/phpBB/styles/subSilver/template/ucp_profile_avatar.html b/phpBB/styles/subSilver/template/ucp_profile_avatar.html index cc4d28cea8..7ae30a7d63 100644 --- a/phpBB/styles/subSilver/template/ucp_profile_avatar.html +++ b/phpBB/styles/subSilver/template/ucp_profile_avatar.html @@ -67,9 +67,12 @@ + + {S_HIDDEN_FIELDS}   + \ No newline at end of file diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index dd26190e07..1351948d28 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -57,6 +57,9 @@ if ($view && !$post_id) if (!$forum_id) { + // Setup user environment so we can process lang string + $user->setup('viewtopic'); + trigger_error('NO_TOPIC'); } } @@ -111,6 +114,9 @@ if ($view && !$post_id) if (!$row) { + // Setup user environment so we can process lang string + $user->setup('viewtopic'); + $message = ($view == 'next') ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS'; trigger_error($message); } @@ -121,6 +127,9 @@ if ($view && !$post_id) // Check for global announcement correctness? if (!$row['forum_id'] && !$forum_id) { + // Setup user environment so we can process lang string + $user->setup('viewtopic'); + trigger_error('NO_TOPIC'); } else if ($row['forum_id']) @@ -133,6 +142,9 @@ if ($view && !$post_id) // Check for global announcement correctness? if ((!isset($row) || !$row['forum_id']) && !$forum_id) { + // Setup user environment so we can process lang string + $user->setup('viewtopic'); + trigger_error('NO_TOPIC'); } else if (isset($row) && $row['forum_id']) @@ -211,6 +223,10 @@ if (!($topic_data = $db->sql_fetchrow($result))) { redirect("viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"); } + + // Setup user environment so we can process lang string + $user->setup('viewtopic'); + trigger_error('NO_TOPIC'); }