diff --git a/phpBB/admin/admin_board.php b/phpBB/admin/admin_board.php index bdba9b292d..0656654d77 100644 --- a/phpBB/admin/admin_board.php +++ b/phpBB/admin/admin_board.php @@ -530,7 +530,7 @@ switch ( $mode ) $auth_select = ''; foreach ( $auth_plugins as $method ) { - $selected = ( $board_config['auth_method'] == $method ) ? ' selected="selected"' : ''; + $selected = ( $config['auth_method'] == $method ) ? ' selected="selected"' : ''; $auth_select .= ''; } @@ -557,7 +557,7 @@ switch ( $mode ) // foreach( $config_fields as $field ) { - if ( !isset($board_config[$field]) ) + if ( !isset($config[$field]) ) { $sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('$field', '')"; diff --git a/phpBB/admin/admin_email.php b/phpBB/admin/admin_email.php index e8790017c5..41e3ca55cd 100644 --- a/phpBB/admin/admin_email.php +++ b/phpBB/admin/admin_email.php @@ -94,16 +94,16 @@ if ( isset($_POST['submit']) ) // Let's do some checking to make sure that mass mail functions // are working in win32 versions of php. // - if ( preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery']) + if ( preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$config['smtp_delivery']) { // We are running on windows, force delivery to use // our smtp functions since php's are broken by default - $board_config['smtp_delivery'] = 1; - $board_config['smtp_host'] = get_cfg_var('SMTP'); + $config['smtp_delivery'] = 1; + $config['smtp_host'] = get_cfg_var('SMTP'); } - $emailer = new emailer($board_config['smtp_delivery']); + $emailer = new emailer($config['smtp_delivery']); - $email_headers = 'From: ' . $board_config['board_email'] . "\n"; + $email_headers = 'From: ' . $config['board_email'] . "\n"; $bcc_list = ''; for($i = 0; $i < count($email_list); $i++) @@ -119,13 +119,13 @@ if ( isset($_POST['submit']) ) $email_headers .= 'X-AntiAbuse: User IP - ' . $user_ip . "\n"; $emailer->use_template('admin_send_email'); - $emailer->email_address($board_config['board_email']); + $emailer->email_address($config['board_email']); $emailer->set_subject($subject); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( - 'SITENAME' => $board_config['sitename'], - 'BOARD_EMAIL' => $board_config['board_email'], + 'SITENAME' => $config['sitename'], + 'BOARD_EMAIL' => $config['board_email'], 'MESSAGE' => $message) ); diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index 05d83d9139..7eec84da2e 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -530,12 +530,6 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
Powered by phpBB © 2002 phpBB Group
+Powered by phpBB © 2002 phpBB Group
diff --git a/phpBB/common.php b/phpBB/common.php index e871afb8ed..82b0a4cc99 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -130,6 +130,9 @@ define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch'); define('USER_GROUP_TABLE', $table_prefix.'user_group'); define('USERS_TABLE', $table_prefix.'users'); define('WORDS_TABLE', $table_prefix.'words'); +define('POLL_OPTIONS_TABLE', $table_prefix.'poll_results'); +define('POLL_VOTES_TABLE', $table_prefix.'poll_voters'); + define('VOTE_DESC_TABLE', $table_prefix.'vote_desc'); define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results'); define('VOTE_USERS_TABLE', $table_prefix.'vote_voters'); @@ -142,10 +145,10 @@ $template = new Template(); $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); // Obtain boardwide default config (rebuilding cache if reqd) -if ( empty($board_config) ) +if ( empty($config) ) { require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); - $board_config = config_config(); + $config = config_config(); } $sql = "SELECT * @@ -155,7 +158,7 @@ $result = $db->sql_query($sql, false); while ( $row = $db->sql_fetchrow($result) ) { - $board_config[$row['config_name']] = $row['config_value']; + $config[$row['config_name']] = $row['config_value']; } // Re-cache acl options if reqd @@ -171,9 +174,9 @@ $user = new user(); $auth = new auth(); // Show 'Board is disabled' message -if ( $board_config['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN') ) +if ( $config['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN') ) { - $message = ( !empty($board_config['board_disable_msg']) ) ? $board_config['board_disable_msg'] : 'Board_disable'; + $message = ( !empty($config['board_disable_msg']) ) ? $config['board_disable_msg'] : 'Board_disable'; trigger_error($message); } diff --git a/phpBB/config_cache.php b/phpBB/config_cache.php index 3d34b3d0cc..1b7d74852e 100644 --- a/phpBB/config_cache.php +++ b/phpBB/config_cache.php @@ -2,7 +2,7 @@ // phpBB cache file - DO NOT change anything in here by hand! -$board_config = array(); +$config = array(); $acl_options = array(); diff --git a/phpBB/groupcp.php b/phpBB/groupcp.php index a7d6f03646..ed477eaaad 100644 --- a/phpBB/groupcp.php +++ b/phpBB/groupcp.php @@ -29,10 +29,10 @@ include($phpbb_root_path . 'common.'.$phpEx); // function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$poster_avatar, &$profile_img, &$profile, &$search_img, &$search, &$pm_img, &$pm, &$email_img, &$email, &$www_img, &$www, &$icq_status_img, &$icq_img, &$icq, &$aim_img, &$aim, &$msn_img, &$msn, &$yim_img, &$yim) { - global $lang, $images, $board_config, $phpEx; + global $lang, $images, $config, $phpEx; $from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' '; - $joined = create_date($date_format, $row['user_regdate'], $board_config['board_timezone']); + $joined = create_date($date_format, $row['user_regdate'], $config['board_timezone']); $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0; $poster_avatar = ''; @@ -41,20 +41,20 @@ function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$ switch( $row['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: - $poster_avatar = ( $board_config['allow_avatar_upload'] ) ? ' ', "\n", "-- \n" . $board_config['board_email_sig']), + 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $config['board_email_sig']), 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id&validate=true") ); @@ -551,9 +551,9 @@ else if ( $group_id ) $group_name = $group_name_row['group_name']; include($phpbb_root_path . 'includes/emailer.'.$phpEx); - $emailer = new emailer($board_config['smtp_delivery']); + $emailer = new emailer($config['smtp_delivery']); - $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n"; + $email_headers = 'From: ' . $config['board_email'] . "\nReturn-Path: " . $config['board_email'] . "\r\n"; $emailer->use_template('group_added', $row['user_lang']); $emailer->email_address($row['user_email']); @@ -561,9 +561,9 @@ else if ( $group_id ) $emailer->extra_headers($email_headers); $emailer->assign_vars(array( - 'SITENAME' => $board_config['sitename'], + 'SITENAME' => $config['sitename'], 'GROUP_NAME' => $group_name, - 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $board_config['board_email_sig']), + 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $config['board_email_sig']), 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id") ); @@ -706,9 +706,9 @@ else if ( $group_id ) $group_name = $group_name_row['group_name']; include($phpbb_root_path . 'includes/emailer.'.$phpEx); - $emailer = new emailer($board_config['smtp_delivery']); + $emailer = new emailer($config['smtp_delivery']); - $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\nBcc: " . $email_addresses . "\r\n"; + $email_headers = 'From: ' . $config['board_email'] . "\nReturn-Path: " . $config['board_email'] . "\nBcc: " . $email_addresses . "\r\n"; $emailer->use_template('group_approved'); $emailer->email_address($user->data['user_email']); @@ -716,9 +716,9 @@ else if ( $group_id ) $emailer->extra_headers($email_headers); $emailer->assign_vars(array( - 'SITENAME' => $board_config['sitename'], + 'SITENAME' => $config['sitename'], 'GROUP_NAME' => $group_name, - 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $board_config['board_email_sig']), + 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $config['board_email_sig']), 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id") ); @@ -891,7 +891,7 @@ else if ( $group_id ) $username = $group_moderator['username']; $user_id = $group_moderator['user_id']; - generate_user_info($group_moderator, $board_config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim); + generate_user_info($group_moderator, $config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim); $template->assign_vars(array( 'L_GROUP_INFORMATION' => $lang['Group_Information'], @@ -976,12 +976,12 @@ else if ( $group_id ) // // Dump out the remaining users // - for($i = $start; $i < min($board_config['topics_per_page'] + $start, $members_count); $i++) + for($i = $start; $i < min($config['topics_per_page'] + $start, $members_count); $i++) { $username = $group_members[$i]['username']; $user_id = $group_members[$i]['user_id']; - generate_user_info($group_members[$i], $board_config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim); + generate_user_info($group_members[$i], $config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim); if ( $group_info['group_type'] != GROUP_HIDDEN || $is_group_member || $is_moderator ) { @@ -1038,11 +1038,11 @@ else if ( $group_id ) ); } - $current_page = ( !$members_count ) ? 1 : ceil( $members_count / $board_config['topics_per_page'] ); + $current_page = ( !$members_count ) ? 1 : ceil( $members_count / $config['topics_per_page'] ); $template->assign_vars(array( - 'PAGINATION' => generate_pagination("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id", $members_count, $board_config['topics_per_page'], $start), - 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), $current_page ), + 'PAGINATION' => generate_pagination("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id", $members_count, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $config['topics_per_page'] ) + 1 ), $current_page ), 'L_GOTO_PAGE' => $lang['Goto_page']) ); @@ -1074,7 +1074,7 @@ else if ( $group_id ) $username = $modgroup_pending_list[$i]['username']; $user_id = $modgroup_pending_list[$i]['user_id']; - generate_user_info($modgroup_pending_list[$i], $board_config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim); + generate_user_info($modgroup_pending_list[$i], $config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim); $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 0fc0973602..0111a4d446 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -26,7 +26,7 @@ if ( !defined('IN_PHPBB') ) define('BBCODE_UID_LEN', 10); -// global that holds loaded-and-prepared bbcode templates, so we only have to do +// global that holds loaded-and-prepared bbcode templates, so we only have to do // that stuff once. $bbcode_tpl = null; @@ -45,21 +45,21 @@ function load_bbcode_template() global $template; $tpl_filename = $template->make_filename('bbcode.html'); $tpl = fread(fopen($tpl_filename, 'r'), filesize($tpl_filename)); - + // replace \ with \\ and then ' with \'. $tpl = str_replace('\\', '\\\\', $tpl); $tpl = str_replace('\'', '\\\'', $tpl); - + // strip newlines. $tpl = str_replace("\n", '', $tpl); - + // Turn template blocks into PHP assignment statements for the values of $bbcode_tpls.. $tpl = preg_replace('#(.*?)#', "\n" . '$bbcode_tpls[\'\\1\'] = \'\\2\';', $tpl); - + $bbcode_tpls = array(); eval($tpl); - + return $bbcode_tpls; } @@ -68,7 +68,7 @@ function load_bbcode_template() * Prepares the loaded bbcode templates for insertion into preg_replace() * or str_replace() calls in the bbencode_second_pass functions. This * means replacing template placeholders with the appropriate preg backrefs - * or with language vars. NOTE: If you change how the regexps work in + * or with language vars. NOTE: If you change how the regexps work in * bbencode_second_pass(), you MUST change this function. * * Nathan Codding, Sept 26 2001 @@ -77,52 +77,52 @@ function load_bbcode_template() function prepare_bbcode_template($bbcode_tpl) { global $lang; - + $bbcode_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bbcode_tpl['olist_open']); - + $bbcode_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bbcode_tpl['color_open']); - + $bbcode_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bbcode_tpl['size_open']); - + $bbcode_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_open']); - + $bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_username_open']); $bbcode_tpl['quote_username_open'] = str_replace('{L_WROTE}', $lang['wrote'], $bbcode_tpl['quote_username_open']); $bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']); - + $bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['Code'], $bbcode_tpl['code_open']); $bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']); - + // We do URLs in several different ways.. $bbcode_tpl['url1'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['url']); $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1\\2', $bbcode_tpl['url1']); - + $bbcode_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']); $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']); - + $bbcode_tpl['url3'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['url']); $bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url3']); - + $bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']); $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url4']); $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']); - + define('BBCODE_TPL_READY', true); - + return $bbcode_tpl; } /** * Does second-pass bbencoding. This should be used before displaying the message in - * a thread. Assumes the message is already first-pass encoded, and we are given the + * a thread. Assumes the message is already first-pass encoded, and we are given the * correct UID as used in first-pass encoding. */ function bbencode_second_pass($text, $uid, $enable_img = true) { - global $acl, $board_config, $lang, $bbcode_tpl; + global $acl, $config, $lang, $bbcode_tpl; // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0). // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it. @@ -135,13 +135,13 @@ function bbencode_second_pass($text, $uid, $enable_img = true) $text = substr($text, 1); return $text; } - + // Only load the templates ONCE.. if (!defined('BBCODE_TPL_READY')) { // load templates from file into array. $bbcode_tpl = load_bbcode_template(); - + // prepare array for use in regexps. $bbcode_tpl = prepare_bbcode_template($bbcode_tpl); } @@ -171,7 +171,7 @@ function bbencode_second_pass($text, $uid, $enable_img = true) // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. $text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text); $text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text); - + // New one liner to deal with opening quotes with usernames... // replaces the two line version that I had here before.. $text = preg_replace("/\[quote:$uid=(?:\"?([^\"]*)\"?)\]/si", $bbcode_tpl['quote_username_open'], $text); @@ -199,7 +199,7 @@ function bbencode_second_pass($text, $uid, $enable_img = true) $patterns[0] = "#\[img:$uid\](.*?)\[/img:$uid\]#si"; $replacements[0] = $bbcode_tpl['img']; } - + // [url]xxxx://www.phpbb.com[/url] code.. $patterns[1] = "#\[url\]([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/url\]#si"; $replacements[1] = $bbcode_tpl['url1']; @@ -253,7 +253,7 @@ function bbencode_first_pass($text, $uid) // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. $text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, ''); - + $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\"[^"]*?\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]"); // [list] and [list=x] for (un)ordered lists. @@ -351,9 +351,9 @@ function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_ $open_tag[0] = $open_tag_temp; $open_tag_count = 1; } - + $open_is_regexp = false; - + if ($open_regexp_replace) { $open_is_regexp = true; @@ -364,12 +364,12 @@ function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_ $open_regexp_replace[0] = $open_regexp_temp; } } - + if ($mark_lowest_level && $open_is_regexp) { message_die(GENERAL_ERROR, "Unsupported operation for bbcode_first_pass_pda()."); } - + // Start at the 2nd char of the string, looking for opening tags. $curr_pos = 1; @@ -398,12 +398,12 @@ function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_ // // OK we are in a quote tag that probably contains a ] bracket. // Grab a bit more of the string to hopefully get all of it.. - // + // $possible_start = substr($text, $curr_pos, strpos($text, "\"]", $curr_pos + 1) - $curr_pos + 2); } // // Now compare, either using regexp or not. - + if ($open_is_regexp) { $match_result = array(); @@ -441,7 +441,7 @@ function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_ // Keeps error in nested tag from breaking out // of table structure.. // - $curr_pos = $curr_pos + strlen($possible_start); + $curr_pos = $curr_pos + strlen($possible_start); } else { @@ -574,12 +574,12 @@ function bbencode_second_pass_code($text, $uid, $bbcode_tpl) { $before_replace = $matches[1][$i]; $after_replace = $matches[1][$i]; - + // Replace 2 spaces with " " so non-tabbed code indents without making huge long lines. $after_replace = str_replace(" ", " ", $after_replace); // now Replace 2 spaces with " " to catch odd #s of spaces. $after_replace = str_replace(" ", " ", $after_replace); - + // Replace tabs with " " so tabbed code indents sorta right without making huge long lines. $after_replace = str_replace("\t", " ", $after_replace); @@ -740,7 +740,7 @@ function bbcode_array_pop(&$stack) // function smilies_pass($message) { - global $db, $board_config; + global $db, $config; static $smilies; if ( empty($smilies) ) @@ -749,7 +749,7 @@ function smilies_pass($message) FROM " . SMILIES_TABLE; $result = $db->sql_query($sql); - if ( !($smilies = $db->sql_fetchrowset($result)) ) + if ( !($smilies = $db->sql_fetchrowset($result)) ) { return $message; } @@ -760,7 +760,7 @@ function smilies_pass($message) for($i = 0; $i < count($smilies); $i++) { $orig[] = '/(?<=.\\W|\\W.|^\\W)' . preg_quote($smilies[$i]['code'], '/') . '(?=.\\W|\\W.|\\W$)/'; - $repl[] = ' '; $rules .= ( ( $auth->acl_get('f_reply', $forum_id) ) ? $user->lang['Rules_reply_can'] : $user->lang['Rules_reply_cannot'] ) . ' '; @@ -326,7 +326,7 @@ function language_select($default, $select_name = "language", $dirname="language { global $phpEx; - $dir = opendir($dirname); + $dir = @opendir($dirname); $user = array(); while ( $file = readdir($dir) ) @@ -338,10 +338,10 @@ function language_select($default, $select_name = "language", $dirname="language } } - closedir($dir); + @closedir($dir); - @asort($user); - @reset($user); + @asort($lang); + @reset($lang); $user_select = ' |