Vergleich admin/modules/config/settings.php - 1.6.3 - 1.6.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: settings.php 5380 2011-02-21 12:04:43Z Tomm $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 34Zeile 34
		INNER JOIN ".TABLE_PREFIX."settinggroups g2 ON (g2.title=g1.title AND g2.gid!=g1.gid AND g2.gid < g1.gid)
");
rebuild_settings();

		INNER JOIN ".TABLE_PREFIX."settinggroups g2 ON (g2.title=g1.title AND g2.gid!=g1.gid AND g2.gid < g1.gid)
");
rebuild_settings();

	



	$plugins->run_hooks("admin_config_settings_delete_duplicates_commit");

	$plugins->run_hooks("admin_config_settings_delete_duplicates_commit");

	



	// Log admin action
log_admin_action();

	// Log admin action
log_admin_action();





	flash_message($lang->success_duplicate_settings_deleted, 'success');
admin_redirect("index.php?module=config-settings&action=manage");
}*/

	flash_message($lang->success_duplicate_settings_deleted, 'success');
admin_redirect("index.php?module=config-settings&action=manage");
}*/

Zeile 49Zeile 49
if($mybb->input['action'] == "addgroup")
{
$plugins->run_hooks("admin_config_settings_addgroup");

if($mybb->input['action'] == "addgroup")
{
$plugins->run_hooks("admin_config_settings_addgroup");

	
if($mybb->request_method == "post")
{
// Validate title
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_group_title;


if($mybb->request_method == "post")
{
// Validate title
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_group_title;

		}

		}

		



		// Validate identifier
if(!trim($mybb->input['name']))
{

		// Validate identifier
if(!trim($mybb->input['name']))
{

Zeile 73Zeile 73
		if(!$errors)
{
$new_setting_group = array(

		if(!$errors)
{
$new_setting_group = array(

				"name" => $db->escape_string($mybb->input['name']),
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

				"name" => $db->escape_string($mybb->input['name']),
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

				"disporder" => intval($mybb->input['disporder']),
"isdefault" => 0
);
$gid = $db->insert_query("settinggroups", $new_setting_group);

				"disporder" => intval($mybb->input['disporder']),
"isdefault" => 0
);
$gid = $db->insert_query("settinggroups", $new_setting_group);

			
$plugins->run_hooks("admin_config_settings_addgroup_commit");


$plugins->run_hooks("admin_config_settings_addgroup_commit");


// Log admin action
log_admin_action($gid, $mybb->input['name']);


// Log admin action
log_admin_action($gid, $mybb->input['name']);

Zeile 90Zeile 90
			admin_redirect("index.php?module=config-settings&action=manage");
}
}

			admin_redirect("index.php?module=config-settings&action=manage");
}
}





	$page->add_breadcrumb_item($lang->add_new_setting_group);
$page->output_header($lang->board_settings." - ".$lang->add_new_setting_group);

	$page->add_breadcrumb_item($lang->add_new_setting_group);
$page->output_header($lang->board_settings." - ".$lang->add_new_setting_group);

	



	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings"
);

	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings"
);

	



	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add"
);

	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add"
);

	



	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup",
'description' => $lang->add_new_setting_group_desc

	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup",
'description' => $lang->add_new_setting_group_desc

	);


	);


	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage"
);

	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage"
);





	$page->output_nav_tabs($sub_tabs, 'add_setting_group');

$form = new Form("index.php?module=config-settings&amp;action=addgroup", "post", "add");

	$page->output_nav_tabs($sub_tabs, 'add_setting_group');

$form = new Form("index.php?module=config-settings&amp;action=addgroup", "post", "add");





	if($errors)
{
$page->output_inline_error($errors);
}

	if($errors)
{
$page->output_inline_error($errors);
}





	$form_container = new FormContainer($lang->add_new_setting_group);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $mybb->input['description'], array('id' => 'description')), 'description');
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');
$form_container->output_row($lang->name." <em>*</em>", $lang->group_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->end();

	$form_container = new FormContainer($lang->add_new_setting_group);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $mybb->input['description'], array('id' => 'description')), 'description');
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');
$form_container->output_row($lang->name." <em>*</em>", $lang->group_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->end();





	$buttons[] = $form->generate_submit_button($lang->insert_new_setting_group);
$form->output_submit_wrapper($buttons);
$form->end();

$page->output_footer();
}

	$buttons[] = $form->generate_submit_button($lang->insert_new_setting_group);
$form->output_submit_wrapper($buttons);
$form->end();

$page->output_footer();
}





// Edit setting group
if($mybb->input['action'] == "editgroup")
{
$plugins->run_hooks("admin_config_settings_editgroup");

// Edit setting group
if($mybb->input['action'] == "editgroup")
{
$plugins->run_hooks("admin_config_settings_editgroup");

	



	$query = $db->simple_select("settinggroups", "*", "gid='".intval($mybb->input['gid'])."'");
$group = $db->fetch_array($query);


	$query = $db->simple_select("settinggroups", "*", "gid='".intval($mybb->input['gid'])."'");
$group = $db->fetch_array($query);


Zeile 158Zeile 158
		flash_message($lang->error_cannot_edit_default, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

		flash_message($lang->error_cannot_edit_default, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

	



	// Do edit?
if($mybb->request_method == "post")
{

	// Do edit?
if($mybb->request_method == "post")
{

Zeile 167Zeile 167
		{
$errors[] = $lang->error_missing_group_title;
}

		{
$errors[] = $lang->error_missing_group_title;
}

		



		// Validate identifier
if(!trim($mybb->input['name']))
{

		// Validate identifier
if(!trim($mybb->input['name']))
{

Zeile 188Zeile 188
				"description" => $db->escape_string($mybb->input['description']),
"disporder" => intval($mybb->input['disporder']),
);

				"description" => $db->escape_string($mybb->input['description']),
"disporder" => intval($mybb->input['disporder']),
);

			



			$db->update_query("settinggroups", $update_setting_group, "gid='{$group['gid']}'");

			$db->update_query("settinggroups", $update_setting_group, "gid='{$group['gid']}'");

			



			$plugins->run_hooks("admin_config_settings_editgroup_commit");

			$plugins->run_hooks("admin_config_settings_editgroup_commit");





			// Log admin action
log_admin_action($group['gid'], $mybb->input['name']);

flash_message($lang->success_setting_group_updated, 'success');

			// Log admin action
log_admin_action($group['gid'], $mybb->input['name']);

flash_message($lang->success_setting_group_updated, 'success');

			admin_redirect("index.php?module=config-settings&action=manage");
}

			admin_redirect("index.php?module=config-settings&action=manage");
}

	}

	}





	$page->add_breadcrumb_item($lang->edit_setting_group);
$page->output_header($lang->board_settings." - ".$lang->edit_setting_group);

	$page->add_breadcrumb_item($lang->edit_setting_group);
$page->output_header($lang->board_settings." - ".$lang->edit_setting_group);

	



	$sub_tabs['edit_setting_group'] = array(
'title' => $lang->edit_setting_group,
'link' => "index.php?module=config-settings&amp;action=editgroup&amp;gid={$group['gid']}",
'description' => $lang->edit_setting_group_desc
);


	$sub_tabs['edit_setting_group'] = array(
'title' => $lang->edit_setting_group,
'link' => "index.php?module=config-settings&amp;action=editgroup&amp;gid={$group['gid']}",
'description' => $lang->edit_setting_group_desc
);


	$page->output_nav_tabs($sub_tabs, 'edit_setting_group');

$form = new Form("index.php?module=config-settings&amp;action=editgroup", "post", "editgroup");

	$page->output_nav_tabs($sub_tabs, 'edit_setting_group');

$form = new Form("index.php?module=config-settings&amp;action=editgroup", "post", "editgroup");


echo $form->generate_hidden_field("gid", $group['gid']);


echo $form->generate_hidden_field("gid", $group['gid']);

	



	if($errors)
{
$group_data = $mybb->input;

	if($errors)
{
$group_data = $mybb->input;

Zeile 238Zeile 238
	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

}

}


// Delete Setting Group
if($mybb->input['action'] == "deletegroup")
{
$plugins->run_hooks("admin_config_settings_deletegroup");


// Delete Setting Group
if($mybb->input['action'] == "deletegroup")
{
$plugins->run_hooks("admin_config_settings_deletegroup");

	



	$query = $db->simple_select("settinggroups", "*", "gid='".intval($mybb->input['gid'])."'");
$group = $db->fetch_array($query);


	$query = $db->simple_select("settinggroups", "*", "gid='".intval($mybb->input['gid'])."'");
$group = $db->fetch_array($query);


Zeile 258Zeile 258
	if($group['isdefault'] == 1)
{
flash_message($lang->error_cannot_edit_default, 'error');

	if($group['isdefault'] == 1)
{
flash_message($lang->error_cannot_edit_default, 'error');

		admin_redirect("index.php?module=config-settings&action=manage");

		admin_redirect("index.php?module=config-settings&action=manage");

	}

	}

	



	// User clicked no
if($mybb->input['no'])
{
admin_redirect("index.php?module=config-settings&action=manage");
}

	// User clicked no
if($mybb->input['no'])
{
admin_redirect("index.php?module=config-settings&action=manage");
}





	if($mybb->request_method == "post")
{
// Delete the setting group and its settings
$db->delete_query("settinggroups", "gid='{$group['gid']}'");
$db->delete_query("settings", "gid='{$group['gid']}'");

	if($mybb->request_method == "post")
{
// Delete the setting group and its settings
$db->delete_query("settinggroups", "gid='{$group['gid']}'");
$db->delete_query("settings", "gid='{$group['gid']}'");

		



		rebuild_settings();

		rebuild_settings();

		



		$plugins->run_hooks("admin_config_settings_deletegroup_commit");

// Log admin action
log_admin_action($group['gid'], $group['name']);

		$plugins->run_hooks("admin_config_settings_deletegroup_commit");

// Log admin action
log_admin_action($group['gid'], $group['name']);





		flash_message($lang->success_setting_group_deleted, 'success');
admin_redirect("index.php?module=config-settings&action=manage");

		flash_message($lang->success_setting_group_deleted, 'success');
admin_redirect("index.php?module=config-settings&action=manage");

	}

	}

	else

	else

	{

	{

		$page->output_confirm_action("index.php?module=config-settings&amp;action=deletegroup&amp;gid={$group['gid']}", $lang->confirm_setting_group_deletion);
}
}

		$page->output_confirm_action("index.php?module=config-settings&amp;action=deletegroup&amp;gid={$group['gid']}", $lang->confirm_setting_group_deletion);
}
}

Zeile 293Zeile 293
if($mybb->input['action'] == "add")
{
$plugins->run_hooks("admin_config_settings_add");

if($mybb->input['action'] == "add")
{
$plugins->run_hooks("admin_config_settings_add");

	



	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;

	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;

		}

		}


$query = $db->simple_select("settinggroups", "gid", "gid='".intval($mybb->input['gid'])."'");
$gid = $db->fetch_field($query, 'gid');
if(!$gid)
{
$errors[] = $lang->error_invalid_gid;


$query = $db->simple_select("settinggroups", "gid", "gid='".intval($mybb->input['gid'])."'");
$gid = $db->fetch_field($query, 'gid');
if(!$gid)
{
$errors[] = $lang->error_invalid_gid;

		}


		}


		if(!trim($mybb->input['name']))
{
$errors[] = $lang->error_missing_name;

		if(!trim($mybb->input['name']))
{
$errors[] = $lang->error_missing_name;

Zeile 317Zeile 317
		{
$dup_setting_title = $db->fetch_field($query, 'title');
$errors[] = $lang->sprintf($lang->error_duplicate_name, $dup_setting_title);

		{
$dup_setting_title = $db->fetch_field($query, 'title');
$errors[] = $lang->sprintf($lang->error_duplicate_name, $dup_setting_title);

		}


		}


		// do some type filtering
$mybb->input['type'] = str_replace("\n", "", $mybb->input['type']);
if(strtolower(substr($mybb->input['type'], 0, 3)) == "php")

		// do some type filtering
$mybb->input['type'] = str_replace("\n", "", $mybb->input['type']);
if(strtolower(substr($mybb->input['type'], 0, 3)) == "php")

Zeile 345Zeile 345
			{
$options_code = $mybb->input['type'];
}

			{
$options_code = $mybb->input['type'];
}

			



			$new_setting = array(
"name" => $db->escape_string($mybb->input['name']),
"title" => $db->escape_string($mybb->input['title']),

			$new_setting = array(
"name" => $db->escape_string($mybb->input['name']),
"title" => $db->escape_string($mybb->input['title']),

Zeile 355Zeile 355
				"disporder" => intval($mybb->input['disporder']),
"gid" => intval($mybb->input['gid'])
);

				"disporder" => intval($mybb->input['disporder']),
"gid" => intval($mybb->input['gid'])
);

			



			$sid = $db->insert_query("settings", $new_setting);
rebuild_settings();

			$sid = $db->insert_query("settings", $new_setting);
rebuild_settings();

			



			$plugins->run_hooks("admin_config_settings_add_commit");

// Log admin action

			$plugins->run_hooks("admin_config_settings_add_commit");

// Log admin action

Zeile 371Zeile 371

$page->add_breadcrumb_item($lang->add_new_setting);
$page->output_header($lang->board_settings." - ".$lang->add_new_setting);


$page->add_breadcrumb_item($lang->add_new_setting);
$page->output_header($lang->board_settings." - ".$lang->add_new_setting);

	



	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings"
);

	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings"
);

	



	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add",
'description' => $lang->add_new_setting_desc

	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add",
'description' => $lang->add_new_setting_desc

	);


	);


	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup"
);

	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup"
);

	



	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage"

	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage"

	);


	);


	$page->output_nav_tabs($sub_tabs, 'add_setting');

$form = new Form("index.php?module=config-settings&amp;action=add", "post", "add");

	$page->output_nav_tabs($sub_tabs, 'add_setting');

$form = new Form("index.php?module=config-settings&amp;action=add", "post", "add");

Zeile 401Zeile 401
	{
$page->output_inline_error($errors);
}

	{
$page->output_inline_error($errors);
}





	$form_container = new FormContainer($lang->add_new_setting);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $mybb->input['description'], array('id' => 'description')), 'description');

	$form_container = new FormContainer($lang->add_new_setting);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $mybb->input['description'], array('id' => 'description')), 'description');

	



	$query = $db->simple_select("settinggroups", "*", "", array('order_by' => 'disporder'));
while($group = $db->fetch_array($query))
{
$options[$group['gid']] = $group['title'];

	$query = $db->simple_select("settinggroups", "*", "", array('order_by' => 'disporder'));
while($group = $db->fetch_array($query))
{
$options[$group['gid']] = $group['title'];

	}

	}

	$form_container->output_row($lang->group." <em>*</em>", "", $form->generate_select_box("gid", $options, $mybb->input['gid'], array('id' => 'gid')), 'gid');
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');


	$form_container->output_row($lang->group." <em>*</em>", "", $form->generate_select_box("gid", $options, $mybb->input['gid'], array('id' => 'gid')), 'gid');
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');


Zeile 438Zeile 438
	$buttons[] = $form->generate_submit_button($lang->insert_new_setting);
$form->output_submit_wrapper($buttons);
$form->end();

	$buttons[] = $form->generate_submit_button($lang->insert_new_setting);
$form->output_submit_wrapper($buttons);
$form->end();

	



	echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>
<script type="text/javascript">Event.observe(window, "load", function() {var peeker = new Peeker($("type"), $("row_extra"), /select|radio|checkbox|php/, false);});
// Add a star to the extra row since the "extra" is required if the box is shown

	echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>
<script type="text/javascript">Event.observe(window, "load", function() {var peeker = new Peeker($("type"), $("row_extra"), /select|radio|checkbox|php/, false);});
// Add a star to the extra row since the "extra" is required if the box is shown

Zeile 452Zeile 452
if($mybb->input['action'] == "edit")
{
$plugins->run_hooks("admin_config_settings_edit");

if($mybb->input['action'] == "edit")
{
$plugins->run_hooks("admin_config_settings_edit");

	



	$query = $db->simple_select("settings", "*", "sid='".intval($mybb->input['sid'])."'");
$setting = $db->fetch_array($query);

	$query = $db->simple_select("settings", "*", "sid='".intval($mybb->input['sid'])."'");
$setting = $db->fetch_array($query);





	// Does the setting not exist?
if(!$setting['sid'])
{
flash_message($lang->error_invalid_sid, 'error');
admin_redirect("index.php?module=config-settings");
}

	// Does the setting not exist?
if(!$setting['sid'])
{
flash_message($lang->error_invalid_sid, 'error');
admin_redirect("index.php?module=config-settings");
}

	



	// Prevent editing of default
if($setting['isdefault'] == 1)

	// Prevent editing of default
if($setting['isdefault'] == 1)

	{

	{

		flash_message($lang->error_cannot_edit_default, 'error');

		flash_message($lang->error_cannot_edit_default, 'error');

		admin_redirect("index.php?module=config-settings&action=manage");
}

		admin_redirect("index.php?module=config-settings&action=manage");
}

	$type = explode("\n", $setting['optionscode'], 2);
$type = trim($type[0]);
if($type == "php")

	$type = explode("\n", $setting['optionscode'], 2);
$type = trim($type[0]);
if($type == "php")

Zeile 476Zeile 476
		flash_message($lang->error_cannot_edit_php, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

		flash_message($lang->error_cannot_edit_php, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

	



	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

Zeile 494Zeile 494
			$dup_setting_title = $db->fetch_field($query, 'title');
$errors[] = $lang->sprintf($lang->error_duplicate_name, $dup_setting_title);
}

			$dup_setting_title = $db->fetch_field($query, 'title');
$errors[] = $lang->sprintf($lang->error_duplicate_name, $dup_setting_title);
}

		



		// do some type filtering
$mybb->input['type'] = str_replace("\n", "", $mybb->input['type']);
if(strtolower(substr($mybb->input['type'], 0, 3)) == "php")
{
$mybb->input['type'] = "";
}

		// do some type filtering
$mybb->input['type'] = str_replace("\n", "", $mybb->input['type']);
if(strtolower(substr($mybb->input['type'], 0, 3)) == "php")
{
$mybb->input['type'] = "";
}

		



		if(!$mybb->input['type'])

		if(!$mybb->input['type'])

		{

		{

			$errors[] = $lang->error_invalid_type;
}

if(!$errors)
{
if($mybb->input['type'] == "custom")

			$errors[] = $lang->error_invalid_type;
}

if(!$errors)
{
if($mybb->input['type'] == "custom")

			{

			{

				$options_code = $mybb->input['extra'];

				$options_code = $mybb->input['extra'];

			}

			}

			else if($mybb->input['extra'])

			else if($mybb->input['extra'])

			{

			{

				$options_code = "{$mybb->input['type']}\n{$mybb->input['extra']}";
}
else
{
$options_code = $mybb->input['type'];

				$options_code = "{$mybb->input['type']}\n{$mybb->input['extra']}";
}
else
{
$options_code = $mybb->input['type'];

			}

			}

			$updated_setting = array(
"name" => $db->escape_string($mybb->input['name']),
"title" => $db->escape_string($mybb->input['title']),

			$updated_setting = array(
"name" => $db->escape_string($mybb->input['name']),
"title" => $db->escape_string($mybb->input['title']),

Zeile 532Zeile 532
			);
$db->update_query("settings", $updated_setting, "sid='{$mybb->input['sid']}'");
rebuild_settings();

			);
$db->update_query("settings", $updated_setting, "sid='{$mybb->input['sid']}'");
rebuild_settings();

			



			$plugins->run_hooks("admin_config_settings_edit_commit");

// Log admin action

			$plugins->run_hooks("admin_config_settings_edit_commit");

// Log admin action

Zeile 545Zeile 545

$page->add_breadcrumb_item($lang->edit_setting);
$page->output_header($lang->board_settings." - ".$lang->edit_setting);


$page->add_breadcrumb_item($lang->edit_setting);
$page->output_header($lang->board_settings." - ".$lang->edit_setting);

	



	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings",

	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings",

	);


	);


	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add"
);

	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add"
);

	



	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup"
);

	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup"
);

	



	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage",
'description' => $lang->modify_existing_settings_desc
);


	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage",
'description' => $lang->modify_existing_settings_desc
);


	$page->output_nav_tabs($sub_tabs, 'modify_setting');

$form = new Form("index.php?module=config-settings&amp;action=edit", "post", "edit");

	$page->output_nav_tabs($sub_tabs, 'modify_setting');

$form = new Form("index.php?module=config-settings&amp;action=edit", "post", "edit");


echo $form->generate_hidden_field("sid", $setting['sid']);


echo $form->generate_hidden_field("sid", $setting['sid']);

	



	if($errors)
{
$setting_data = $mybb->input;
$page->output_inline_error($errors);

	if($errors)
{
$setting_data = $mybb->input;
$page->output_inline_error($errors);

	}

	}

	else
{
$setting_data = $setting;

	else
{
$setting_data = $setting;

Zeile 589Zeile 589
	$form_container = new FormContainer($lang->modify_setting);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $setting_data['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $setting_data['description'], array('id' => 'description')), 'description');

	$form_container = new FormContainer($lang->modify_setting);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $setting_data['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $setting_data['description'], array('id' => 'description')), 'description');

	



	$query = $db->simple_select("settinggroups", "*", "", array('order_by' => 'disporder'));
while($group = $db->fetch_array($query))
{

	$query = $db->simple_select("settinggroups", "*", "", array('order_by' => 'disporder'));
while($group = $db->fetch_array($query))
{

Zeile 624Zeile 624
	$buttons[] = $form->generate_submit_button($lang->update_setting);
$form->output_submit_wrapper($buttons);
$form->end();

	$buttons[] = $form->generate_submit_button($lang->update_setting);
$form->output_submit_wrapper($buttons);
$form->end();

	



	echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>
<script type="text/javascript">Event.observe(window, "load", function() {var peeker = new Peeker($("type"), $("row_extra"), /select|radio|checkbox|php/, false);});
// Add a star to the extra row since the "extra" is required if the box is shown
add_star("row_extra");
</script>';

	echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>
<script type="text/javascript">Event.observe(window, "load", function() {var peeker = new Peeker($("type"), $("row_extra"), /select|radio|checkbox|php/, false);});
// Add a star to the extra row since the "extra" is required if the box is shown
add_star("row_extra");
</script>';





	$page->output_footer();
}


	$page->output_footer();
}


Zeile 638Zeile 638
if($mybb->input['action'] == "delete")
{
$plugins->run_hooks("admin_config_settings_delete");

if($mybb->input['action'] == "delete")
{
$plugins->run_hooks("admin_config_settings_delete");

	



	$query = $db->simple_select("settings", "*", "sid='".intval($mybb->input['sid'])."'");
$setting = $db->fetch_array($query);

	$query = $db->simple_select("settings", "*", "sid='".intval($mybb->input['sid'])."'");
$setting = $db->fetch_array($query);





	// Does the setting not exist?
if(!$setting['sid'])
{
flash_message($lang->error_invalid_sid, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

	// Does the setting not exist?
if(!$setting['sid'])
{
flash_message($lang->error_invalid_sid, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

	





	// Prevent editing of default
if($setting['isdefault'] == 1)
{
flash_message($lang->error_cannot_edit_default, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

	// Prevent editing of default
if($setting['isdefault'] == 1)
{
flash_message($lang->error_cannot_edit_default, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

	



	// User clicked no
if($mybb->input['no'])

	// User clicked no
if($mybb->input['no'])

	{

	{

		admin_redirect("index.php?module=config-settings&action=manage");
}

		admin_redirect("index.php?module=config-settings&action=manage");
}





	if($mybb->request_method == "post")
{
// Delete the setting
$db->delete_query("settings", "sid='{$setting['sid']}'");

	if($mybb->request_method == "post")
{
// Delete the setting
$db->delete_query("settings", "sid='{$setting['sid']}'");

		



		rebuild_settings();

		rebuild_settings();

		



		$plugins->run_hooks("admin_config_settings_delete_commit");

// Log admin action

		$plugins->run_hooks("admin_config_settings_delete_commit");

// Log admin action

Zeile 688Zeile 688
if($mybb->input['action'] == "manage")
{
$plugins->run_hooks("admin_config_settings_manage");

if($mybb->input['action'] == "manage")
{
$plugins->run_hooks("admin_config_settings_manage");

	



	// Update orders
if($mybb->request_method == "post")
{

	// Update orders
if($mybb->request_method == "post")
{

Zeile 701Zeile 701
				$db->update_query("settinggroups", $update_group, "gid={$gid}");
}
}

				$db->update_query("settinggroups", $update_group, "gid={$gid}");
}
}

		



		if(is_array($mybb->input['setting_disporder']))
{
foreach($mybb->input['setting_disporder'] as $sid => $new_order)

		if(is_array($mybb->input['setting_disporder']))
{
foreach($mybb->input['setting_disporder'] as $sid => $new_order)

Zeile 711Zeile 711
				$db->update_query("settings", $update_setting, "sid={$sid}");
}
}

				$db->update_query("settings", $update_setting, "sid={$sid}");
}
}

		
$plugins->run_hooks("admin_config_settings_manage_commit");


$plugins->run_hooks("admin_config_settings_manage_commit");


// Log admin action
log_admin_action();


// Log admin action
log_admin_action();

		



		flash_message($lang->success_display_orders_updated, 'success');
admin_redirect("index.php?module=config-settings&action=manage");
}

		flash_message($lang->success_display_orders_updated, 'success');
admin_redirect("index.php?module=config-settings&action=manage");
}

	



	$page->add_breadcrumb_item($lang->modify_existing_settings);
$page->output_header($lang->board_settings." - ".$lang->modify_existing_settings);

	$page->add_breadcrumb_item($lang->modify_existing_settings);
$page->output_header($lang->board_settings." - ".$lang->modify_existing_settings);

	



	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings",
);

	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings",
);

	



	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add"
);

	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add"
);

	



	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup"
);

	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup"
);

	



	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage",

	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage",

Zeile 746Zeile 746
	);

$page->output_nav_tabs($sub_tabs, 'modify_setting');

	);

$page->output_nav_tabs($sub_tabs, 'modify_setting');

	



	// Cache settings
$settings_cache = array();
$query = $db->simple_select("settings", "sid, name, title, disporder, gid, isdefault", "", array('order_by' => 'disporder', 'order_dir' => 'asc'));
while($setting = $db->fetch_array($query))
{
$settings_cache[$setting['gid']][] = $setting;

	// Cache settings
$settings_cache = array();
$query = $db->simple_select("settings", "sid, name, title, disporder, gid, isdefault", "", array('order_by' => 'disporder', 'order_dir' => 'asc'));
while($setting = $db->fetch_array($query))
{
$settings_cache[$setting['gid']][] = $setting;

	}


	}


	$form = new Form("index.php?module=config-settings&amp;action=manage", "post", "edit");

	$form = new Form("index.php?module=config-settings&amp;action=manage", "post", "edit");

	



	$table = new Table;

$table->construct_header($lang->setting_group_setting);
$table->construct_header($lang->order, array('class' => 'align_center', 'style' => 'width: 5%'));
$table->construct_header($lang->controls, array('class' => 'align_center', 'style' => 'width: 200px'));

	$table = new Table;

$table->construct_header($lang->setting_group_setting);
$table->construct_header($lang->order, array('class' => 'align_center', 'style' => 'width: 5%'));
$table->construct_header($lang->controls, array('class' => 'align_center', 'style' => 'width: 200px'));

	



	// Generate table
$query = $db->simple_select("settinggroups", "*", "", array('order_by' => 'disporder', 'order_dir' => 'asc'));
while($group = $db->fetch_array($query))

	// Generate table
$query = $db->simple_select("settinggroups", "*", "", array('order_by' => 'disporder', 'order_dir' => 'asc'));
while($group = $db->fetch_array($query))

Zeile 773Zeile 773
		if($lang->$group_lang_var)
{
$group_title = htmlspecialchars_uni($lang->$group_lang_var);

		if($lang->$group_lang_var)
{
$group_title = htmlspecialchars_uni($lang->$group_lang_var);

		}

		}

		else
{
$group_title = htmlspecialchars_uni($group['title']);

		else
{
$group_title = htmlspecialchars_uni($group['title']);

Zeile 782Zeile 782
		$table->construct_cell($form->generate_text_box("group_disporder[{$group['gid']}]", $group['disporder'], array('style' => 'width: 80%; font-weight: bold', 'class' => 'align_center')));
// Only show options if not a default setting group
if($group['isdefault'] != 1)

		$table->construct_cell($form->generate_text_box("group_disporder[{$group['gid']}]", $group['disporder'], array('style' => 'width: 80%; font-weight: bold', 'class' => 'align_center')));
// Only show options if not a default setting group
if($group['isdefault'] != 1)

		{

		{

			$popup = new PopupMenu("group_{$group['gid']}", $lang->options);
$popup->add_item($lang->edit_setting_group, "index.php?module=config-settings&amp;action=editgroup&amp;gid={$group['gid']}");
$popup->add_item($lang->delete_setting_group, "index.php?module=config-settings&amp;action=deletegroup&amp;gid={$group['gid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_setting_group_deletion}')");

			$popup = new PopupMenu("group_{$group['gid']}", $lang->options);
$popup->add_item($lang->edit_setting_group, "index.php?module=config-settings&amp;action=editgroup&amp;gid={$group['gid']}");
$popup->add_item($lang->delete_setting_group, "index.php?module=config-settings&amp;action=deletegroup&amp;gid={$group['gid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_setting_group_deletion}')");

Zeile 791Zeile 791
		else
{
$table->construct_cell('');

		else
{
$table->construct_cell('');

		}

		}

		$table->construct_row(array('class' => 'alt_row', 'no_alt_row' => 1));

		$table->construct_row(array('class' => 'alt_row', 'no_alt_row' => 1));

		



		// Make rows for each setting in the group
if(is_array($settings_cache[$group['gid']]))
{

		// Make rows for each setting in the group
if(is_array($settings_cache[$group['gid']]))
{

Zeile 826Zeile 826
			}
}
}

			}
}
}

	



	$table->output($lang->modify_existing_settings);

	$table->output($lang->modify_existing_settings);

	



	$buttons[] = $form->generate_submit_button($lang->save_display_orders);
$form->output_submit_wrapper($buttons);
$form->end();

	$buttons[] = $form->generate_submit_button($lang->save_display_orders);
$form->output_submit_wrapper($buttons);
$form->end();

	



	/*echo '<script type="text/javascript" src="./jscripts/config_settings.js"></script><script type="text/javascript">Event.observe(window, "load", ManageSettings.init);</script>';*/

	/*echo '<script type="text/javascript" src="./jscripts/config_settings.js"></script><script type="text/javascript">Event.observe(window, "load", ManageSettings.init);</script>';*/

	



	$page->output_footer();
}


	$page->output_footer();
}


Zeile 842Zeile 842
if($mybb->input['action'] == "change")
{
$plugins->run_hooks("admin_config_settings_change");

if($mybb->input['action'] == "change")
{
$plugins->run_hooks("admin_config_settings_change");

	



	if($mybb->request_method == "post")
{

	if($mybb->request_method == "post")
{

 
		if(!is_writable(MYBB_ROOT.'inc/settings.php'))
{
flash_message($lang->error_chmod_settings_file, 'error');
admin_redirect("index.php?module=config-settings");
}


		if(is_array($mybb->input['upsetting']))
{
foreach($mybb->input['upsetting'] as $name => $value)

		if(is_array($mybb->input['upsetting']))
{
foreach($mybb->input['upsetting'] as $name => $value)

Zeile 853Zeile 859
				$db->update_query("settings", array('value' => $value), "name='".$db->escape_string($name)."'");
}
}

				$db->update_query("settings", array('value' => $value), "name='".$db->escape_string($name)."'");
}
}

		



		// Check if we need to create our fulltext index after changing the search mode
if($mybb->settings['searchtype'] != $mybb->input['upsetting']['searchtype'] && $mybb->input['upsetting']['searchtype'] == "fulltext")
{

		// Check if we need to create our fulltext index after changing the search mode
if($mybb->settings['searchtype'] != $mybb->input['upsetting']['searchtype'] && $mybb->input['upsetting']['searchtype'] == "fulltext")
{

Zeile 884Zeile 890
			}
$db->update_query("tasks", $updated_task, "file='threadviews'");
}

			}
$db->update_query("tasks", $updated_task, "file='threadviews'");
}

		



		// Have we changed our cookie prefix? If so, update our adminsid so we're not logged out
if($mybb->input['upsetting']['cookieprefix'] && $mybb->input['upsetting']['cookieprefix'] != $mybb->settings['cookieprefix'])
{

		// Have we changed our cookie prefix? If so, update our adminsid so we're not logged out
if($mybb->input['upsetting']['cookieprefix'] && $mybb->input['upsetting']['cookieprefix'] != $mybb->settings['cookieprefix'])
{

Zeile 892Zeile 898
			$mybb->settings['cookieprefix'] = $mybb->input['upsetting']['cookieprefix'];
my_setcookie("adminsid", $admin_session['sid']);
}

			$mybb->settings['cookieprefix'] = $mybb->input['upsetting']['cookieprefix'];
my_setcookie("adminsid", $admin_session['sid']);
}

		








// Have we opted for a reCAPTCHA and not set a public/private key?
if($mybb->input['upsetting']['captchaimage'] == 2 && !$mybb->input['upsetting']['captchaprivatekey'] && !$mybb->input['upsetting']['captchapublickey'])
{
$db->update_query("settings", array("value" => 1), "name = 'captchaimage'");
}


		rebuild_settings();

		rebuild_settings();

		



		$plugins->run_hooks("admin_config_settings_change_commit");

		$plugins->run_hooks("admin_config_settings_change_commit");

			



		// Log admin action
log_admin_action();

		// Log admin action
log_admin_action();





		flash_message($lang->success_settings_updated, 'success');
admin_redirect("index.php?module=config-settings");
}

		flash_message($lang->success_settings_updated, 'success');
admin_redirect("index.php?module=config-settings");
}

	



	// What type of page
