Vergleich admin/modules/config/settings.php - 1.4.0 - 1.4.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: settings.php 4031 2008-07-20 20:56:39Z Tikitiki $

 * $Id: settings.php 4120 2008-08-16 02:40:05Z Tikitiki $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 19Zeile 19

$plugins->run_hooks("admin_config_settings_begin");



$plugins->run_hooks("admin_config_settings_begin");


 
/*

// Delete all duplicate settings and setting groups
if($mybb->input['action'] == "delete_duplicates")
{
$query = $db->query("
DELETE s1
FROM ".TABLE_PREFIX."settings s1

// Delete all duplicate settings and setting groups
if($mybb->input['action'] == "delete_duplicates")
{
$query = $db->query("
DELETE s1
FROM ".TABLE_PREFIX."settings s1

		INNER JOIN ".TABLE_PREFIX."settings s2 ON (s2.name=s1.name AND s2.sid!=s1.sid)

		INNER JOIN ".TABLE_PREFIX."settings s2 ON (s2.name=s1.name AND s2.sid!=s1.sid AND s2.sid < s1.sid)

	");
$query = $db->query("
DELETE g1
FROM ".TABLE_PREFIX."settinggroups g1

	");
$query = $db->query("
DELETE g1
FROM ".TABLE_PREFIX."settinggroups g1

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

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

	");
rebuild_settings();


	");
rebuild_settings();


Zeile 41Zeile 42

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");

}


}*/
// ^^ Code, Please go away. Forever.


// Creating a new setting group
if($mybb->input['action'] == "addgroup")


// Creating a new setting group
if($mybb->input['action'] == "addgroup")

Zeile 54Zeile 56
		if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_group_title;

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

		}

		}

		
// Validate identifier
if(!trim($mybb->input['name']))
{
$errors[] = $lang->error_missing_group_name;

		
// Validate identifier
if(!trim($mybb->input['name']))
{
$errors[] = $lang->error_missing_group_name;

		}

		}

		$query = $db->simple_select("settinggroups", "title", "name='".$db->escape_string($mybb->input['name'])."'");
if($db->num_rows($query) > 0)
{
$dup_group_title = $db->fetch_field($query, 'title');
$errors[] = $lang->sprintf($lang->error_duplicate_group_name, $dup_group_title);

		$query = $db->simple_select("settinggroups", "title", "name='".$db->escape_string($mybb->input['name'])."'");
if($db->num_rows($query) > 0)
{
$dup_group_title = $db->fetch_field($query, 'title');
$errors[] = $lang->sprintf($lang->error_duplicate_group_name, $dup_group_title);

		}

		}


if(!$errors)
{


if(!$errors)
{

Zeile 91Zeile 93

$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(

	);

$sub_tabs['add_setting'] = array(

Zeile 121Zeile 123
	{
$page->output_inline_error($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 = 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');

Zeile 140Zeile 142
if($mybb->input['action'] == "editgroup")
{
$plugins->run_hooks("admin_config_settings_editgroup");

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);

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

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

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

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

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

Zeile 229Zeile 231
	$form_container->output_row($lang->description, "", $form->generate_text_area('description', $group_data['description'], array('id' => 'description')), 'description');
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $group_data['disporder'], array('id' => 'disporder')), 'disporder');
$form_container->output_row($lang->name." <em>*</em>", $lang->group_name_desc, $form->generate_text_box('name', $group_data['name'], array('id' => 'name')), 'name');

	$form_container->output_row($lang->description, "", $form->generate_text_area('description', $group_data['description'], array('id' => 'description')), 'description');
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $group_data['disporder'], array('id' => 'disporder')), 'disporder');
$form_container->output_row($lang->name." <em>*</em>", $lang->group_name_desc, $form->generate_text_box('name', $group_data['name'], array('id' => 'name')), 'name');

 


	$form_container->end();

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

	$form_container->end();

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





	$page->output_footer();
}

	$page->output_footer();
}





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

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

Zeile 254Zeile 257
	}
// Prevent deletion of default
if($group['isdefault'] == 1)

	}
// Prevent deletion of default
if($group['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");
}

// 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");

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

	}

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

	}

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

Zeile 282Zeile 285
		admin_redirect("index.php?module=config/settings&action=manage");
}
else

		admin_redirect("index.php?module=config/settings&action=manage");
}
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 309Zeile 312
		if(!trim($mybb->input['name']))
{
$errors[] = $lang->error_missing_name;

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

		}

		}

		$query = $db->simple_select("settings", "title", "name='".$db->escape_string($mybb->input['name'])."'");
if($db->num_rows($query) > 0)
{

		$query = $db->simple_select("settings", "title", "name='".$db->escape_string($mybb->input['name'])."'");
if($db->num_rows($query) > 0)
{

Zeile 471Zeile 474
	$type = trim($type[0]);
if($type == "php")
{

	$type = trim($type[0]);
if($type == "php")
{

 


		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");
}

Zeile 831Zeile 835
	$form->output_submit_wrapper($buttons);
$form->end();


	$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();
}