mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-25 16:49:58 +02:00
Fixing a few bugs....
git-svn-id: file:///svn/phpbb/trunk@971 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
3054ca04b6
commit
29ea1679eb
@ -11,193 +11,196 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if($setmodules == 1)
|
||||
{
|
||||
$file = basename(__FILE__);
|
||||
$module['General']['Configuration'] = "$file";
|
||||
$module['General']['Configuration'] = "$file?mode=config";
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Let's set the root dir for phpBB
|
||||
//
|
||||
$phpbb_root_dir = "./../";
|
||||
|
||||
//
|
||||
// Include required files, get $phpEx and check permissions
|
||||
//
|
||||
require('pagestart.inc');
|
||||
|
||||
$sitename = (isset($HTTP_POST_VARS['sitename'])) ? $HTTP_POST_VARS['sitename'] : $board_config['sitename'];
|
||||
$require_activation = (isset($HTTP_POST_VARS['require_activation'])) ? $HTTP_POST_VARS['require_activation'] : $board_config['require_activation'];
|
||||
$flood_interval = (isset($HTTP_POST_VARS['flood_interval'])) ? $HTTP_POST_VARS['flood_interval'] : $board_config['flood_interval'];
|
||||
$topics_per_page = (isset($HTTP_POST_VARS['topics_per_page'])) ? $HTTP_POST_VARS['topics_per_page'] : $board_config['topics_per_page'];
|
||||
$posts_per_page = (isset($HTTP_POST_VARS['posts_per_page'])) ? $HTTP_POST_VARS['posts_per_page'] : $board_config['posts_per_page'];
|
||||
$hot_topic = (isset($HTTP_POST_VARS['hot_topic'])) ? $HTTP_POST_VARS['hot_topic'] : $board_config['hot_threshold'];
|
||||
$selected_template = (isset($HTTP_POST_VARS['template'])) ? $HTTP_POST_VARS['template'] : $board_config['default_template'];
|
||||
$template_select = template_select($selected_template, "../templates");
|
||||
$theme = (isset($HTTP_POST_VARS['theme'])) ? $HTTP_POST_VARS['theme'] : $board_config['default_theme'];
|
||||
$theme_select = theme_select($theme);
|
||||
$language = (isset($HTTP_POST_VARS['language'])) ? $HTTP_POST_VARS['language'] : $board_config['default_lang'];
|
||||
$lang_select = language_select($language, "../language");
|
||||
$timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['default_timezone'];
|
||||
$timezone_select = tz_select($timezone);
|
||||
$date_format = (isset($HTTP_POST_VARS['date_format'])) ? $HTTP_POST_VARS['date_format'] : $board_config['default_dateformat'];
|
||||
$gzip = (isset($HTTP_POST_VARS['gzip'])) ? $HTTP_POST_VARS['gzip'] : $board_config['gzip_compress'];
|
||||
$allow_html = (isset($HTTP_POST_VARS['allow_html'])) ? $HTTP_POST_VARS['allow_html'] : $board_config['allow_html'];
|
||||
$allow_bbcode = (isset($HTTP_POST_VARS['allow_bbcode'])) ? $HTTP_POST_VARS['allow_bbcode'] : $board_config['allow_bbcode'];
|
||||
$allow_smile = (isset($HTTP_POST_VARS['allow_smile'])) ? $HTTP_POST_VARS['allow_smile'] : $board_config['allow_smilies'];
|
||||
$allow_sig = (isset($HTTP_POST_VARS['allow_sig'])) ? $HTTP_POST_VARS['allow_sig'] : $board_config['allow_sig'];
|
||||
$allow_namechange = (isset($HTTP_POST_VARS['allow_namechange'])) ? $HTTP_POST_VARS['allow_namechange'] : $board_config['allow_namechange'];
|
||||
$allow_avatars_local = (isset($HTTP_POST_VARS['allow_avatars_local'])) ? $HTTP_POST_VARS['allow_avatars_local'] : $board_config['allow_avatar_local'];
|
||||
$allow_avatars_remote = (isset($HTTP_POST_VARS['allow_avatars_remote'])) ? $HTTP_POST_VARS['allow_avatars_remote'] : $board_config['allow_avatar_remote'];
|
||||
$allow_avatars_upload = (isset($HTTP_POST_VARS['allow_avatars_upload'])) ? $HTTP_POST_VARS['allow_avatars_upload'] : $board_config['allow_avatar_upload'];
|
||||
$avatar_filesize = (isset($HTTP_POST_VARS['avatar_filesize'])) ? $HTTP_POST_VARS['avatar_filesize'] : $board_config['avatar_filesize'];
|
||||
$avatar_height = (isset($HTTP_POST_VARS['avatar_height'])) ? $HTTP_POST_VARS['avatar_height'] : $board_config['avatar_max_height'];
|
||||
$avatar_width = (isset($HTTP_POST_VARS['avatar_width'])) ? $HTTP_POST_VARS['avatar_width'] : $board_config['avatar_max_width'];
|
||||
$avatar_path = (isset($HTTP_POST_VARS['avatar_path'])) ? $HTTP_POST_VARS['avatar_path'] : $board_config['avatar_path'];
|
||||
$admin_email = (isset($HTTP_POST_VARS['admin_email'])) ? $HTTP_POST_VARS['admin_email'] : $board_config['board_email_from'];
|
||||
$email_sig = (isset($HTTP_POST_VARS['email_sig'])) ? $HTTP_POST_VARS['email_sig'] : $board_config['board_email'];
|
||||
$use_smtp = (isset($HTTP_POST_VARS['use_smtp'])) ? $HTTP_POST_VARS['use_smtp'] : $board_config['smtp_delivery'];
|
||||
$smtp_server = (isset($HTTP_POST_VARS['smtp_server'])) ? $HTTP_POST_VARS['smtp_server'] : $board_config['smtp_host'];
|
||||
$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
|
||||
|
||||
$html_yes = ($allow_html) ? "CHECKED" : "";
|
||||
$html_no = (!$allow_html) ? "CHECKED" : "";
|
||||
$bbcode_yes = ($allow_bbcode) ? "CHECKED" : "";
|
||||
$bbcode_no = (!$allow_bbcode) ? "CHECKED" : "";
|
||||
$activation_yes = ($require_activation) ? "CHECKED" : "";
|
||||
$activation_no = (!$require_activation) ? "CHECKED" : "";
|
||||
$gzip_yes = ($gzip) ? "CHECKED" : "";
|
||||
$gzip_no = (!$gzip) ? "CHECKED" : "";
|
||||
$smile_yes = ($allow_smile) ? "CHECKED" : "";
|
||||
$smile_no = (!$allow_smile) ? "CHECKED" : "";
|
||||
$sig_yes = ($allow_sig) ? "CHECKED" : "";
|
||||
$sig_no = (!$allow_sig) ? "CHECKED" : "";
|
||||
$namechange_yes = ($allow_namechange) ? "CHECKED" : "";
|
||||
$namechange_no = (!$allow_namechange) ? "CHECKED" : "";
|
||||
$avatars_local_yes = ($allow_avatars_local) ? "CHECKED" : "";
|
||||
$avatars_local_no = (!$allow_avatars_local) ? "CHECKED" : "";
|
||||
$avatars_remote_yes = ($allow_avatars_remote) ? "CHECKED" : "";
|
||||
$avatars_remote_no = (!$allow_avatars_remote) ? "CHECKED" : "";
|
||||
$avatars_upload_yes = ($allow_avatars_upload) ? "CHECKED" : "";
|
||||
$avatars_upload_no = (!$allow_avatars_upload) ? "CHECKED" : "";
|
||||
$smtp_yes = ($use_smtp) ? "CHECKED" : "";
|
||||
$smtp_no = (!$use_smtp) ? "CHECKED" : "";
|
||||
|
||||
|
||||
if($HTTP_POST_VARS['submit'])
|
||||
switch($mode)
|
||||
{
|
||||
case 'config':
|
||||
$sitename = (isset($HTTP_POST_VARS['sitename'])) ? $HTTP_POST_VARS['sitename'] : $board_config['sitename'];
|
||||
$require_activation = (isset($HTTP_POST_VARS['require_activation'])) ? $HTTP_POST_VARS['require_activation'] : $board_config['require_activation'];
|
||||
$flood_interval = (isset($HTTP_POST_VARS['flood_interval'])) ? $HTTP_POST_VARS['flood_interval'] : $board_config['flood_interval'];
|
||||
$topics_per_page = (isset($HTTP_POST_VARS['topics_per_page'])) ? $HTTP_POST_VARS['topics_per_page'] : $board_config['topics_per_page'];
|
||||
$posts_per_page = (isset($HTTP_POST_VARS['posts_per_page'])) ? $HTTP_POST_VARS['posts_per_page'] : $board_config['posts_per_page'];
|
||||
$hot_topic = (isset($HTTP_POST_VARS['hot_topic'])) ? $HTTP_POST_VARS['hot_topic'] : $board_config['hot_threshold'];
|
||||
$selected_template = (isset($HTTP_POST_VARS['template'])) ? $HTTP_POST_VARS['template'] : $board_config['default_template'];
|
||||
$template_select = template_select($selected_template, "../templates");
|
||||
$theme = (isset($HTTP_POST_VARS['theme'])) ? $HTTP_POST_VARS['theme'] : $board_config['default_theme'];
|
||||
$theme_select = theme_select($theme);
|
||||
$language = (isset($HTTP_POST_VARS['language'])) ? $HTTP_POST_VARS['language'] : $board_config['default_lang'];
|
||||
$lang_select = language_select($language, "../language");
|
||||
$timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['system_timezone'];
|
||||
$timezone_select = tz_select($timezone);
|
||||
$date_format = (isset($HTTP_POST_VARS['date_format'])) ? $HTTP_POST_VARS['date_format'] : $board_config['default_dateformat'];
|
||||
$gzip = (isset($HTTP_POST_VARS['gzip'])) ? $HTTP_POST_VARS['gzip'] : $board_config['gzip_compress'];
|
||||
$allow_html = (isset($HTTP_POST_VARS['allow_html'])) ? $HTTP_POST_VARS['allow_html'] : $board_config['allow_html'];
|
||||
$allow_bbcode = (isset($HTTP_POST_VARS['allow_bbcode'])) ? $HTTP_POST_VARS['allow_bbcode'] : $board_config['allow_bbcode'];
|
||||
$allow_smile = (isset($HTTP_POST_VARS['allow_smile'])) ? $HTTP_POST_VARS['allow_smile'] : $board_config['allow_smilies'];
|
||||
$allow_sig = (isset($HTTP_POST_VARS['allow_sig'])) ? $HTTP_POST_VARS['allow_sig'] : $board_config['allow_sig'];
|
||||
$allow_namechange = (isset($HTTP_POST_VARS['allow_namechange'])) ? $HTTP_POST_VARS['allow_namechange'] : $board_config['allow_namechange'];
|
||||
$allow_avatars_local = (isset($HTTP_POST_VARS['allow_avatars_local'])) ? $HTTP_POST_VARS['allow_avatars_local'] : $board_config['allow_avatar_local'];
|
||||
$allow_avatars_remote = (isset($HTTP_POST_VARS['allow_avatars_remote'])) ? $HTTP_POST_VARS['allow_avatars_remote'] : $board_config['allow_avatar_remote'];
|
||||
$allow_avatars_upload = (isset($HTTP_POST_VARS['allow_avatars_upload'])) ? $HTTP_POST_VARS['allow_avatars_upload'] : $board_config['allow_avatar_upload'];
|
||||
$avatar_filesize = (isset($HTTP_POST_VARS['avatar_filesize'])) ? $HTTP_POST_VARS['avatar_filesize'] : $board_config['avatar_filesize'];
|
||||
$avatar_height = (isset($HTTP_POST_VARS['avatar_height'])) ? $HTTP_POST_VARS['avatar_height'] : $board_config['avatar_max_height'];
|
||||
$avatar_width = (isset($HTTP_POST_VARS['avatar_width'])) ? $HTTP_POST_VARS['avatar_width'] : $board_config['avatar_max_width'];
|
||||
$avatar_path = (isset($HTTP_POST_VARS['avatar_path'])) ? $HTTP_POST_VARS['avatar_path'] : $board_config['avatar_path'];
|
||||
$admin_email = (isset($HTTP_POST_VARS['admin_email'])) ? $HTTP_POST_VARS['admin_email'] : $board_config['board_email_from'];
|
||||
$email_sig = (isset($HTTP_POST_VARS['email_sig'])) ? $HTTP_POST_VARS['email_sig'] : $board_config['board_email'];
|
||||
$use_smtp = (isset($HTTP_POST_VARS['use_smtp'])) ? $HTTP_POST_VARS['use_smtp'] : $board_config['smtp_delivery'];
|
||||
$smtp_server = (isset($HTTP_POST_VARS['smtp_server'])) ? $HTTP_POST_VARS['smtp_server'] : $board_config['smtp_host'];
|
||||
|
||||
$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 = '".addslashes($email_sig)."',
|
||||
email_from = '".addslashes($admin_email)."',
|
||||
smtp_delivery = '$use_smtp',
|
||||
smtp_host = '".addslashes($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 = '".addslashes($avatar_path)."',
|
||||
default_theme = '$theme',
|
||||
default_lang = '$language',
|
||||
default_dateformat = '$date_format',
|
||||
system_timezone = '$timezone',
|
||||
sys_template = '$selected_template',
|
||||
gzip_compress = '$gzip' WHERE config_id = 1";
|
||||
$html_yes = ($allow_html) ? "CHECKED" : "";
|
||||
$html_no = (!$allow_html) ? "CHECKED" : "";
|
||||
$bbcode_yes = ($allow_bbcode) ? "CHECKED" : "";
|
||||
$bbcode_no = (!$allow_bbcode) ? "CHECKED" : "";
|
||||
$activation_yes = ($require_activation) ? "CHECKED" : "";
|
||||
$activation_no = (!$require_activation) ? "CHECKED" : "";
|
||||
$gzip_yes = ($gzip) ? "CHECKED" : "";
|
||||
$gzip_no = (!$gzip) ? "CHECKED" : "";
|
||||
$smile_yes = ($allow_smile) ? "CHECKED" : "";
|
||||
$smile_no = (!$allow_smile) ? "CHECKED" : "";
|
||||
$sig_yes = ($allow_sig) ? "CHECKED" : "";
|
||||
$sig_no = (!$allow_sig) ? "CHECKED" : "";
|
||||
$namechange_yes = ($allow_namechange) ? "CHECKED" : "";
|
||||
$namechange_no = (!$allow_namechange) ? "CHECKED" : "";
|
||||
$avatars_local_yes = ($allow_avatars_local) ? "CHECKED" : "";
|
||||
$avatars_local_no = (!$allow_avatars_local) ? "CHECKED" : "";
|
||||
$avatars_remote_yes = ($allow_avatars_remote) ? "CHECKED" : "";
|
||||
$avatars_remote_no = (!$allow_avatars_remote) ? "CHECKED" : "";
|
||||
$avatars_upload_yes = ($allow_avatars_upload) ? "CHECKED" : "";
|
||||
$avatars_upload_no = (!$allow_avatars_upload) ? "CHECKED" : "";
|
||||
$smtp_yes = ($use_smtp) ? "CHECKED" : "";
|
||||
$smtp_no = (!$use_smtp) ? "CHECKED" : "";
|
||||
|
||||
if($db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['Config_updated'], "Success", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = 1;
|
||||
$error_arr = $db->sql_error();
|
||||
$error_msg = "Error updating database!<br />Reason: " . $error_arr['message'];
|
||||
}
|
||||
|
||||
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 = '".addslashes($email_sig)."',
|
||||
email_from = '".addslashes($admin_email)."',
|
||||
smtp_delivery = '$use_smtp',
|
||||
smtp_host = '".addslashes($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 = '".addslashes($avatar_path)."',
|
||||
default_theme = '$theme',
|
||||
default_lang = '$language',
|
||||
default_dateformat = '$date_format',
|
||||
system_timezone = '$timezone',
|
||||
sys_template = '$selected_template',
|
||||
gzip_compress = '$gzip' WHERE config_id = 1";
|
||||
|
||||
if($db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['Config_updated'], "Success", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = 1;
|
||||
$error_arr = $db->sql_error();
|
||||
$error_msg = "Error updating database!<br />Reason: " . $error_arr['message'];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Error occured, show the error box
|
||||
//
|
||||
if($error)
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
"reg_header" => "error_body.tpl")
|
||||
);
|
||||
$template->assign_vars(array(
|
||||
"ERROR_MESSAGE" => $error_msg)
|
||||
);
|
||||
$template->pparse("reg_header");
|
||||
}
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/admin_config_body.tpl")
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
"S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"),
|
||||
"SITENAME" => $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,
|
||||
"TEMPLATE_SELECT" => $template_select,
|
||||
"THEME_SELECT" => $theme_select,
|
||||
"LANG_SELECT" => $lang_select,
|
||||
"L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'],
|
||||
"DATE_FORMAT" => $date_format,
|
||||
"TIMEZONE_SELECT" => $timezone_select,
|
||||
"GZIP_YES" => $gzip_yes,
|
||||
"GZIP_NO" => $gzip_no,
|
||||
"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,
|
||||
"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,
|
||||
"AVATAR_FILESIZE" => $avatar_filesize,
|
||||
"AVATAR_HEIGHT" => $avatar_height,
|
||||
"AVATAR_WIDTH" => $avatar_width,
|
||||
"AVATAR_PATH" => $avatar_path,
|
||||
"ADMIN_EMAIL" => $admin_email,
|
||||
"EMAIL_SIG" => $email_sig,
|
||||
"SMTP_YES" => $smtp_yes,
|
||||
"SMTP_NO" => $smtp_no,
|
||||
"SMTP_SERVER" => $smtp_server)
|
||||
);
|
||||
|
||||
$template->pparse("body");
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Error occured, show the error box
|
||||
//
|
||||
if($error)
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
"reg_header" => "error_body.tpl")
|
||||
);
|
||||
$template->assign_vars(array(
|
||||
"ERROR_MESSAGE" => $error_msg)
|
||||
);
|
||||
$template->pparse("reg_header");
|
||||
}
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/admin_config_body.tpl")
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
"S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"),
|
||||
"SITENAME" => $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,
|
||||
"TEMPLATE_SELECT" => $template_select,
|
||||
"THEME_SELECT" => $theme_select,
|
||||
"LANG_SELECT" => $lang_select,
|
||||
"L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'],
|
||||
"DATE_FORMAT" => $date_format,
|
||||
"TIMEZONE_SELECT" => $timezone_select,
|
||||
"GZIP_YES" => $gzip_yes,
|
||||
"GZIP_NO" => $gzip_no,
|
||||
"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,
|
||||
"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,
|
||||
"AVATAR_FILESIZE" => $avatar_filesize,
|
||||
"AVATAR_HEIGHT" => $avatar_height,
|
||||
"AVATAR_WIDTH" => $avatar_width,
|
||||
"AVATAR_PATH" => $avatar_path,
|
||||
"ADMIN_EMAIL" => $admin_email,
|
||||
"EMAIL_SIG" => $email_sig,
|
||||
"SMTP_YES" => $smtp_yes,
|
||||
"SMTP_NO" => $smtp_no,
|
||||
"SMTP_SERVER" => $smtp_server)
|
||||
);
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('page_footer_admin.'.$phpEx);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -11,15 +11,6 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
* Moderator Control Panel
|
||||
*
|
||||
@ -40,8 +31,6 @@ $page_title = "Modertator Control Panel";
|
||||
$forum_id = ($HTTP_POST_VARS[POST_FORUM_URL]) ? $HTTP_POST_VARS[POST_FORUM_URL] : $HTTP_GET_VARS[POST_FORUM_URL];
|
||||
$topic_id = ($HTTP_POST_VARS[POST_TOPIC_URL]) ? $HTTP_POST_VARS[POST_TOPIC_URL] : $HTTP_GET_VARS[POST_TOPIC_URL];
|
||||
|
||||
|
||||
|
||||
if(empty($forum_id) || !isset($forum_id))
|
||||
{
|
||||
$sql = "SELECT f.forum_id, f.forum_name, f.forum_topics
|
||||
@ -241,10 +230,6 @@ switch($mode)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($HTTP_POST_VARS['preform_op']) && empty($topic_id))
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['None_selected'], $lang['Error']);
|
||||
}
|
||||
$hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'"><input type="hidden" name="'.POST_FORUM_URL.'" value="'.$forum_id.'"><input type="hidden" name="quick_op" value="'.$quick_op.'">';
|
||||
if($HTTP_POST_VARS['preform_op'])
|
||||
{
|
||||
@ -293,7 +278,6 @@ switch($mode)
|
||||
$sql_select = 'SELECT
|
||||
topic_title,
|
||||
topic_poster,
|
||||
topic_status,
|
||||
topic_time
|
||||
FROM '.
|
||||
TOPICS_TABLE." WHERE
|
||||
@ -305,7 +289,6 @@ switch($mode)
|
||||
else
|
||||
{
|
||||
$row = $db->sql_fetchrowset($result);
|
||||
|
||||
$ttitle = $row[0]['topic_title'];
|
||||
$tpost = $row[0]['topic_poster'];
|
||||
$ttime = $row[0]['topic_time'];
|
||||
@ -379,10 +362,6 @@ switch($mode)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($HTTP_POST_VARS['preform_op']) && empty($topic_id))
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['None_selected'], $lang['Error']);
|
||||
}
|
||||
$hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'"><input type="hidden" name="'.POST_FORUM_URL.'" value="'.$forum_id.'"><input type="hidden" name="quick_op" value="'.$quick_op.'">';
|
||||
$hidden_fields .= $lang['New_forum'] . ': ' . make_forum_box('new_forum'). '</select><br><br>';
|
||||
if($HTTP_POST_VARS['preform_op'])
|
||||
@ -452,10 +431,6 @@ switch($mode)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($HTTP_POST_VARS['preform_op']) && empty($topic_id))
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['None_selected'], $lang['Error']);
|
||||
}
|
||||
$hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'"><input type="hidden" name="'.POST_FORUM_URL.'" value="'.$forum_id.'"><input type="hidden" name="quick_op" value="'.$quick_op.'">';
|
||||
if($HTTP_POST_VARS['preform_op'])
|
||||
{
|
||||
@ -528,11 +503,6 @@ switch($mode)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($HTTP_POST_VARS['preform_op']) && empty($topic_id))
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['None_selected'], $lang['Error']);
|
||||
}
|
||||
|
||||
$hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '"><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '"><input type="hidden" name="quick_op" value="' . $quick_op . '">';
|
||||
|
||||
if($HTTP_POST_VARS['preform_op'])
|
||||
@ -595,7 +565,8 @@ switch($mode)
|
||||
|
||||
$sql = "INSERT INTO " . TOPICS_TABLE . "
|
||||
(topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type)
|
||||
VALUES ('$subject', $first_poster, " . $topic_time . ", $new_forum_id, " . TOPIC_UNLOCKED . ", " . POST_NORMAL . ")";
|
||||
VALUES ('$subject', $first_poster, " .
|
||||
$topic_time . ", $new_forum_id, " . TOPIC_UNLOCKED . ", " . POST_NORMAL . ")";
|
||||
if(!$result = $db->sql_query($sql, BEGIN_TRANSACTION))
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not insert new topic", "", __LINE__, __FILE__, $sql);
|
||||
@ -747,53 +718,7 @@ switch($mode)
|
||||
$template->pparse("split_body");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'ip':
|
||||
$post_id = $HTTP_GET_VARS[POST_POST_URL];
|
||||
if(!$post_id)
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Error, no post id found", "Error", __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
// Look up relevent data for this post
|
||||
$sql = "SELECT poster_ip, poster_id, post_username FROM ".POSTS_TABLE." WHERE post_id = $post_id";
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not get poster IP information", "Error", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$post_row = $db->sql_fetchrow($result);
|
||||
|
||||
// Get other users who've posted under this IP
|
||||
$sql = "SELECT u.username, u.user_id FROM " . USERS_TABLE ." u, " . POSTS_TABLE . " p WHERE p.poster_id = u.user_id AND p.poster_ip = '".$post_row['poster_ip']."'";
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not get posters information based on IP", "Error", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$poster_ids = $db->sql_fetchrowset($result);
|
||||
sort($poster_ids);
|
||||
|
||||
$posts = 0;
|
||||
while(list($null, $userdata) = each($poster_ids))
|
||||
{
|
||||
$username = $userdata['username'];
|
||||
$user_id = $userdata['user_id'];
|
||||
|
||||
if($username != $last_username && !empty($last_username))
|
||||
{
|
||||
$other_users[] = array("username" => "$last_username", "user_id" => "$last_user_id", "posts" => "$posts");
|
||||
$posts = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$posts += 1;
|
||||
}
|
||||
$last_username = $username;
|
||||
$last_user_ip = $user_id;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@ -833,15 +758,10 @@ switch($mode)
|
||||
|
||||
for($x = 0; $x < $total_topics; $x++)
|
||||
{
|
||||
$topic_title = "";
|
||||
if($topics[$x]['topic_status'] == TOPIC_LOCKED)
|
||||
{
|
||||
$folder_image = "<img src=\"" . $images['folder_locked'] . "\" alt=\"Topic Locked\">";
|
||||
}
|
||||
else if($topics[$x]['topic_status'] == TOPIC_MOVED)
|
||||
{
|
||||
$topic_title = "<b>" . $lang['Topic_Moved'] . ":</b> ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$folder_image = "<img src=\"" . $images['folder'] . "\">";
|
||||
@ -849,13 +769,15 @@ switch($mode)
|
||||
|
||||
$topic_id = $topics[$x]['topic_id'];
|
||||
|
||||
$topic_title = "";
|
||||
|
||||
if($topics[$x]['topic_type'] == POST_STICKY)
|
||||
{
|
||||
$topic_title = "<b>".$lang['Post_Sticky'] . ":</b> ";
|
||||
$topic_title = $lang['Sticky'] . " ";
|
||||
}
|
||||
else if($topics[$x]['topic_type'] == POST_ANNOUNCE)
|
||||
{
|
||||
$topic_title = "<b>" . $lang['Post_Announcement'] . ":</b> ";
|
||||
$topic_title = $lang['Annoucement'] . " ";
|
||||
}
|
||||
|
||||
$topic_title .= stripslashes($topics[$x]['topic_title']);
|
||||
@ -896,4 +818,4 @@ switch($mode)
|
||||
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user