📄 acp_board.php
字号:
continue; } $type = explode(':', $vars['type']); $l_explain = ''; if ($vars['explain'] && isset($vars['lang_explain'])) { $l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain']; } else if ($vars['explain']) { $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : ''; } $template->assign_block_vars('options', array( 'KEY' => $config_key, 'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'], 'S_EXPLAIN' => $vars['explain'], 'TITLE_EXPLAIN' => $l_explain, 'CONTENT' => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars), ) ); unset($display_vars['vars'][$config_key]); } if ($mode == 'auth') { $template->assign_var('S_AUTH', true); foreach ($auth_plugins as $method) { if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx)) { $method = 'acp_' . $method; if (function_exists($method)) { $fields = $method($this->new_config); if ($fields['tpl']) { $template->assign_block_vars('auth_tpl', array( 'TPL' => $fields['tpl']) ); } unset($fields); } } } } } /** * Select auth method */ function select_auth_method($selected_method, $key = '') { global $phpbb_root_path, $phpEx; $auth_plugins = array(); $dp = opendir($phpbb_root_path . 'includes/auth'); while (($file = readdir($dp)) !== false) { if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file)) { $auth_plugins[] = preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file); } } sort($auth_plugins); $auth_select = ''; foreach ($auth_plugins as $method) { $selected = ($selected_method == $method) ? ' selected="selected"' : ''; $auth_select .= '<option value="' . $method . '"' . $selected . '>' . ucfirst($method) . '</option>'; } return $auth_select; } /** * Select mail authentication method */ function mail_auth_select($selected_method, $key = '') { global $user; $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'); $s_smtp_auth_options = ''; foreach ($auth_methods as $method) { $s_smtp_auth_options .= '<option value="' . $method . '"' . (($selected_method == $method) ? ' selected="selected"' : '') . '>' . $user->lang['SMTP_' . str_replace('-', '_', $method)] . '</option>'; } return $s_smtp_auth_options; } /** * Select full folder action */ function full_folder_select($value, $key = '') { global $user; return '<option value="1"' . (($value == 1) ? ' selected="selected"' : '') . '>' . $user->lang['DELETE_OLDEST_MESSAGES'] . '</option><option value="2"' . (($value == 2) ? ' selected="selected"' : '') . '>' . $user->lang['HOLD_NEW_MESSAGES_SHORT'] . '</option>'; } /** * Select ip validation */ function select_ip_check($value, $key = '') { $radio_ary = array(4 => 'ALL', 3 => 'CLASS_C', 2 => 'CLASS_B', 0 => 'NO_IP_VALIDATION'); return h_radio('config[ip_check]', $radio_ary, $value, $key); } /** * Select account activation method */ function select_acc_activation($value, $key = '') { global $user, $config; $radio_ary = array(USER_ACTIVATION_DISABLE => 'ACC_DISABLE', USER_ACTIVATION_NONE => 'ACC_NONE'); if ($config['email_enable']) { $radio_ary += array(USER_ACTIVATION_SELF => 'ACC_USER', USER_ACTIVATION_ADMIN => 'ACC_ADMIN'); } return h_radio('config[require_activation]', $radio_ary, $value, $key); } /** * Maximum/Minimum username length */ function username_length($value, $key = '') { global $user; return '<input id="' . $key . '" type="text" size="3" maxlength="3" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . ' <input type="text" size="3" maxlength="3" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS']; } /** * Allowed chars in usernames */ function select_username_chars($selected_value, $key) { global $user; $user_char_ary = array('USERNAME_CHARS_ANY' => '.*', 'USERNAME_ALPHA_ONLY' => '[\w]+', 'USERNAME_ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+'); $user_char_options = ''; foreach ($user_char_ary as $lang => $value) { $selected = ($selected_value == $value) ? ' selected="selected"' : ''; $user_char_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$lang] . '</option>'; } return $user_char_options; } /** * Maximum/Minimum password length */ function password_length($value, $key) { global $user; return '<input id="' . $key . '" type="text" size="3" maxlength="3" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . ' <input type="text" size="3" maxlength="3" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS']; } /** * Required chars in passwords */ function select_password_chars($selected_value, $key) { global $user; $pass_type_ary = array('PASS_TYPE_ANY' => '.*', 'PASS_TYPE_CASE' => '[a-zA-Z]', 'PASS_TYPE_ALPHA' => '[a-zA-Z0-9]', 'PASS_TYPE_SYMBOL' => '[a-zA-Z\W]'); $pass_char_options = ''; foreach ($pass_type_ary as $lang => $value) { $selected = ($selected_value == $value) ? ' selected="selected"' : ''; $pass_char_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$lang] . '</option>'; } return $pass_char_options; } /** * Select bump interval */ function bump_interval($value, $key) { global $user; $s_bump_type = ''; $types = array('m' => 'MINUTES', 'h' => 'HOURS', 'd' => 'DAYS'); foreach ($types as $type => $lang) { $selected = ($this->new_config['bump_type'] == $type) ? ' selected="selected"' : ''; $s_bump_type .= '<option value="' . $type . '"' . $selected . '>' . $user->lang[$lang] . '</option>'; } return '<input id="' . $key . '" type="text" size="3" maxlength="4" name="config[bump_interval]" value="' . $value . '" /> <select name="config[bump_type]">' . $s_bump_type . '</select>'; } /** * Board disable option and message */ function board_disable($value, $key) { global $user; $radio_ary = array(1 => 'YES', 0 => 'NO'); return h_radio('config[board_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $this->new_config['board_disable_msg'] . '" />'; } /** * Select default dateformat */ function dateformat_select($value, $key) { global $user; $dateformat_options = ''; foreach ($user->lang['dateformats'] as $format => $null) { $dateformat_options .= '<option value="' . $format . '"' . (($format == $value) ? ' selected="selected"' : '') . '>'; $dateformat_options .= $user->format_date(time(), $format, true) . ((strpos($format, '|') !== false) ? ' [' . $user->lang['RELATIVE_DAYS'] . ']' : ''); $dateformat_options .= '</option>'; } $dateformat_options .= '<option value="custom"'; if (!in_array($value, array_keys($user->lang['dateformats']))) { $dateformat_options .= ' selected="selected"'; } $dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>'; return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('$key').value = '$value'; } else { document.getElementById('$key').value = this.value; }\">$dateformat_options</select> <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />"; }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -