'.$options['admin_email'].'.'); $form = array_map('trim', $_POST['form']); if ($form['board_title'] == '') message('You must enter a board title.'); require 'include/email.php'; $form['admin_email'] = strtolower($form['admin_email']); if (!is_valid_email($form['admin_email'])) message('The admin e-mail address you entered is invalid.'); $form['webmaster_email'] = strtolower($form['webmaster_email']); if (!is_valid_email($form['webmaster_email'])) message('The webmaster e-mail address you entered is invalid.'); if ($form['mailing_list'] != '') $form['mailing_list'] = strtolower(preg_replace('/[\s]/', '', $form['mailing_list'])); // Make sure all newlines are \n and not \r\n or \r if ($form['rules_message'] != '') $form['rules_message'] = str_replace("\r", "\n", str_replace("\r\n", "\n", $form['rules_message'])); if ($form['rules'] == '1' && $form['rules_message'] == '') $form['rules'] = '0'; // Make sure base_url doesn't end with a slash if (substr($form['base_url'], -1) == '/') $form['base_url'] = substr($form['base_url'], 0, -1); // Make sure avatars_dir doesn't end with a slash if (substr($form['avatars_dir'], -1) == '/') $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1); if ($form['maintenance_message'] != '') $form['maintenance_message'] = str_replace("\r", "\n", str_replace("\r\n", "\n", $form['maintenance_message'])); else $form['maintenance_message'] = 'The forums are temporarily down for maintenance. Please try again in a few minutes.\n\n/Administrator'; foreach ($form as $key => $input) { $value = ($input != '') ? $value = '\''.escape($input).'\'' : 'NULL'; $temp[] = $key.'='.$value; } $db->query('UPDATE '.$db->prefix.'options SET '.implode(',', $temp)) or error('Unable to update options', __FILE__, __LINE__, $db->error()); redirect('admin_options.php', 'Options updated. Redirecting ...'); } $page_title = htmlspecialchars($options['board_title']).' / Admin / Options'; $validate_form = true; $form_name = 'update_options'; require 'header.php'; admin_menu('options'); ?>