$cache_groups = $cache_settings = array();

	// What type of page
$cache_groups = $cache_settings = array();

	if($mybb->input['search'])

	if(isset($mybb->input['search']))

	{
// Search

	{
// Search

		



		// Search for settings

		// Search for settings

		$search = $db->escape_string($mybb->input['search']);

		$search = $db->escape_string_like($mybb->input['search']);

		$query = $db->query("

		$query = $db->query("

			SELECT s.* 

			SELECT s.*

			FROM ".TABLE_PREFIX."settings s
LEFT JOIN ".TABLE_PREFIX."settinggroups g ON(s.gid=g.gid)
WHERE s.name LIKE '%{$search}%' OR s.title LIKE '%{$search}%' OR s.description LIKE '%{$search}%' OR g.name LIKE '%{$search}%' OR g.title LIKE '%{$search}%' OR g.description LIKE '%{$search}%'
ORDER BY s.disporder
");

			FROM ".TABLE_PREFIX."settings s
LEFT JOIN ".TABLE_PREFIX."settinggroups g ON(s.gid=g.gid)
WHERE s.name LIKE '%{$search}%' OR s.title LIKE '%{$search}%' OR s.description LIKE '%{$search}%' OR g.name LIKE '%{$search}%' OR g.title LIKE '%{$search}%' OR g.description LIKE '%{$search}%'
ORDER BY s.disporder
");

		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}

if(!$db->num_rows($query))

		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}

if(!$db->num_rows($query))

		{
if(isset($mybb->input['ajax_search']))

		{
if(isset($mybb->input['ajax_search']))

			{

			{

				echo("<error>{$lang->error_no_settings_found}</error>");
exit;

				echo("<error>{$lang->error_no_settings_found}</error>");
exit;

			}

			}

			else
{
flash_message($lang->error_no_settings_found, 'error');

			else
{
flash_message($lang->error_no_settings_found, 'error');

				admin_redirect("index.php?module=config-settings");	

				admin_redirect("index.php?module=config-settings");

			}
}

			}
}

		



		// Cache groups
$groups = array_keys($cache_settings);
$groups = implode(',', $groups);

		// Cache groups
$groups = array_keys($cache_settings);
$groups = implode(',', $groups);

Zeile 946Zeile 958
		{
$cache_groups[$group['gid']] = $group;
}

		{
$cache_groups[$group['gid']] = $group;
}

		



		// Page header only if not AJAX
if(!isset($mybb->input['ajax_search']))
{
$page->add_breadcrumb_item($lang->settings_search);
$page->output_header($lang->board_settings." - {$lang->settings_search}");
}

		// Page header only if not AJAX
if(!isset($mybb->input['ajax_search']))
{
$page->add_breadcrumb_item($lang->settings_search);
$page->output_header($lang->board_settings." - {$lang->settings_search}");
}

		



		$form = new Form("index.php?module=config-settings&amp;action=change", "post", "change");

		$form = new Form("index.php?module=config-settings&amp;action=change", "post", "change");

	



		echo $form->generate_hidden_field("gid", $group['gid']);
}
elseif($mybb->input['gid'])

		echo $form->generate_hidden_field("gid", $group['gid']);
}
elseif($mybb->input['gid'])

	{

	{

		// Group listing
// Cache groups
$query = $db->simple_select("settinggroups", "*", "gid = '".intval($mybb->input['gid'])."'");
$groupinfo = $db->fetch_array($query);
$cache_groups[$groupinfo['gid']] = $groupinfo;

		// Group listing
// Cache groups
$query = $db->simple_select("settinggroups", "*", "gid = '".intval($mybb->input['gid'])."'");
$groupinfo = $db->fetch_array($query);
$cache_groups[$groupinfo['gid']] = $groupinfo;

		
if(!$db->num_rows($query))
{


if(!$db->num_rows($query))
{

			$page->output_error($lang->error_invalid_gid2);

			$page->output_error($lang->error_invalid_gid2);

		}


		}


		// Cache settings
$query = $db->simple_select("settings", "*", "gid='".intval($mybb->input['gid'])."'", array('order_by' => 'disporder'));

		// Cache settings
$query = $db->simple_select("settings", "*", "gid='".intval($mybb->input['gid'])."'", array('order_by' => 'disporder'));

		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}

if(!$db->num_rows($query))

		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}

