$txt['theme_dir'] = 'Default Theme Directory'; $txt['theme_path_url_settings'] = 'Paths & URLs For Themes'; $txt['theme_path_url_settings_info'] = 'These are the paths and URLs to your SMF themes.'; // Fix Database title to use $db_type if available if (!empty($db_type) && isset($txt['db_' . $db_type])) { $txt['database_settings'] = $txt['db_' . $db_type] . ' ' . $txt['database_settings']; } //Remove this file, maybe? if (isset($_POST['remove_file'])) { @unlink(__FILE__); // Redirect to index.php. header('Location: http://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']) . dirname($_SERVER['PHP_SELF']) . '/index.php'); exit; } if (isset($_POST['submit'])) { set_settings(); } if (isset($_POST['remove_hooks'])) { remove_hooks(); } // try to find the smflogo: could be a .gif or a .png $smflogo = "Themes/default/images/smflogo.png"; if (!file_exists(dirname(__FILE__) . "/" . $smflogo)) { $smflogo = "Themes/default/images/smflogo.gif"; } // Note that we're using the default URLs because we aren't even going to try to use Settings.php's settings. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="robots" content="noindex" /> <title>', $context['is_legacy'] ? $txt['smf11_repair_settings'] : $txt['smf_repair_settings'], '</title>
{ $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (!socket_connect($sock, '127.0.0.1', '9110')) { print "couldn't connect\n"; exit; } $buf = json_encode($to_set); _str_send($sock, $buf . "\n"); _str_send($sock, "QUIT\n"); } $current_settings = get_settings(); // Copy over old settings to the new ones, such that if there is a field that doesn't change it gets sent over again. if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') { $new_settings = $current_settings; foreach ($_POST as $k => $v) { if ($v === "true") { $v = true; } else { if ($v === "false") { $v = false; } } $new_settings[$k] = $v; //FIXME. } set_settings($new_settings); $current_settings = get_settings(); } $current_status = get_status(); $p = array_merge($current_settings, $current_status); print json_encode($p) . "\n";