Vergleich admin/modules/config/warning.php - 1.8.26 - 1.8.36

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 110Zeile 110
	$page->output_nav_tabs($sub_tabs, 'add_level');
$form = new Form("index.php?module=config-warning&action=add_level", "post");


	$page->output_nav_tabs($sub_tabs, 'add_level');
$form = new Form("index.php?module=config-warning&action=add_level", "post");




	$action_checked = array_fill(1, 3, null);

	if($errors)

	if($errors)

	{

	{

		$page->output_inline_error($errors);
$action_checked[$mybb->input['action_type']] = "checked=\"checked\"";

		$page->output_inline_error($errors);
$action_checked[$mybb->input['action_type']] = "checked=\"checked\"";

	}

$form_container = new FormContainer($lang->add_warning_level);
$form_container->output_row($lang->warning_points_percentage, $lang->warning_points_percentage_desc, $form->generate_numeric_field('percentage', $mybb->input['percentage'], array('id' => 'percentage', 'min' => 0, 'max' => 100)), 'percentage');

$query = $db->simple_select("usergroups", "*", "isbannedgroup=1");
while($group = $db->fetch_array($query))
{
$banned_groups[$group['gid']] = $group['title'];
}

$periods = array(
"hours" => $lang->expiration_hours,
"days" => $lang->expiration_days,
"weeks" => $lang->expiration_weeks,
"months" => $lang->expiration_months,
"never" => $lang->expiration_permanent
);

$actions = "<script type=\"text/javascript\">
function checkAction(id)
{
var checked = '';

$('.'+id+'s_check').each(function(e, val)
{
if($(this).prop('checked') == true)
{
checked = $(this).val();
}
});
$('.'+id+'s').each(function(e)
{
$(this).hide();
});
if($('#'+id+'_'+checked))
{
$('#'+id+'_'+checked).show();
}
}
</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_type\" value=\"1\" {$action_checked[1]} class=\"actions_check\" onclick=\"checkAction('action');\" style=\"vertical-align: middle;\" /> <strong>{$lang->ban_user}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"action_1\" class=\"actions\">
<table cellpadding=\"4\">
<tr>

	}

$form_container = new FormContainer($lang->add_warning_level);
$form_container->output_row($lang->warning_points_percentage, $lang->warning_points_percentage_desc, $form->generate_numeric_field('percentage', $mybb->get_input('percentage'), array('id' => 'percentage', 'min' => 0, 'max' => 100)), 'percentage');

$query = $db->simple_select("usergroups", "*", "isbannedgroup=1");
while($group = $db->fetch_array($query))
{
$banned_groups[$group['gid']] = $group['title'];
}

$periods = array(
"hours" => $lang->expiration_hours,
"days" => $lang->expiration_days,
"weeks" => $lang->expiration_weeks,
"months" => $lang->expiration_months,
"never" => $lang->expiration_permanent
);

$actions = "<script type=\"text/javascript\">
function checkAction(id)
{
var checked = '';

$('.'+id+'s_check').each(function(e, val)
{
if($(this).prop('checked') == true)
{
checked = $(this).val();
}
});
$('.'+id+'s').each(function(e)
{
$(this).hide();
});
if($('#'+id+'_'+checked))
{
$('#'+id+'_'+checked).show();
}
}
</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_type\" value=\"1\" {$action_checked[1]} class=\"actions_check\" onclick=\"checkAction('action');\" style=\"vertical-align: middle;\" /> <strong>{$lang->ban_user}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"action_1\" class=\"actions\">
<table cellpadding=\"4\">
<tr>

					<td><small>{$lang->banned_group}</small></td>

					<td><small>{$lang->banned_group}</small></td>

					<td>".$form->generate_select_box('action_1_usergroup', $banned_groups, $mybb->input['action_1_usergroup'])."</td>

					<td>".$form->generate_select_box('action_1_usergroup', $banned_groups, $mybb->get_input('action_1_usergroup'))."</td>

				</tr>
<tr>
<td><small>{$lang->ban_length}</small></td>

				</tr>
<tr>
<td><small>{$lang->ban_length}</small></td>

					<td>".$form->generate_numeric_field('action_1_time', $mybb->input['action_1_time'], array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_1_period', $periods, $mybb->input['action_1_period'])."</td>
</tr>

					<td>".$form->generate_numeric_field('action_1_time', $mybb->get_input('action_1_time'), array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_1_period', $periods, $mybb->get_input('action_1_period'))."</td>