if(!$db->num_rows($query))

        {
flash_message($lang->error_no_settings_found, 'error');

        {
flash_message($lang->error_no_settings_found, 'error');

            admin_redirect("index.php?module=config-settings");    

            admin_redirect("index.php?module=config-settings");

        }

        }

		



		$group_lang_var = "setting_group_{$groupinfo['name']}";

		$group_lang_var = "setting_group_{$groupinfo['name']}";

		if($lang->$group_lang_var)

		if(isset($lang->$group_lang_var))

		{
$groupinfo['title'] = $lang->$group_lang_var;
}

		{
$groupinfo['title'] = $lang->$group_lang_var;
}

		



		// Page header
$page->add_breadcrumb_item($groupinfo['title']);
$page->output_header($lang->board_settings." - {$groupinfo['title']}");

		// Page header
$page->add_breadcrumb_item($groupinfo['title']);
$page->output_header($lang->board_settings." - {$groupinfo['title']}");

		



		$form = new Form("index.php?module=config-settings&amp;action=change", "post", "change");

		$form = new Form("index.php?module=config-settings&amp;action=change", "post", "change");

	



		echo $form->generate_hidden_field("gid", $groupinfo['gid']);
}
else

		echo $form->generate_hidden_field("gid", $groupinfo['gid']);
}
else

Zeile 1007Zeile 1019
		{
$cache_groups[$group['gid']] = $group;
}

		{
$cache_groups[$group['gid']] = $group;
}

		



		if(!$db->num_rows($query))
{
$page->output_error($lang->error_invalid_gid2);
}

		if(!$db->num_rows($query))
{
$page->output_error($lang->error_invalid_gid2);
}

		



		// Cache settings
$query = $db->simple_select("settings", "*", "", array('order_by' => 'disporder'));
while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}

		// Cache settings
$query = $db->simple_select("settings", "*", "", array('order_by' => 'disporder'));
while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}

		



		// Page header
$page->add_breadcrumb_item($lang->show_all_settings);
$page->output_header($lang->board_settings." - {$lang->show_all_settings}");

		// Page header
$page->add_breadcrumb_item($lang->show_all_settings);
$page->output_header($lang->board_settings." - {$lang->show_all_settings}");

		



		$form = new Form("index.php?module=config-settings&amp;action=change", "post", "change");
}


		$form = new Form("index.php?module=config-settings&amp;action=change", "post", "change");
}


