(file) Return to admin_board.php CVS log (file) (dir) Up to [RizwankCVS] / geekymedia_web / phpBB2 / admin

  1 rizwank 1.1 <?php
  2             /***************************************************************************
  3              *                              admin_board.php
  4              *                            -------------------
  5              *   begin                : Thursday, Jul 12, 2001
  6              *   copyright            : (C) 2001 The phpBB Group
  7              *   email                : support@phpbb.com
  8              *
  9              *   $Id: admin_board.php,v 1.51.2.3 2002/12/19 17:17:39 psotfx Exp $
 10              *
 11              *
 12              ***************************************************************************/
 13             
 14             define('IN_PHPBB', 1);
 15             
 16             if( !empty($setmodules) )
 17             {
 18             	$file = basename(__FILE__);
 19             	$module['General']['Configuration'] = "$file?mode=config";
 20             	return;
 21             }
 22 rizwank 1.1 
 23             //
 24             // Let's set the root dir for phpBB
 25             //
 26             $phpbb_root_path = "./../";
 27             require($phpbb_root_path . 'extension.inc');
 28             require('./pagestart.' . $phpEx);
 29             include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
 30             
 31             //
 32             // Pull all config data
 33             //
 34             $sql = "SELECT *
 35             	FROM " . CONFIG_TABLE;
 36             if(!$result = $db->sql_query($sql))
 37             {
 38             	message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql);
 39             }
 40             else
 41             {
 42             	while( $row = $db->sql_fetchrow($result) )
 43 rizwank 1.1 	{
 44             		$config_name = $row['config_name'];
 45             		$config_value = $row['config_value'];
 46             		$default_config[$config_name] = $config_value;
 47             		
 48             		$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
 49             
 50             		if ($config_name == 'cookie_name')
 51             		{
 52             			$cookie_name = str_replace('.', '_', $new['cookie_name']);
 53             		}
 54             
 55             		if( isset($HTTP_POST_VARS['submit']) )
 56             		{
 57             			$sql = "UPDATE " . CONFIG_TABLE . " SET
 58             				config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'
 59             				WHERE config_name = '$config_name'";
 60             			if( !$db->sql_query($sql) )
 61             			{
 62             				message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql);
 63             			}
 64 rizwank 1.1 		}
 65             	}
 66             
 67             	if( isset($HTTP_POST_VARS['submit']) )
 68             	{
 69             		$message = $lang['Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
 70             
 71             		message_die(GENERAL_MESSAGE, $message);
 72             	}
 73             }
 74             
 75             $style_select = style_select($new['default_style'], 'default_style', "../templates");
 76             $lang_select = language_select($new['default_lang'], 'default_lang', "language");
 77             $timezone_select = tz_select($new['board_timezone'], 'board_timezone');
 78             
 79             $disable_board_yes = ( $new['board_disable'] ) ? "checked=\"checked\"" : "";
 80             $disable_board_no = ( !$new['board_disable'] ) ? "checked=\"checked\"" : "";
 81             
 82             $cookie_secure_yes = ( $new['cookie_secure'] ) ? "checked=\"checked\"" : "";
 83             $cookie_secure_no = ( !$new['cookie_secure'] ) ? "checked=\"checked\"" : "";
 84             
 85 rizwank 1.1 $html_tags = $new['allow_html_tags'];
 86             
 87             $override_user_style_yes = ( $new['override_user_style'] ) ? "checked=\"checked\"" : "";
 88             $override_user_style_no = ( !$new['override_user_style'] ) ? "checked=\"checked\"" : "";
 89             
 90             $html_yes = ( $new['allow_html'] ) ? "checked=\"checked\"" : "";
 91             $html_no = ( !$new['allow_html'] ) ? "checked=\"checked\"" : "";
 92             
 93             $bbcode_yes = ( $new['allow_bbcode'] ) ? "checked=\"checked\"" : "";
 94             $bbcode_no = ( !$new['allow_bbcode'] ) ? "checked=\"checked\"" : "";
 95             
 96             $activation_none = ( $new['require_activation'] == USER_ACTIVATION_NONE ) ? "checked=\"checked\"" : "";
 97             $activation_user = ( $new['require_activation'] == USER_ACTIVATION_SELF ) ? "checked=\"checked\"" : "";
 98             $activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\"checked\"" : "";
 99             