</tr>

			</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_type\" value=\"2\" {$action_checked[2]} class=\"actions_check\" onclick=\"checkAction('action');\" style=\"vertical-align: middle;\" /> <strong>{$lang->suspend_posting_privileges}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"action_2\" class=\"actions\">

			</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_type\" value=\"2\" {$action_checked[2]} class=\"actions_check\" onclick=\"checkAction('action');\" style=\"vertical-align: middle;\" /> <strong>{$lang->suspend_posting_privileges}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"action_2\" class=\"actions\">

			<table cellpadding=\"4\">
<tr>

			<table cellpadding=\"4\">
<tr>

					<td><small>{$lang->suspension_length}</small></td>

					<td><small>{$lang->suspension_length}</small></td>

					<td>".$form->generate_numeric_field('action_2_time', $mybb->input['action_2_time'], array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_2_period', $periods, $mybb->input['action_2_period'])."</td>

					<td>".$form->generate_numeric_field('action_2_time', $mybb->get_input('action_2_time'), array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_2_period', $periods, $mybb->get_input('action_2_period'))."</td>

				</tr>
</table>
</dd>

				</tr>
</table>
</dd>

Zeile 184Zeile 184
			<table cellpadding=\"4\">
<tr>
<td><small>{$lang->moderation_length}</small></td>

			<table cellpadding=\"4\">
<tr>
<td><small>{$lang->moderation_length}</small></td>

					<td>".$form->generate_numeric_field('action_3_time', $mybb->input['action_3_time'], array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_3_period', $periods, $mybb->input['action_3_period'])."</td>

					<td>".$form->generate_numeric_field('action_3_time', $mybb->get_input('action_3_time'), array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_3_period', $periods, $mybb->get_input('action_3_period'))."</td>

				</tr>
</table>
</dd>

				</tr>
</table>
</dd>

Zeile 199Zeile 199

$form->output_submit_wrapper($buttons);
$form->end();


$form->output_submit_wrapper($buttons);
$form->end();





	$page->output_footer();
}

if($mybb->input['action'] == "edit_level")

	$page->output_footer();
}

if($mybb->input['action'] == "edit_level")

{
$query = $db->simple_select("warninglevels", "*", "lid='".$mybb->get_input('lid', MyBB::INPUT_INT)."'");
$level = $db->fetch_array($query);

// Does the warning level not exist?
if(!$level['lid'])
{

{
$query = $db->simple_select("warninglevels", "*", "lid='".$mybb->get_input('lid', MyBB::INPUT_INT)."'");
$level = $db->fetch_array($query);

// Does the warning level not exist?
if(!$level['lid'])
{

		flash_message($lang->error_invalid_warning_level, 'error');
admin_redirect("index.php?module=config-warning");
}

		flash_message($lang->error_invalid_warning_level, 'error');
admin_redirect("index.php?module=config-warning");
}

Zeile 300Zeile 300
		{
$mybb->input['action_1_usergroup'] = $action['usergroup'];
$length = fetch_friendly_expiration($action['length']);

		{
$mybb->input['action_1_usergroup'] = $action['usergroup'];
$length = fetch_friendly_expiration($action['length']);

			$mybb->input['action_1_time'] = $length['time'];

			$mybb->input['action_1_time'] = isset($length['time']) ? $length['time'] : null;

			$mybb->input['action_1_period'] = $length['period'];
}
else if($action['type'] == 2)

			$mybb->input['action_1_period'] = $length['period'];
}
else if($action['type'] == 2)

		{
$length = fetch_friendly_expiration($action['length']);
$mybb->input['action_2_time'] = $length['time'];

		{
$length = fetch_friendly_expiration($action['length']);
$mybb->input['action_2_time'] = isset($length['time']) ? $length['time'] : null;

			$mybb->input['action_2_period'] = $length['period'];
}
else if($action['type'] == 3)

			$mybb->input['action_2_period'] = $length['period'];
}
else if($action['type'] == 3)

		{

		{

			$length = fetch_friendly_expiration($action['length']);

			$length = fetch_friendly_expiration($action['length']);

			$mybb->input['action_3_time'] = $length['time'];

			$mybb->input['action_3_time'] = isset($length['time']) ? $length['time'] : null;

			$mybb->input['action_3_period'] = $length['period'];
}

			$mybb->input['action_3_period'] = $length['period'];
}

		$action_checked[$action['type']] = "checked=\"checked\"";
}




$action_checked = array_fill(1, 3, null);
$action_checked[$action['type']] = "checked=\"checked\"";
}


