mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Altered layout of phpbb_config table
git-svn-id: file:///svn/phpbb/trunk@1010 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -36,114 +36,60 @@ if(!$result = $db->sql_query($sql))
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$board_config[$row['config_var_name']] = stripslashes($row['config_var_value']);
|
||||
$config_name = $row['config_name'];
|
||||
$config_value = $row['config_value'];
|
||||
$default_config[$config_name] = $config_value;
|
||||
|
||||
$new[$config_name] = (isset($HTTP_POST_VARS[$config_name])) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
|
||||
|
||||
if($HTTP_POST_VARS['submit'])
|
||||
{
|
||||
$sql = "UPDATE " . CONFIG_TABLE . " SET
|
||||
config_value = '".$new[$config_name]."'
|
||||
WHERE config_name = '$config_name'";
|
||||
if( !$db->sql_query($sql) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$default_config = $db->sql_fetchrow($result);
|
||||
}
|
||||
|
||||
$sitename = (isset($HTTP_POST_VARS['sitename'])) ? $HTTP_POST_VARS['sitename'] : $default_config['sitename'];
|
||||
$require_activation = (isset($HTTP_POST_VARS['require_activation'])) ? $HTTP_POST_VARS['require_activation'] : $default_config['require_activation'];
|
||||
$flood_interval = (isset($HTTP_POST_VARS['flood_interval'])) ? $HTTP_POST_VARS['flood_interval'] : $default_config['flood_interval'];
|
||||
$topics_per_page = (isset($HTTP_POST_VARS['topics_per_page'])) ? $HTTP_POST_VARS['topics_per_page'] : $default_config['topics_per_page'];
|
||||
$posts_per_page = (isset($HTTP_POST_VARS['posts_per_page'])) ? $HTTP_POST_VARS['posts_per_page'] : $default_config['posts_per_page'];
|
||||
$hot_topic = (isset($HTTP_POST_VARS['hot_topic'])) ? $HTTP_POST_VARS['hot_topic'] : $default_config['hot_threshold'];
|
||||
$selected_template = (isset($HTTP_POST_VARS['template'])) ? $HTTP_POST_VARS['template'] : $default_config['sys_template'];
|
||||
$template_select = template_select($selected_template, "../templates");
|
||||
$theme = (isset($HTTP_POST_VARS['theme'])) ? $HTTP_POST_VARS['theme'] : $default_config['default_theme'];
|
||||
$theme_select = theme_select($theme);
|
||||
$language = (isset($HTTP_POST_VARS['language'])) ? $HTTP_POST_VARS['language'] : $default_config['default_lang'];
|
||||
$lang_select = language_select($language, "../language");
|
||||
$timezone = (isset($HTTP_POST_VARS['timezone'])) ? intval($HTTP_POST_VARS['timezone']) : $default_config['system_timezone'];
|
||||
$timezone_select = tz_select($timezone);
|
||||
$date_format = (isset($HTTP_POST_VARS['date_format'])) ? $HTTP_POST_VARS['date_format'] : $default_config['default_dateformat'];
|
||||
$gzip = (isset($HTTP_POST_VARS['gzip'])) ? $HTTP_POST_VARS['gzip'] : $default_config['gzip_compress'];
|
||||
$prune = (isset($HTTP_POST_VARS['prune'])) ? $HTTP_POST_VARS['prune'] : $default_config['prune_enable'];
|
||||
$allow_html = (isset($HTTP_POST_VARS['allow_html'])) ? $HTTP_POST_VARS['allow_html'] : $default_config['allow_html'];
|
||||
$allow_bbcode = (isset($HTTP_POST_VARS['allow_bbcode'])) ? $HTTP_POST_VARS['allow_bbcode'] : $default_config['allow_bbcode'];
|
||||
$allow_smile = (isset($HTTP_POST_VARS['allow_smile'])) ? $HTTP_POST_VARS['allow_smile'] : $default_config['allow_smilies'];
|
||||
$allow_sig = (isset($HTTP_POST_VARS['allow_sig'])) ? $HTTP_POST_VARS['allow_sig'] : $default_config['allow_sig'];
|
||||
$allow_namechange = (isset($HTTP_POST_VARS['allow_namechange'])) ? $HTTP_POST_VARS['allow_namechange'] : $default_config['allow_namechange'];
|
||||
$allow_avatars_local = (isset($HTTP_POST_VARS['allow_avatars_local'])) ? $HTTP_POST_VARS['allow_avatars_local'] : $default_config['allow_avatar_local'];
|
||||
$allow_avatars_remote = (isset($HTTP_POST_VARS['allow_avatars_remote'])) ? $HTTP_POST_VARS['allow_avatars_remote'] : $default_config['allow_avatar_remote'];
|
||||
$allow_avatars_upload = (isset($HTTP_POST_VARS['allow_avatars_upload'])) ? $HTTP_POST_VARS['allow_avatars_upload'] : $default_config['allow_avatar_upload'];
|
||||
$avatar_filesize = (isset($HTTP_POST_VARS['avatar_filesize'])) ? $HTTP_POST_VARS['avatar_filesize'] : $default_config['avatar_filesize'];
|
||||
$avatar_height = (isset($HTTP_POST_VARS['avatar_height'])) ? $HTTP_POST_VARS['avatar_height'] : $default_config['avatar_max_height'];
|
||||
$avatar_width = (isset($HTTP_POST_VARS['avatar_width'])) ? $HTTP_POST_VARS['avatar_width'] : $default_config['avatar_max_width'];
|
||||
$avatar_path = (isset($HTTP_POST_VARS['avatar_path'])) ? $HTTP_POST_VARS['avatar_path'] : $default_config['avatar_path'];
|
||||
$admin_email = (isset($HTTP_POST_VARS['admin_email'])) ? $HTTP_POST_VARS['admin_email'] : $default_config['board_email_from'];
|
||||
$email_sig = (isset($HTTP_POST_VARS['email_sig'])) ? $HTTP_POST_VARS['email_sig'] : $default_config['board_email'];
|
||||
$use_smtp = (isset($HTTP_POST_VARS['use_smtp'])) ? $HTTP_POST_VARS['use_smtp'] : $default_config['smtp_delivery'];
|
||||
$smtp_server = (isset($HTTP_POST_VARS['smtp_server'])) ? $HTTP_POST_VARS['smtp_server'] : $default_config['smtp_host'];
|
||||
|
||||
$html_yes = ($allow_html) ? "checked=\"checked\"" : "";
|
||||
$html_no = (!$allow_html) ? "checked=\"checked\"" : "";
|
||||
$bbcode_yes = ($allow_bbcode) ? "checked=\"checked\"" : "";
|
||||
$bbcode_no = (!$allow_bbcode) ? "checked=\"checked\"" : "";
|
||||
$activation_yes = ($require_activation) ? "checked=\"checked\"" : "";
|
||||
$activation_no = (!$require_activation) ? "checked=\"checked\"" : "";
|
||||
$gzip_yes = ($gzip) ? "checked=\"checked\"" : "";
|
||||
$gzip_no = (!$gzip) ? "checked=\"checked\"" : "";
|
||||
$smile_yes = ($allow_smile) ? "checked=\"checked\"" : "";
|
||||
$smile_no = (!$allow_smile) ? "checked=\"checked\"" : "";
|
||||
$sig_yes = ($allow_sig) ? "checked=\"checked\"" : "";
|
||||
$sig_no = (!$allow_sig) ? "checked=\"checked\"" : "";
|
||||
$namechange_yes = ($allow_namechange) ? "checked=\"checked\"" : "";
|
||||
$namechange_no = (!$allow_namechange) ? "checked=\"checked\"" : "";
|
||||
$avatars_local_yes = ($allow_avatars_local) ? "checked=\"checked\"" : "";
|
||||
$avatars_local_no = (!$allow_avatars_local) ? "checked=\"checked\"" : "";
|
||||
$avatars_remote_yes = ($allow_avatars_remote) ? "checked=\"checked\"" : "";
|
||||
$avatars_remote_no = (!$allow_avatars_remote) ? "checked=\"checked\"" : "";
|
||||
$avatars_upload_yes = ($allow_avatars_upload) ? "checked=\"checked\"" : "";
|
||||
$avatars_upload_no = (!$allow_avatars_upload) ? "checked=\"checked\"" : "";
|
||||
$smtp_yes = ($use_smtp) ? "checked=\"checked\"" : "";
|
||||
$smtp_no = (!$use_smtp) ? "checked=\"checked\"" : "";
|
||||
|
||||
if($HTTP_POST_VARS['submit'])
|
||||
{
|
||||
$sql = "UPDATE " . CONFIG_TABLE . " SET
|
||||
sitename = '$sitename',
|
||||
allow_html = $allow_html,
|
||||
allow_bbcode = $allow_bbcode,
|
||||
allow_smilies = $allow_smile,
|
||||
allow_sig = $allow_sig,
|
||||
allow_namechange = $allow_namechange,
|
||||
allow_avatar_local = $allow_avatars_local,
|
||||
allow_avatar_remote = $allow_avatars_remote,
|
||||
allow_avatar_upload = $allow_avatars_upload,
|
||||
posts_per_page = $posts_per_page,
|
||||
topics_per_page = $topics_per_page,
|
||||
hot_threshold = $hot_topic,
|
||||
email_sig = '$email_sig',
|
||||
email_from = '$admin_email',
|
||||
smtp_delivery = $use_smtp,
|
||||
smtp_host = '$smtp_server',
|
||||
require_activation = $require_activation,
|
||||
flood_interval = $flood_interval,
|
||||
avatar_filesize = $avatar_filesize,
|
||||
avatar_max_width = $avatar_width,
|
||||
avatar_max_height = $avatar_height,
|
||||
avatar_path = '$avatar_path',
|
||||
default_theme = $theme,
|
||||
default_lang = '$language',
|
||||
default_dateformat = '$date_format',
|
||||
system_timezone = $timezone,
|
||||
sys_template = '$selected_template',
|
||||
gzip_compress = $gzip,
|
||||
prune_enable = $prune";
|
||||
|
||||
if( !$db->sql_query($sql) )
|
||||
if($HTTP_POST_VARS['submit'])
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Failed to update general configuration", "", __LINE__, __FILE__, $sql);
|
||||
message_die(GENERAL_MESSAGE, $lang['Config_updated']);
|
||||
}
|
||||
|
||||
message_die(GENERAL_MESSAGE, $lang['Config_updated']);
|
||||
}
|
||||
|
||||
$template_select = template_select($new['board_template'], 'board_template', "../templates");
|
||||
$theme_select = theme_select($new['default_theme'], 'default_theme');
|
||||
$lang_select = language_select($new['default_lang'], 'default_lang', "../language");
|
||||
$timezone_select = tz_select($new['board_timezone'], 'board_timezone');
|
||||
|
||||
$html_yes = ($new['allow_html']) ? "checked=\"checked\"" : "";
|
||||
$html_no = (!$new['allow_html']) ? "checked=\"checked\"" : "";
|
||||
$bbcode_yes = ($new['allow_bbcode']) ? "checked=\"checked\"" : "";
|
||||
$bbcode_no = (!$new['allow_bbcode']) ? "checked=\"checked\"" : "";
|
||||
$activation_yes = ($new['require_activation']) ? "checked=\"checked\"" : "";
|
||||
$activation_no = (!$new['require_activation']) ? "checked=\"checked\"" : "";
|
||||
$gzip_yes = ($new['gzip_compress']) ? "checked=\"checked\"" : "";
|
||||
$gzip_no = (!$new['gzip_compress']) ? "checked=\"checked\"" : "";
|
||||
$smile_yes = ($new['allow_smilies']) ? "checked=\"checked\"" : "";
|
||||
$smile_no = (!$new['allow_smilies']) ? "checked=\"checked\"" : "";
|
||||
$sig_yes = ($new['allow_sig']) ? "checked=\"checked\"" : "";
|
||||
$sig_no = (!$new['allow_sig']) ? "checked=\"checked\"" : "";
|
||||
$namechange_yes = ($new['allow_namechange']) ? "checked=\"checked\"" : "";
|
||||
$namechange_no = (!$new['allow_namechange']) ? "checked=\"checked\"" : "";
|
||||
$avatars_local_yes = ($new['allow_avatar_local']) ? "checked=\"checked\"" : "";
|
||||
$avatars_local_no = (!$new['allow_avatar_local']) ? "checked=\"checked\"" : "";
|
||||
$avatars_remote_yes = ($new['allow_avatar_remote']) ? "checked=\"checked\"" : "";
|
||||
$avatars_remote_no = (!$new['allow_avatar_remote']) ? "checked=\"checked\"" : "";
|
||||
$avatars_upload_yes = ($new['allow_avatar_upload']) ? "checked=\"checked\"" : "";
|
||||
$avatars_upload_no = (!$new['allow_avatar_upload']) ? "checked=\"checked\"" : "";
|
||||
$smtp_yes = ($new['smtp_delivery']) ? "checked=\"checked\"" : "";
|
||||
$smtp_no = (!$new['smtp_delivery']) ? "checked=\"checked\"" : "";
|
||||
|
||||
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/admin_config_body.tpl")
|
||||
@@ -151,18 +97,18 @@ $template->set_filenames(array(
|
||||
|
||||
$template->assign_vars(array(
|
||||
"S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"),
|
||||
"SITENAME" => $sitename,
|
||||
"SITENAME" => $new['sitename'],
|
||||
"ACTIVATION_YES" => $activation_yes,
|
||||
"ACTIVATION_NO" => $activation_no,
|
||||
"FLOOD_INTERVAL" => $flood_interval,
|
||||
"TOPICS_PER_PAGE" => $topics_per_page,
|
||||
"POSTS_PER_PAGE" => $posts_per_page,
|
||||
"HOT_TOPIC" => $hot_topic,
|
||||
"FLOOD_INTERVAL" => $new['flood_interval'],
|
||||
"TOPICS_PER_PAGE" => $new['topics_per_page'],
|
||||
"POSTS_PER_PAGE" => $new['posts_per_page'],
|
||||
"HOT_TOPIC" => $new['hot_threshold'],
|
||||
"TEMPLATE_SELECT" => $template_select,
|
||||
"THEME_SELECT" => $theme_select,
|
||||
"LANG_SELECT" => $lang_select,
|
||||
"L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'],
|
||||
"DATE_FORMAT" => $date_format,
|
||||
"DEFAULT_DATEFORMAT" => $new['default_dateformat'],
|
||||
"TIMEZONE_SELECT" => $timezone_select,
|
||||
"GZIP_YES" => $gzip_yes,
|
||||
"GZIP_NO" => $gzip_no,
|
||||
@@ -182,19 +128,19 @@ $template->assign_vars(array(
|
||||
"AVATARS_REMOTE_NO" => $avatars_remote_no,
|
||||
"AVATARS_UPLOAD_YES" => $avatars_upload_yes,
|
||||
"AVATARS_UPLOAD_NO" => $avatars_upload_no,
|
||||
"AVATAR_FILESIZE" => $avatar_filesize,
|
||||
"AVATAR_HEIGHT" => $avatar_height,
|
||||
"AVATAR_WIDTH" => $avatar_width,
|
||||
"AVATAR_PATH" => $avatar_path,
|
||||
"ADMIN_EMAIL" => $admin_email,
|
||||
"EMAIL_SIG" => $email_sig,
|
||||
"AVATAR_FILESIZE" => $new['avatar_filesize'],
|
||||
"AVATAR_MAX_HEIGHT" => $new['avatar_max_height'],
|
||||
"AVATAR_MAX_WIDTH" => $new['avatar_max_width'],
|
||||
"AVATAR_PATH" => $new['avatar_path'],
|
||||
"EMAIL_FROM" => $new['email_from'],
|
||||
"EMAIL_SIG" => $new['email_sig'],
|
||||
"SMTP_YES" => $smtp_yes,
|
||||
"SMTP_NO" => $smtp_no,
|
||||
"SMTP_SERVER" => $smtp_server)
|
||||
"SMTP_HOST" => $new['smtp_host'])
|
||||
);
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('page_footer_admin.'.$phpEx);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user