100             $board_email_form_yes = ( $new['board_email_form'] ) ? "checked=\"checked\"" : "";
101             $board_email_form_no = ( !$new['board_email_form'] ) ? "checked=\"checked\"" : "";
102             
103             $gzip_yes = ( $new['gzip_compress'] ) ? "checked=\"checked\"" : "";
104             $gzip_no = ( !$new['gzip_compress'] ) ? "checked=\"checked\"" : "";
105             
106 rizwank 1.1 $privmsg_on = ( !$new['privmsg_disable'] ) ? "checked=\"checked\"" : "";
107             $privmsg_off = ( $new['privmsg_disable'] ) ? "checked=\"checked\"" : "";
108             
109             $prune_yes = ( $new['prune_enable'] ) ? "checked=\"checked\"" : "";
110             $prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";
111             
112             $smile_yes = ( $new['allow_smilies'] ) ? "checked=\"checked\"" : "";
113             $smile_no = ( !$new['allow_smilies'] ) ? "checked=\"checked\"" : "";
114             
115             $sig_yes = ( $new['allow_sig'] ) ? "checked=\"checked\"" : "";
116             $sig_no = ( !$new['allow_sig'] ) ? "checked=\"checked\"" : "";
117             
118             $namechange_yes = ( $new['allow_namechange'] ) ? "checked=\"checked\"" : "";
119             $namechange_no = ( !$new['allow_namechange'] ) ? "checked=\"checked\"" : "";
120             
121             $avatars_local_yes = ( $new['allow_avatar_local'] ) ? "checked=\"checked\"" : "";
122             $avatars_local_no = ( !$new['allow_avatar_local'] ) ? "checked=\"checked\"" : "";
123             $avatars_remote_yes = ( $new['allow_avatar_remote'] ) ? "checked=\"checked\"" : "";
124             $avatars_remote_no = ( !$new['allow_avatar_remote'] ) ? "checked=\"checked\"" : "";
125             $avatars_upload_yes = ( $new['allow_avatar_upload'] ) ? "checked=\"checked\"" : "";
126             $avatars_upload_no = ( !$new['allow_avatar_upload'] ) ? "checked=\"checked\"" : "";
127 rizwank 1.1 
128             $smtp_yes = ( $new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
129             $smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
130             
131             $template->set_filenames(array(
132             	"body" => "admin/board_config_body.tpl")
133             );
134             
135             //
136             // Escape any quotes in the site description for proper display in the text
137             // box on the admin page 
138             //
139             $new['site_desc'] = str_replace('"', '&quot;', $new['site_desc']);
140             $new['sitename'] = str_replace('"', '&quot;', strip_tags($new['sitename']));
141             $template->assign_vars(array(
142             	"S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"),
143             
144             	"L_YES" => $lang['Yes'],
145             	"L_NO" => $lang['No'],
146             	"L_CONFIGURATION_TITLE" => $lang['General_Config'],
147             	"L_CONFIGURATION_EXPLAIN" => $lang['Config_explain'],
148 rizwank 1.1 	"L_GENERAL_SETTINGS" => $lang['General_settings'],
149             	"L_SERVER_NAME" => $lang['Server_name'], 
150             	"L_SERVER_NAME_EXPLAIN" => $lang['Server_name_explain'], 
151             	"L_SERVER_PORT" => $lang['Server_port'], 
152             	"L_SERVER_PORT_EXPLAIN" => $lang['Server_port_explain'], 
153             	"L_SCRIPT_PATH" => $lang['Script_path'], 
154             	"L_SCRIPT_PATH_EXPLAIN" => $lang['Script_path_explain'], 
155             	"L_SITE_NAME" => $lang['Site_name'],
156             	"L_SITE_DESCRIPTION" => $lang['Site_desc'],
157             	"L_DISABLE_BOARD" => $lang['Board_disable'], 
158             	"L_DISABLE_BOARD_EXPLAIN" => $lang['Board_disable_explain'], 
159             	"L_ACCT_ACTIVATION" => $lang['Acct_activation'], 
160             	"L_NONE" => $lang['Acc_None'], 
161             	"L_USER" => $lang['Acc_User'], 
162             	"L_ADMIN" => $lang['Acc_Admin'], 
163             	"L_COOKIE_SETTINGS" => $lang['Cookie_settings'], 
164             	"L_COOKIE_SETTINGS_EXPLAIN" => $lang['Cookie_settings_explain'], 
165             	"L_COOKIE_DOMAIN" => $lang['Cookie_domain'],
166             	"L_COOKIE_NAME" => $lang['Cookie_name'], 
167             	"L_COOKIE_PATH" => $lang['Cookie_path'], 
168             	"L_COOKIE_SECURE" => $lang['Cookie_secure'], 
169 rizwank 1.1 	"L_COOKIE_SECURE_EXPLAIN" => $lang['Cookie_secure_explain'], 
170             	"L_SESSION_LENGTH" => $lang['Session_length'], 
171             	"L_PRIVATE_MESSAGING" => $lang['Private_Messaging'], 
172             	"L_INBOX_LIMIT" => $lang['Inbox_limits'], 
173             	"L_SENTBOX_LIMIT" => $lang['Sentbox_limits'], 
174             	"L_SAVEBOX_LIMIT" => $lang['Savebox_limits'], 
175             	"L_DISABLE_PRIVATE_MESSAGING" => $lang['Disable_privmsg'], 
176             	"L_ENABLED" => $lang['Enabled'], 
177             	"L_DISABLED" => $lang['Disabled'], 
178             	"L_ABILITIES_SETTINGS" => $lang['Abilities_settings'],
179             	"L_MAX_POLL_OPTIONS" => $lang['Max_poll_options'],
180             	"L_FLOOD_INTERVAL" => $lang['Flood_Interval'],
181             	"L_FLOOD_INTERVAL_EXPLAIN" => $lang['Flood_Interval_explain'], 
182             	"L_BOARD_EMAIL_FORM" => $lang['Board_email_form'], 
183             	"L_BOARD_EMAIL_FORM_EXPLAIN" => $lang['Board_email_form_explain'], 
184             	"L_TOPICS_PER_PAGE" => $lang['Topics_per_page'],
185             	"L_POSTS_PER_PAGE" => $lang['Posts_per_page'],
186             	"L_HOT_THRESHOLD" => $lang['Hot_threshold'],
187             	"L_DEFAULT_STYLE" => $lang['Default_style'],
188             	"L_OVERRIDE_STYLE" => $lang['Override_style'],
189             	"L_OVERRIDE_STYLE_EXPLAIN" => $lang['Override_style_explain'],
190 rizwank 1.1 	"L_DEFAULT_LANGUAGE" => $lang['Default_language'],
191             	"L_DATE_FORMAT" => $lang['Date_format'],
192             	"L_SYSTEM_TIMEZONE" => $lang['System_timezone'],
193             	"L_ENABLE_GZIP" => $lang['Enable_gzip'],
194             	"L_ENABLE_PRUNE" => $lang['Enable_prune'],
195             	"L_ALLOW_HTML" => $lang['Allow_HTML'],
196             	"L_ALLOW_BBCODE" => $lang['Allow_BBCode'],
197             	"L_ALLOWED_TAGS" => $lang['Allowed_tags'],
198             	"L_ALLOWED_TAGS_EXPLAIN" => $lang['Allowed_tags_explain'],
199             	"L_ALLOW_SMILIES" => $lang['Allow_smilies'],
200             	"L_SMILIES_PATH" => $lang['Smilies_path'],
201             	"L_SMILIES_PATH_EXPLAIN" => $lang['Smilies_path_explain'],
202             	"L_ALLOW_SIG" => $lang['Allow_sig'],
203             	"L_MAX_SIG_LENGTH" => $lang['Max_sig_length'],
204             	"L_MAX_SIG_LENGTH_EXPLAIN" => $lang['Max_sig_length_explain'],
205             	"L_ALLOW_NAME_CHANGE" => $lang['Allow_name_change'],
206             	"L_AVATAR_SETTINGS" => $lang['Avatar_settings'],
207             	"L_ALLOW_LOCAL" => $lang['Allow_local'],
208             	"L_ALLOW_REMOTE" => $lang['Allow_remote'],
209             	"L_ALLOW_REMOTE_EXPLAIN" => $lang['Allow_remote_explain'],
210             	"L_ALLOW_UPLOAD" => $lang['Allow_upload'],
211 rizwank 1.1 	"L_MAX_FILESIZE" => $lang['Max_filesize'],
212             	"L_MAX_FILESIZE_EXPLAIN" => $lang['Max_filesize_explain'],
213             	"L_MAX_AVATAR_SIZE" => $lang['Max_avatar_size'],
214             	"L_MAX_AVATAR_SIZE_EXPLAIN" => $lang['Max_avatar_size_explain'],
215             	"L_AVATAR_STORAGE_PATH" => $lang['Avatar_storage_path'],
216             	"L_AVATAR_STORAGE_PATH_EXPLAIN" => $lang['Avatar_storage_path_explain'],
217             	"L_AVATAR_GALLERY_PATH" => $lang['Avatar_gallery_path'],
218             	"L_AVATAR_GALLERY_PATH_EXPLAIN" => $lang['Avatar_gallery_path_explain'],
219             	"L_COPPA_SETTINGS" => $lang['COPPA_settings'],
220             	"L_COPPA_FAX" => $lang['COPPA_fax'],
221             	"L_COPPA_MAIL" => $lang['COPPA_mail'],
222             	"L_COPPA_MAIL_EXPLAIN" => $lang['COPPA_mail_explain'],
223             	"L_EMAIL_SETTINGS" => $lang['Email_settings'],
224             	"L_ADMIN_EMAIL" => $lang['Admin_email'],
225             	"L_EMAIL_SIG" => $lang['Email_sig'],
226             	"L_EMAIL_SIG_EXPLAIN" => $lang['Email_sig_explain'],
227             	"L_USE_SMTP" => $lang['Use_SMTP'],
228             	"L_USE_SMTP_EXPLAIN" => $lang['Use_SMTP_explain'],
229             	"L_SMTP_SERVER" => $lang['SMTP_server'], 
230             	"L_SMTP_USERNAME" => $lang['SMTP_username'], 
231             	"L_SMTP_USERNAME_EXPLAIN" => $lang['SMTP_username_explain'], 
232 rizwank 1.1 	"L_SMTP_PASSWORD" => $lang['SMTP_password'], 
233             	"L_SMTP_PASSWORD_EXPLAIN" => $lang['SMTP_password_explain'], 
234             	"L_SUBMIT" => $lang['Submit'], 
235             	"L_RESET" => $lang['Reset'], 
236             	
237             	"SERVER_NAME" => $new['server_name'], 
238             	"SCRIPT_PATH" => $new['script_path'], 
239             	"SERVER_PORT" => $new['server_port'], 
240             	"SITENAME" => $new['sitename'],
241             	"SITE_DESCRIPTION" => $new['site_desc'], 
242             	"S_DISABLE_BOARD_YES" => $disable_board_yes,
243             	"S_DISABLE_BOARD_NO" => $disable_board_no,
244             	"ACTIVATION_NONE" => USER_ACTIVATION_NONE, 
245             	"ACTIVATION_NONE_CHECKED" => $activation_none,
246             	"ACTIVATION_USER" => USER_ACTIVATION_SELF, 
247             	"ACTIVATION_USER_CHECKED" => $activation_user,
248             	"ACTIVATION_ADMIN" => USER_ACTIVATION_ADMIN, 
249             	"ACTIVATION_ADMIN_CHECKED" => $activation_admin, 
250             	"BOARD_EMAIL_FORM_ENABLE" => $board_email_form_yes, 
251             	"BOARD_EMAIL_FORM_DISABLE" => $board_email_form_no, 
252             	"MAX_POLL_OPTIONS" => $new['max_poll_options'], 
253 rizwank 1.1 	"FLOOD_INTERVAL" => $new['flood_interval'],
254             	"TOPICS_PER_PAGE" => $new['topics_per_page'],
255             	"POSTS_PER_PAGE" => $new['posts_per_page'],
256             	"HOT_TOPIC" => $new['hot_threshold'],
257             	"STYLE_SELECT" => $style_select,
258             	"OVERRIDE_STYLE_YES" => $override_user_style_yes,
259             	"OVERRIDE_STYLE_NO" => $override_user_style_no,
260             	"LANG_SELECT" => $lang_select,
261             	"L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'],
262             	"DEFAULT_DATEFORMAT" => $new['default_dateformat'],
263             	"TIMEZONE_SELECT" => $timezone_select,
264             	"S_PRIVMSG_ENABLED" => $privmsg_on, 
265             	"S_PRIVMSG_DISABLED" => $privmsg_off, 
266             	"INBOX_LIMIT" => $new['max_inbox_privmsgs'], 
267             	"SENTBOX_LIMIT" => $new['max_sentbox_privmsgs'],
268             	"SAVEBOX_LIMIT" => $new['max_savebox_privmsgs'],
269             	"COOKIE_DOMAIN" => $new['cookie_domain'], 
270             	"COOKIE_NAME" => $new['cookie_name'], 
271             	"COOKIE_PATH" => $new['cookie_path'], 
272             	"SESSION_LENGTH" => $new['session_length'], 
273             	"S_COOKIE_SECURE_ENABLED" => $cookie_secure_yes, 
274 rizwank 1.1 	"S_COOKIE_SECURE_DISABLED" => $cookie_secure_no, 
275             	"GZIP_YES" => $gzip_yes,
276             	"GZIP_NO" => $gzip_no,
277             	"PRUNE_YES" => $prune_yes,
278             	"PRUNE_NO" => $prune_no, 
279             	"HTML_TAGS" => $html_tags, 
280             	"HTML_YES" => $html_yes,
281             	"HTML_NO" => $html_no,
282             	"BBCODE_YES" => $bbcode_yes,
283             	"BBCODE_NO" => $bbcode_no,
284             	"SMILE_YES" => $smile_yes,
285             	"SMILE_NO" => $smile_no,
286             	"SIG_YES" => $sig_yes,
287             	"SIG_NO" => $sig_no,
288             	"SIG_SIZE" => $new['max_sig_chars'], 
289             	"NAMECHANGE_YES" => $namechange_yes,
290             	"NAMECHANGE_NO" => $namechange_no,
291             	"AVATARS_LOCAL_YES" => $avatars_local_yes,
292             	"AVATARS_LOCAL_NO" => $avatars_local_no,
293             	"AVATARS_REMOTE_YES" => $avatars_remote_yes,
294             	"AVATARS_REMOTE_NO" => $avatars_remote_no,
295 rizwank 1.1 	"AVATARS_UPLOAD_YES" => $avatars_upload_yes,
296             	"AVATARS_UPLOAD_NO" => $avatars_upload_no,
297             	"AVATAR_FILESIZE" => $new['avatar_filesize'],
298             	"AVATAR_MAX_HEIGHT" => $new['avatar_max_height'],
299             	"AVATAR_MAX_WIDTH" => $new['avatar_max_width'],
300             	"AVATAR_PATH" => $new['avatar_path'], 
301             	"AVATAR_GALLERY_PATH" => $new['avatar_gallery_path'], 
302             	"SMILIES_PATH" => $new['smilies_path'], 
303             	"INBOX_PRIVMSGS" => $new['max_inbox_privmsgs'], 
304             	"SENTBOX_PRIVMSGS" => $new['max_sentbox_privmsgs'], 
305             	"SAVEBOX_PRIVMSGS" => $new['max_savebox_privmsgs'], 
306             	"EMAIL_FROM" => $new['board_email'],
307             	"EMAIL_SIG" => $new['board_email_sig'],
308             	"SMTP_YES" => $smtp_yes,
309             	"SMTP_NO" => $smtp_no,
310             	"SMTP_HOST" => $new['smtp_host'],
311             	"SMTP_USERNAME" => $new['smtp_username'],
312             	"SMTP_PASSWORD" => $new['smtp_password'],
313             	"COPPA_MAIL" => $new['coppa_mail'],
314             	"COPPA_FAX" => $new['coppa_fax'])
315             );
316 rizwank 1.1 
317             $template->pparse("body");
318             
319             include('./page_footer_admin.'.$phpEx);
320             
321             ?>

Rizwan Kassim
Powered by
ViewCVS 0.9.2