$form_container = new FormContainer($lang->edit_warning_level);
$form_container->output_row($lang->warning_points_percentage, $lang->warning_points_percentage_desc, $form->generate_numeric_field('percentage', $mybb->input['percentage'], array('id' => 'percentage', 'min' => 0, 'max' => 100)), 'percentage');

$query = $db->simple_select("usergroups", "*", "isbannedgroup=1");
while($group = $db->fetch_array($query))


$form_container = new FormContainer($lang->edit_warning_level);
$form_container->output_row($lang->warning_points_percentage, $lang->warning_points_percentage_desc, $form->generate_numeric_field('percentage', $mybb->input['percentage'], array('id' => 'percentage', 'min' => 0, 'max' => 100)), 'percentage');

$query = $db->simple_select("usergroups", "*", "isbannedgroup=1");
while($group = $db->fetch_array($query))

	{

	{

		$banned_groups[$group['gid']] = $group['title'];
}


		$banned_groups[$group['gid']] = $group['title'];
}


Zeile 341Zeile 343
		var checked = '';

$('.'+id+'s_check').each(function(e, val)

		var checked = '';

$('.'+id+'s_check').each(function(e, val)

		{

		{

			if($(this).prop('checked') == true)
{
checked = $(this).val();

			if($(this).prop('checked') == true)
{
checked = $(this).val();

Zeile 354Zeile 356
		if($('#'+id+'_'+checked))
{
$('#'+id+'_'+checked).show();

		if($('#'+id+'_'+checked))
{
$('#'+id+'_'+checked).show();

		}

		}

	}
</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">

	}
</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">

Zeile 363Zeile 365
			<table cellpadding=\"4\">
<tr>
<td><small>{$lang->banned_group}</small></td>

			<table cellpadding=\"4\">
<tr>
<td><small>{$lang->banned_group}</small></td>

					<td>".$form->generate_select_box('action_1_usergroup', $banned_groups, $mybb->input['action_1_usergroup'])."</td>
</tr>
<tr>
<td><small>{$lang->ban_length}</small></td>
<td>".$form->generate_numeric_field('action_1_time', $mybb->input['action_1_time'], array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_1_period', $periods, $mybb->input['action_1_period'])."</td>

					<td>".$form->generate_select_box('action_1_usergroup', $banned_groups, $mybb->get_input('action_1_usergroup'))."</td>
</tr>
<tr>
<td><small>{$lang->ban_length}</small></td>
<td>".$form->generate_numeric_field('action_1_time', $mybb->get_input('action_1_time'), array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_1_period', $periods, $mybb->get_input('action_1_period'))."</td>

				</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_type\" value=\"2\" {$action_checked[2]} class=\"actions_check\" onclick=\"checkAction('action');\" style=\"vertical-align: middle;\" /> <strong>{$lang->suspend_posting_privileges}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"action_2\" class=\"actions\">

				</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_type\" value=\"2\" {$action_checked[2]} class=\"actions_check\" onclick=\"checkAction('action');\" style=\"vertical-align: middle;\" /> <strong>{$lang->suspend_posting_privileges}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"action_2\" class=\"actions\">

			<table cellpadding=\"4\">

			<table cellpadding=\"4\">

				<tr>
<td><small>{$lang->suspension_length}</small></td>

				<tr>
<td><small>{$lang->suspension_length}</small></td>

					<td>".$form->generate_numeric_field('action_2_time', $mybb->input['action_2_time'], array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_2_period', $periods, $mybb->input['action_2_period'])."</td>

					<td>".$form->generate_numeric_field('action_2_time', $mybb->get_input('action_2_time'), array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_2_period', $periods, $mybb->get_input('action_2_period'))."</td>

				</tr>
</table>
</dd>

				</tr>
</table>
</dd>

Zeile 385Zeile 387
			<table cellpadding=\"4\">
<tr>
<td><small>{$lang->moderation_length}</small></td>

			<table cellpadding=\"4\">
<tr>
<td><small>{$lang->moderation_length}</small></td>

					<td>".$form->generate_numeric_field('action_3_time', $mybb->input['action_3_time'], array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_3_period', $periods, $mybb->input['action_3_period'])."</td>

					<td>".$form->generate_numeric_field('action_3_time', $mybb->get_input('action_3_time'), array('style' => 'width: 3em;', 'min' => 0))." ".$form->generate_select_box('action_3_period', $periods, $mybb->get_input('action_3_period'))."</td>

				</tr>
</table>
</dd>

				</tr>
</table>
</dd>

Zeile 405Zeile 407
}

if($mybb->input['action'] == "delete_level")

}

if($mybb->input['action'] == "delete_level")

{

{

	$query = $db->simple_select("warninglevels", "*", "lid='".$mybb->get_input('lid', MyBB::INPUT_INT)."'");
$level = $db->fetch_array($query);


	$query = $db->simple_select("warninglevels", "*", "lid='".$mybb->get_input('lid', MyBB::INPUT_INT)."'");
$level = $db->fetch_array($query);


Zeile 417Zeile 419
	}

// User clicked no

	}

// User clicked no

	if($mybb->input['no'])
{
admin_redirect("index.php?module=config-warning");
}

$plugins->run_hooks("admin_config_warning_delete_level");


	if($mybb->get_input('no'))
{
admin_redirect("index.php?module=config-warning");
}

$plugins->run_hooks("admin_config_warning_delete_level");


	if($mybb->request_method == "post")
{
// Delete the level
$db->delete_query("warninglevels", "lid='{$level['lid']}'");

	if($mybb->request_method == "post")
{
// Delete the level
$db->delete_query("warninglevels", "lid='{$level['lid']}'");





		$plugins->run_hooks("admin_config_warning_delete_level_commit");

// Log admin action

		$plugins->run_hooks("admin_config_warning_delete_level_commit");

// Log admin action

Zeile 446Zeile 448
if($mybb->input['action'] == "add_type")
{
$plugins->run_hooks("admin_config_warning_add_type");

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





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

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

		}


		}


		if(!is_numeric($mybb->input['points']) || $mybb->input['points'] > $mybb->settings['maxwarningpoints'] || $mybb->input['points'] <= 0)
{
$errors[] = $lang->sprintf($lang->error_missing_type_points, $mybb->settings['maxwarningpoints']);

		if(!is_numeric($mybb->input['points']) || $mybb->input['points'] > $mybb->settings['maxwarningpoints'] || $mybb->input['points'] <= 0)
{
$errors[] = $lang->sprintf($lang->error_missing_type_points, $mybb->settings['maxwarningpoints']);

Zeile 477Zeile 479
			flash_message($lang->success_warning_type_created, 'success');
admin_redirect("index.php?module=config-warning");
}

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

	}

	}

	else
{
$mybb->input = array_merge($mybb->input, array(

	else
{
$mybb->input = array_merge($mybb->input, array(

Zeile 501Zeile 503
	}

$form_container = new FormContainer($lang->add_warning_type);

	}

$form_container = new FormContainer($lang->add_warning_type);

	$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->points_to_add." <em>*</em>", $lang->points_to_add_desc, $form->generate_numeric_field('points', $mybb->input['points'], array('id' => 'points', 'min' => 0, 'max' => $mybb->settings['maxwarningpoints'])), 'points');

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->get_input('title'), array('id' => 'title')), 'title');
$form_container->output_row($lang->points_to_add." <em>*</em>", $lang->points_to_add_desc, $form->generate_numeric_field('points', $mybb->get_input('points'), array('id' => 'points', 'min' => 0, 'max' => $mybb->settings['maxwarningpoints'])), 'points');

	$expiration_periods = array(
"hours" => $lang->expiration_hours,
"days" => $lang->expiration_days,

	$expiration_periods = array(
"hours" => $lang->expiration_hours,
"days" => $lang->expiration_days,

Zeile 630Zeile 632
	}

// User clicked no

	}

// User clicked no

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

	if($mybb->get_input('no'))

	{
admin_redirect("index.php?module=config-warning");
}

	{
admin_redirect("index.php?module=config-warning");
}

Zeile 679Zeile 681
		// Get the right language for the ban period
$lang_str = "expiration_".$period['period'];
$period_str = $lang->$lang_str;

		// Get the right language for the ban period
$lang_str = "expiration_".$period['period'];
$period_str = $lang->$lang_str;

 
		$group_name = '';


if($action['type'] == 1)
{


if($action['type'] == 1)
{

Zeile 718Zeile 721
	{
$table->construct_cell($lang->no_warning_levels, array('colspan' => 4));
$table->construct_row();

	{
$table->construct_cell($lang->no_warning_levels, array('colspan' => 4));
$table->construct_row();

		$no_results = true;

 
	}

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

	}

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

Zeile 765Zeile 767
	{
$table->construct_cell($lang->no_warning_types, array('colspan' => 5));
$table->construct_row();

	{
$table->construct_cell($lang->no_warning_types, array('colspan' => 5));
$table->construct_row();

		$no_results = true;

 
	}

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

	}

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