Zeile 1032Zeile 1044
	foreach($cache_groups as $groupinfo)
{
$group_lang_var = "setting_group_{$groupinfo['name']}";

	foreach($cache_groups as $groupinfo)
{
$group_lang_var = "setting_group_{$groupinfo['name']}";

		if($lang->$group_lang_var)

		if(isset($lang->$group_lang_var))

		{
$groupinfo['title'] = $lang->$group_lang_var;
}

		{
$groupinfo['title'] = $lang->$group_lang_var;
}

		



		$form_container = new FormContainer($groupinfo['title']);

		$form_container = new FormContainer($groupinfo['title']);

		



		if(empty($cache_settings[$groupinfo['gid']]))
{
$form_container->output_cell($lang->error_no_settings_found);
$form_container->construct_row();

		if(empty($cache_settings[$groupinfo['gid']]))
{
$form_container->output_cell($lang->error_no_settings_found);
$form_container->construct_row();

            



            $form_container->end();
echo '<br />';

            $form_container->end();
echo '<br />';

			



            continue;
}

            continue;
}

		



		foreach($cache_settings[$groupinfo['gid']] as $setting)
{
$options = "";

		foreach($cache_settings[$groupinfo['gid']] as $setting)
{
$options = "";

Zeile 1077Zeile 1089
			{
$dir = @opendir(MYBB_ROOT.$config['admin_dir']."/styles");
while($folder = readdir($dir))

			{
$dir = @opendir(MYBB_ROOT.$config['admin_dir']."/styles");
while($folder = readdir($dir))

				{

				{

					if($file != "." && $file != ".." && @file_exists(MYBB_ROOT.$config['admin_dir']."/styles/$folder/main.css"))
{
$folders[$folder] = ucfirst($folder);

					if($file != "." && $file != ".." && @file_exists(MYBB_ROOT.$config['admin_dir']."/styles/$folder/main.css"))
{
$folders[$folder] = ucfirst($folder);

Zeile 1086Zeile 1098
				closedir($dir);
ksort($folders);
$setting_code = $form->generate_select_box($element_name, $folders, $setting['value'], array('id' => $element_id));

				closedir($dir);
ksort($folders);
$setting_code = $form->generate_select_box($element_name, $folders, $setting['value'], array('id' => $element_id));

			}
else if($type[0] == "language")
{

			}
else if($type[0] == "language")
{

				$languages = $lang->get_languages();

				$languages = $lang->get_languages();

				$setting_code = $form->generate_select_box($element_name, $languages, $setting['value'], array('id' => $element_id));

				$setting_code = $form->generate_select_box($element_name, $languages, $setting['value'], array('id' => $element_id));

			}

			}

			else if($type[0] == "adminlanguage") 

			else if($type[0] == "adminlanguage")

			{
$languages = $lang->get_languages(1);
$setting_code = $form->generate_select_box($element_name, $languages, $setting['value'], array('id' => $element_id));
}
else if($type[0] == "passwordbox")

			{
$languages = $lang->get_languages(1);
$setting_code = $form->generate_select_box($element_name, $languages, $setting['value'], array('id' => $element_id));
}
else if($type[0] == "passwordbox")

			{

			{

				$setting_code = $form->generate_password_box($element_name, $setting['value'], array('id' => $element_id));
}
else if($type[0] == "php")

				$setting_code = $form->generate_password_box($element_name, $setting['value'], array('id' => $element_id));
}
else if($type[0] == "php")

Zeile 1111Zeile 1123
				for($i=0; $i < count($type); $i++)
{
$optionsexp = explode("=", $type[$i]);

				for($i=0; $i < count($type); $i++)
{
$optionsexp = explode("=", $type[$i]);

					if(!$optionsexp[1])

					if(!isset($optionsexp[1]))

					{
continue;
}
$title_lang = "setting_{$setting['name']}_{$optionsexp[0]}";

					{
continue;
}
$title_lang = "setting_{$setting['name']}_{$optionsexp[0]}";

					if($lang->$title_lang)

					if(isset($lang->$title_lang))

					{
$optionsexp[1] = $lang->$title_lang;
}

					{
$optionsexp[1] = $lang->$title_lang;
}

					



					if($type[0] == "select")
{
$option_list[$optionsexp[0]] = htmlspecialchars_uni($optionsexp[1]);

					if($type[0] == "select")
{
$option_list[$optionsexp[0]] = htmlspecialchars_uni($optionsexp[1]);

Zeile 1161Zeile 1173
			// Do we have a custom language variable for this title or description?
$title_lang = "setting_".$setting['name'];
$desc_lang = $title_lang."_desc";

			// Do we have a custom language variable for this title or description?
$title_lang = "setting_".$setting['name'];
$desc_lang = $title_lang."_desc";

			if($lang->$title_lang)

			if(isset($lang->$title_lang))

			{
$setting['title'] = $lang->$title_lang;
}

			{
$setting['title'] = $lang->$title_lang;
}

			if($lang->$desc_lang)

			if(isset($lang->$desc_lang))

			{
$setting['description'] = $lang->$desc_lang;
}
$form_container->output_row(htmlspecialchars_uni($setting['title']), $setting['description'], $setting_code, '', array(), array('id' => 'row_'.$element_id));
}
$form_container->end();

			{
$setting['description'] = $lang->$desc_lang;
}
$form_container->output_row(htmlspecialchars_uni($setting['title']), $setting['description'], $setting_code, '', array(), array('id' => 'row_'.$element_id));
}
$form_container->end();

		



		$form->output_submit_wrapper($buttons);
echo '<br />';
}
$form->end();

		$form->output_submit_wrapper($buttons);
echo '<br />';
}
$form->end();

	



	print_setting_peekers();

	print_setting_peekers();

	



	if(!isset($mybb->input['ajax_search']))
{
$page->output_footer();

	if(!isset($mybb->input['ajax_search']))
{
$page->output_footer();

Zeile 1189Zeile 1201
if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_config_settings_start");

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_config_settings_start");

	



	$page->output_header($lang->board_settings);

	$page->output_header($lang->board_settings);

	if($message)

	if(isset($message))

	{
$page->output_inline_message($message);
}

	{
$page->output_inline_message($message);
}

Zeile 1200Zeile 1212
		'title' => $lang->change_settings,
'link' => "index.php?module=config-settings",
'description' => $lang->change_settings_desc

		'title' => $lang->change_settings,
'link' => "index.php?module=config-settings",
'description' => $lang->change_settings_desc

	);


	);


	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add"

	$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,
'link' => "index.php?module=config-settings&amp;action=add"

	);


	);


	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup"
);

	$sub_tabs['add_setting_group'] = array(
'title' => $lang->add_new_setting_group,
'link' => "index.php?module=config-settings&amp;action=addgroup"
);

	



	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage",

	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&amp;action=manage",

	);	


	);


	$page->output_nav_tabs($sub_tabs, 'change_settings');

	$page->output_nav_tabs($sub_tabs, 'change_settings');

	



	// Search form
echo "<div style=\"text-align: right; margin-bottom: 3px;\">";
$search = new Form("index.php", 'get', 'settings_search', 0, 'settings_search');

	// Search form
echo "<div style=\"text-align: right; margin-bottom: 3px;\">";
$search = new Form("index.php", 'get', 'settings_search', 0, 'settings_search');

Zeile 1237Zeile 1249
	{
case "pgsql":
$query = $db->query("

	{
case "pgsql":
$query = $db->query("

				SELECT g.*, COUNT(s.sid) AS settingcount 
FROM ".TABLE_PREFIX."settinggroups g
LEFT JOIN ".TABLE_PREFIX."settings s ON (s.gid=g.gid)

				SELECT g.*, COUNT(s.sid) AS settingcount
FROM ".TABLE_PREFIX."settinggroups g
LEFT JOIN ".TABLE_PREFIX."settings s ON (s.gid=g.gid)

				GROUP BY ".$db->build_fields_string("settinggroups", "g.")."
ORDER BY g.disporder
");
break;
default:
$query = $db->query("

				GROUP BY ".$db->build_fields_string("settinggroups", "g.")."
ORDER BY g.disporder
");
break;
default:
$query = $db->query("

				SELECT g.*, COUNT(s.sid) AS settingcount 
FROM ".TABLE_PREFIX."settinggroups g
LEFT JOIN ".TABLE_PREFIX."settings s ON (s.gid=g.gid)

				SELECT g.*, COUNT(s.sid) AS settingcount
FROM ".TABLE_PREFIX."settinggroups g
LEFT JOIN ".TABLE_PREFIX."settings s ON (s.gid=g.gid)

				GROUP BY g.gid
ORDER BY g.disporder
");

				GROUP BY g.gid
ORDER BY g.disporder
");

Zeile 1256Zeile 1268
	while($group = $db->fetch_array($query))
{
$group_lang_var = "setting_group_{$group['name']}";

	while($group = $db->fetch_array($query))
{
$group_lang_var = "setting_group_{$group['name']}";

		if($lang->$group_lang_var)
{

		if(isset($lang->$group_lang_var))
{

			$group_title = htmlspecialchars_uni($lang->$group_lang_var);

			$group_title = htmlspecialchars_uni($lang->$group_lang_var);

		}

		}

		else
{
$group_title = htmlspecialchars_uni($group['title']);
}

		else
{
$group_title = htmlspecialchars_uni($group['title']);
}

		



		$group_desc_lang_var = "setting_group_{$group['name']}_desc";

		$group_desc_lang_var = "setting_group_{$group['name']}_desc";

		if($lang->$group_desc_lang_var)

		if(isset($lang->$group_desc_lang_var))

		{
$group_desc = htmlspecialchars_uni($lang->$group_desc_lang_var);
}

		{
$group_desc = htmlspecialchars_uni($lang->$group_desc_lang_var);
}

Zeile 1274Zeile 1286
		{
$group_desc = htmlspecialchars_uni($group['description']);
}

		{
$group_desc = htmlspecialchars_uni($group['description']);
}

				



		$table->construct_cell("<strong><a href=\"index.php?module=config-settings&amp;action=change&amp;gid={$group['gid']}\">{$group_title}</a></strong> ({$group['settingcount']} {$lang->bbsettings})<br /><small>{$group_desc}</small>");
$table->construct_row();
}
$table->output("<span style=\"float: right;\"><small><a href=\"index.php?module=config-settings&amp;action=change\">{$lang->show_all_settings}</a></small></span>{$lang->board_settings}");

		$table->construct_cell("<strong><a href=\"index.php?module=config-settings&amp;action=change&amp;gid={$group['gid']}\">{$group_title}</a></strong> ({$group['settingcount']} {$lang->bbsettings})<br /><small>{$group_desc}</small>");
$table->construct_row();
}
$table->output("<span style=\"float: right;\"><small><a href=\"index.php?module=config-settings&amp;action=change\">{$lang->show_all_settings}</a></small></span>{$lang->board_settings}");

	



	echo '</div>';

	echo '</div>';





	echo '
<script type="text/javascript">
//<!--
var SettingSearch = Class.create();
SettingSearch.prototype = {

	echo '
<script type="text/javascript">
//<!--
var SettingSearch = Class.create();
SettingSearch.prototype = {

	



	spinner: null,
form: null,
result_div: null,

	spinner: null,
form: null,
result_div: null,

Zeile 1319Zeile 1331
			}
});
},

			}
});
},

	



	onSubmit: function(e)
{
Event.stop(e);

	onSubmit: function(e)
{
Event.stop(e);

Zeile 1359Zeile 1371
new SettingSearch($("settings_search"), $("search"), $("search_results"), $("group_list"));
//-->
</script>';

new SettingSearch($("settings_search"), $("search"), $("search_results"), $("group_list"));
//-->
</script>';

	



	print_setting_peekers();
$page->output_footer();
}

	print_setting_peekers();
$page->output_footer();
}

Zeile 1369Zeile 1381
	echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>
<script type="text/javascript">
Event.observe(window, "load", function() {

	echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>
<script type="text/javascript">
Event.observe(window, "load", function() {

			loadPeekers();			

			loadPeekers();

		});
function loadPeekers()
{

		});
function loadPeekers()
{

Zeile 1382Zeile 1394
			new Peeker($$(".setting_showsimilarthreads"), $("row_setting_similarityrating"), /1/, true);
new Peeker($$(".setting_showsimilarthreads"), $("row_setting_similarlimit"), /1/, true);
new Peeker($$(".setting_disableregs"), $("row_setting_regtype"), /0/, true);

			new Peeker($$(".setting_showsimilarthreads"), $("row_setting_similarityrating"), /1/, true);
new Peeker($$(".setting_showsimilarthreads"), $("row_setting_similarlimit"), /1/, true);
new Peeker($$(".setting_disableregs"), $("row_setting_regtype"), /0/, true);

 
			new Peeker($$(".setting_hiddencaptchaimage"), $("row_setting_hiddencaptchaimagefield"), /1/, true);

			new Peeker($$(".setting_showsimilarthreads"), $("row_setting_similarlimit"), /1/, true);
new Peeker($("setting_failedlogincount"), $("row_setting_failedlogintime"), /[^0]/, false);
new Peeker($("setting_failedlogincount"), $("row_setting_failedlogintext"), /[^0]/, false);

			new Peeker($$(".setting_showsimilarthreads"), $("row_setting_similarlimit"), /1/, true);
new Peeker($("setting_failedlogincount"), $("row_setting_failedlogintime"), /[^0]/, false);
new Peeker($("setting_failedlogincount"), $("row_setting_failedlogintext"), /[^0]/, false);

Zeile 1409Zeile 1422
			new Peeker($("setting_mail_handler"), $("row_setting_smtp_pass"), /smtp/, false);
new Peeker($("setting_mail_handler"), $("row_setting_secure_smtp"), /smtp/, false);
new Peeker($("setting_mail_handler"), $("row_setting_mail_parameters"), /mail/, false);

			new Peeker($("setting_mail_handler"), $("row_setting_smtp_pass"), /smtp/, false);
new Peeker($("setting_mail_handler"), $("row_setting_secure_smtp"), /smtp/, false);
new Peeker($("setting_mail_handler"), $("row_setting_mail_parameters"), /mail/, false);

 
			new Peeker($("setting_captchaimage"), $("row_setting_captchapublickey"), 2, false);
new Peeker($("setting_captchaimage"), $("row_setting_captchaprivatekey"), 2, false);

		}
</script>';
}

		}
</script>';
}