2001-02-17 08:37:32 +00:00
|
|
|
<?php
|
2001-08-01 10:31:20 +00:00
|
|
|
/***************************************************************************
|
2001-08-26 14:35:39 +00:00
|
|
|
* admin_board.php
|
2001-08-01 10:31:20 +00:00
|
|
|
* -------------------
|
|
|
|
* begin : Thursday, Jul 12, 2001
|
|
|
|
* copyright : (C) 2001 The phpBB Group
|
|
|
|
* email : support@phpbb.com
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
2001-07-24 22:11:24 +00:00
|
|
|
if($setmodules == 1)
|
2001-07-13 14:16:11 +00:00
|
|
|
{
|
2001-07-13 14:56:01 +00:00
|
|
|
$file = basename(__FILE__);
|
2001-09-02 15:48:12 +00:00
|
|
|
$module['General']['Configuration'] = "$file?mode=config";
|
2001-07-13 14:56:01 +00:00
|
|
|
return;
|
2001-07-13 14:16:11 +00:00
|
|
|
}
|
|
|
|
|
2001-09-02 15:48:12 +00:00
|
|
|
//
|
|
|
|
// Let's set the root dir for phpBB
|
|
|
|
//
|
|
|
|
$phpbb_root_dir = "./../";
|
2001-10-14 15:46:53 +00:00
|
|
|
require('pagestart.inc');
|
2001-09-02 15:48:12 +00:00
|
|
|
|
2001-07-24 22:11:24 +00:00
|
|
|
//
|
|
|
|
//
|
2001-10-14 15:46:53 +00:00
|
|
|
//
|
2001-09-06 17:14:58 +00:00
|
|
|
$sql = "SELECT *
|
|
|
|
FROM " . CONFIG_TABLE;
|
|
|
|
if(!$result = $db->sql_query($sql))
|
|
|
|
{
|
|
|
|
message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-09-09 23:56:04 +00:00
|
|
|
while( $row = $db->sql_fetchrow($result) )
|
2001-09-06 17:14:58 +00:00
|
|
|
{
|
2001-09-08 18:24:34 +00:00
|
|
|
$config_name = $row['config_name'];
|
|
|
|
$config_value = $row['config_value'];
|
|
|
|
$default_config[$config_name] = $config_value;
|
|
|
|
|
2001-09-09 23:56:04 +00:00
|
|
|
$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
|
|
|
|
|
|
|
|
if( isset($HTTP_POST_VARS['submit']) )
|
2001-09-08 18:24:34 +00:00
|
|
|
{
|
2001-09-10 00:16:37 +00:00
|
|
|
$sql = "UPDATE " . CONFIG_TABLE . " SET
|
2001-09-25 18:18:47 +00:00
|
|
|
config_value = '" . $new[$config_name] . "'
|
2001-09-10 00:16:37 +00:00
|
|
|
WHERE config_name = '$config_name'";
|
|
|
|
if( !$db->sql_query($sql) )
|
2001-09-08 18:24:34 +00:00
|
|
|
{
|
2001-09-10 00:16:37 +00:00
|
|
|
message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql);
|
2001-09-08 18:24:34 +00:00
|
|
|
}
|
|
|
|
}
|
2001-09-06 17:14:58 +00:00
|
|
|
}
|
2001-09-09 23:56:04 +00:00
|
|
|
|
2001-09-08 18:24:34 +00:00
|
|
|
if($HTTP_POST_VARS['submit'])
|
2001-09-06 17:14:58 +00:00
|
|
|
{
|
2001-09-08 18:24:34 +00:00
|
|
|
message_die(GENERAL_MESSAGE, $lang['Config_updated']);
|
2001-09-06 17:14:58 +00:00
|
|
|
}
|
2001-09-02 15:48:12 +00:00
|
|
|
}
|
2001-09-02 13:33:23 +00:00
|
|
|
|
2001-09-25 18:18:47 +00:00
|
|
|
$style_select = style_select($new['default_style'], 'default_style', "../templates");
|
|
|
|
$admin_style_select = style_select($new['default_admin_style'], 'default_admin_style', "../templates");
|
2001-09-08 18:24:34 +00:00
|
|
|
$lang_select = language_select($new['default_lang'], 'default_lang', "../language");
|
|
|
|
$timezone_select = tz_select($new['board_timezone'], 'board_timezone');
|
2001-10-11 12:32:05 +00:00
|
|
|
$html_tags = $new['allow_html_tags'];
|
2001-09-08 18:24:34 +00:00
|
|
|
|
2001-09-25 18:18:47 +00:00
|
|
|
$override_user_style_yes = ($new['override_user_style']) ? "checked=\"checked\"" : "";
|
|
|
|
$override_user_style_no = (!$new['override_user_style']) ? "checked=\"checked\"" : "";
|
2001-09-08 18:24:34 +00:00
|
|
|
$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\"" : "";
|
2001-09-25 18:42:36 +00:00
|
|
|
$activation_none = ($new['require_activation'] == USER_ACTIVATION_NONE) ? "checked=\"checked\"" : "";
|
|
|
|
$activation_user = ($new['require_activation'] == USER_ACTIVATION_SELF) ? "checked=\"checked\"" : "";
|
|
|
|
$activation_admin = ($new['require_activation'] == USER_ACTIVATION_ADMIN) ? "checked=\"checked\"" : "";
|
2001-09-08 18:24:34 +00:00
|
|
|
$gzip_yes = ($new['gzip_compress']) ? "checked=\"checked\"" : "";
|
|
|
|
$gzip_no = (!$new['gzip_compress']) ? "checked=\"checked\"" : "";
|
2001-09-25 18:18:47 +00:00
|
|
|
$prune_yes = ($new['prune_enable']) ? "checked=\"checked\"" : "";
|
|
|
|
$prune_no = (!$new['prune_enable']) ? "checked=\"checked\"" : "";
|
2001-09-08 18:24:34 +00:00
|
|
|
$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\"" : "";
|
|
|
|
|
2001-09-06 17:14:58 +00:00
|
|
|
$template->set_filenames(array(
|
2001-10-14 15:46:53 +00:00
|
|
|
"body" => "admin/board_config_body.tpl")
|
2001-09-06 17:14:58 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$template->assign_vars(array(
|
|
|
|
"S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"),
|
2001-09-08 18:24:34 +00:00
|
|
|
"SITENAME" => $new['sitename'],
|
2001-09-27 09:48:37 +00:00
|
|
|
"L_YES" => $lang['Yes'],
|
|
|
|
"L_NO" => $lang['No'],
|
|
|
|
"L_CONFIGURATION_TITLE" => $lang['General_Config'],
|
|
|
|
"L_CONFIGURATION_EXPLAIN" => $lang['Config_explain'],
|
|
|
|
"L_GENERAL_SETTINGS" => $lang['General_settings'],
|
|
|
|
"L_SITE_NAME" => $lang['Site_name'],
|
|
|
|
"L_ACCT_ACTIVATION" => $lang['Acct_activation'],
|
2001-09-25 18:42:36 +00:00
|
|
|
"ACTIVATION_NONE" => USER_ACTIVATION_NONE,
|
2001-09-25 18:18:47 +00:00
|
|
|
"ACTIVATION_NONE_CHECKED" => $activation_none,
|
2001-09-25 18:42:36 +00:00
|
|
|
"ACTIVATION_USER" => USER_ACTIVATION_SELF,
|
2001-09-25 18:18:47 +00:00
|
|
|
"ACTIVATION_USER_CHECKED" => $activation_user,
|
2001-09-25 18:42:36 +00:00
|
|
|
"ACTIVATION_ADMIN" => USER_ACTIVATION_ADMIN,
|
2001-09-25 18:18:47 +00:00
|
|
|
"ACTIVATION_ADMIN_CHECKED" => $activation_admin,
|
2001-09-08 18:24:34 +00:00
|
|
|
"FLOOD_INTERVAL" => $new['flood_interval'],
|
|
|
|
"TOPICS_PER_PAGE" => $new['topics_per_page'],
|
|
|
|
"POSTS_PER_PAGE" => $new['posts_per_page'],
|
|
|
|
"HOT_TOPIC" => $new['hot_threshold'],
|
2001-09-09 23:56:04 +00:00
|
|
|
"STYLE_SELECT" => $style_select,
|
2001-09-25 18:18:47 +00:00
|
|
|
"OVERRIDE_STYLE_YES" => $override_user_style_yes,
|
|
|
|
"OVERRIDE_STYLE_NO" => $override_user_style_no,
|
2001-09-06 17:14:58 +00:00
|
|
|
"LANG_SELECT" => $lang_select,
|
|
|
|
"L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'],
|
2001-09-08 18:24:34 +00:00
|
|
|
"DEFAULT_DATEFORMAT" => $new['default_dateformat'],
|
2001-09-06 17:14:58 +00:00
|
|
|
"TIMEZONE_SELECT" => $timezone_select,
|
|
|
|
"GZIP_YES" => $gzip_yes,
|
|
|
|
"GZIP_NO" => $gzip_no,
|
2001-09-25 18:18:47 +00:00
|
|
|
"PRUNE_YES" => $prune_yes,
|
2001-10-11 12:32:05 +00:00
|
|
|
"PRUNE_NO" => $prune_no,
|
|
|
|
"HTML_TAGS" => $html_tags,
|
2001-09-06 17:14:58 +00:00
|
|
|
"HTML_YES" => $html_yes,
|
|
|
|
"HTML_NO" => $html_no,
|
|
|
|
"BBCODE_YES" => $bbcode_yes,
|
|
|
|
"BBCODE_NO" => $bbcode_no,
|
|
|
|
"SMILE_YES" => $smile_yes,
|
|
|
|
"SMILE_NO" => $smile_no,
|
|
|
|
"SIG_YES" => $sig_yes,
|
|
|
|
"SIG_NO" => $sig_no,
|
2001-10-01 23:22:18 +00:00
|
|
|
"SIG_SIZE" => $new['max_sig_chars'],
|
2001-09-06 17:14:58 +00:00
|
|
|
"NAMECHANGE_YES" => $namechange_yes,
|
|
|
|
"NAMECHANGE_NO" => $namechange_no,
|
|
|
|
"AVATARS_LOCAL_YES" => $avatars_local_yes,
|
|
|
|
"AVATARS_LOCAL_NO" => $avatars_local_no,
|
|
|
|
"AVATARS_REMOTE_YES" => $avatars_remote_yes,
|
|
|
|
"AVATARS_REMOTE_NO" => $avatars_remote_no,
|
|
|
|
"AVATARS_UPLOAD_YES" => $avatars_upload_yes,
|
|
|
|
"AVATARS_UPLOAD_NO" => $avatars_upload_no,
|
2001-09-08 18:24:34 +00:00
|
|
|
"AVATAR_FILESIZE" => $new['avatar_filesize'],
|
|
|
|
"AVATAR_MAX_HEIGHT" => $new['avatar_max_height'],
|
|
|
|
"AVATAR_MAX_WIDTH" => $new['avatar_max_width'],
|
2001-10-01 23:47:19 +00:00
|
|
|
"AVATAR_PATH" => $new['avatar_path'],
|
2001-10-11 22:05:36 +00:00
|
|
|
"AVATAR_GALLERY_PATH" => $new['avatar_gallery_path'],
|
2001-10-01 23:47:19 +00:00
|
|
|
"SMILIES_PATH" => $new['smilies_path'],
|
|
|
|
"INBOX_PRIVMSGS" => $new['max_inbox_privmsgs'],
|
|
|
|
"SENTBOX_PRIVMSGS" => $new['max_sentbox_privmsgs'],
|
|
|
|
"SAVEBOX_PRIVMSGS" => $new['max_savebox_privmsgs'],
|
2001-09-25 18:18:47 +00:00
|
|
|
"EMAIL_FROM" => $new['board_email'],
|
|
|
|
"EMAIL_SIG" => $new['board_email_sig'],
|
2001-09-06 17:14:58 +00:00
|
|
|
"SMTP_YES" => $smtp_yes,
|
|
|
|
"SMTP_NO" => $smtp_no,
|
2001-09-27 09:48:37 +00:00
|
|
|
"SMTP_HOST" => $new['smtp_host'],
|
|
|
|
"COPPA_MAIL" => $new['coppa_mail'],
|
|
|
|
"COPPA_FAX" => $new['coppa_fax'])
|
2001-09-06 17:14:58 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$template->pparse("body");
|
|
|
|
|
2001-07-24 22:11:24 +00:00
|
|
|
include('page_footer_admin.'.$phpEx);
|
2001-07-27 23:16:09 +00:00
|
|
|
|
2001-09-09 23:56:04 +00:00
|
|
|
?>
|