Vergleich admin/modules/config/warning.php - 1.8.0 - 1.8.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 53Zeile 53
		if(!is_numeric($mybb->input['percentage']) || $mybb->input['percentage'] > 100 || $mybb->input['percentage'] < 0)
{
$errors[] = $lang->error_invalid_warning_percentage;

		if(!is_numeric($mybb->input['percentage']) || $mybb->input['percentage'] > 100 || $mybb->input['percentage'] < 0)
{
$errors[] = $lang->error_invalid_warning_percentage;

 
		}

if(!$mybb->input['action_type'])
{
$errors[] = $lang->error_missing_action_type;

		}

if(!$errors)
{
// Ban
if($mybb->input['action_type'] == 1)

		}

if(!$errors)
{
// Ban
if($mybb->input['action_type'] == 1)

			{

			{

				$action = array(
"type" => 1,
"usergroup" => (int)$mybb->input['action_1_usergroup'],

				$action = array(
"type" => 1,
"usergroup" => (int)$mybb->input['action_1_usergroup'],

Zeile 72Zeile 77
				$action = array(
"type" => 2,
"length" => fetch_time_length($mybb->input['action_2_time'], $mybb->input['action_2_period'])

				$action = array(
"type" => 2,
"length" => fetch_time_length($mybb->input['action_2_time'], $mybb->input['action_2_period'])

				);
}

				);
}

			// Moderate posts
else if($mybb->input['action_type'] == 3)
{

			// Moderate posts
else if($mybb->input['action_type'] == 3)
{

Zeile 88Zeile 93
			);

$lid = $db->insert_query("warninglevels", $new_level);

			);

$lid = $db->insert_query("warninglevels", $new_level);





			$plugins->run_hooks("admin_config_warning_add_level_commit");

// Log admin action

			$plugins->run_hooks("admin_config_warning_add_level_commit");

// Log admin action

Zeile 110Zeile 115
	{
$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_text_box('percentage', $mybb->input['percentage'], array('id' => 'percentage')), '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>".$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_text_box('action_1_time', $mybb->input['action_1_time'], array('style' => 'width: 2em;'))." ".$form->generate_select_box('action_1_period', $periods, $mybb->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 cellpadding=\"4\">
<tr>
<td><small>{$lang->suspension_length}</small></td>
<td>".$form->generate_text_box('action_2_time', $mybb->input['action_2_time'], array('style' => 'width: 2em;'))." ".$form->generate_select_box('action_2_period', $periods, $mybb->input['action_2_period'])."</td>
</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_type\" value=\"3\" {$action_checked[3]} class=\"actions_check\" onclick=\"checkAction('action');\" style=\"vertical-align: middle;\" /> <strong>{$lang->moderate_posts}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"action_3\" class=\"actions\">
<table cellpadding=\"4\">
<tr>
<td><small>{$lang->moderation_length}</small></td>
<td>".$form->generate_text_box('action_3_time', $mybb->input['action_3_time'], array('style' => 'width: 2em;'))." ".$form->generate_select_box('action_3_period', $periods, $mybb->input['action_3_period'])."</td>

	}

$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')), '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>".$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: 2em;'))." ".$form->generate_select_box('action_1_period', $periods, $mybb->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 cellpadding=\"4\">
<tr>
<td><small>{$lang->suspension_length}</small></td>
<td>".$form->generate_numeric_field('action_2_time', $mybb->input['action_2_time'], array('style' => 'width: 2em;'))." ".$form->generate_select_box('action_2_period', $periods, $mybb->input['action_2_period'])."</td>
</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_type\" value=\"3\" {$action_checked[3]} class=\"actions_check\" onclick=\"checkAction('action');\" style=\"vertical-align: middle;\" /> <strong>{$lang->moderate_posts}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"action_3\" class=\"actions\">
<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: 2em;'))." ".$form->generate_select_box('action_3_period', $periods, $mybb->input['action_3_period'])."</td>

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

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

Zeile 189Zeile 194
	</script>";
$form_container->output_row($lang->action_to_be_taken, $lang->action_to_be_taken_desc, $actions);
$form_container->end();

	</script>";
$form_container->output_row($lang->action_to_be_taken, $lang->action_to_be_taken_desc, $actions);
$form_container->end();





	$buttons[] = $form->generate_submit_button($lang->save_warning_level);

$form->output_submit_wrapper($buttons);

	$buttons[] = $form->generate_submit_button($lang->save_warning_level);

$form->output_submit_wrapper($buttons);

Zeile 217Zeile 222
		if(!is_numeric($mybb->input['percentage']) || $mybb->input['percentage'] > 100 || $mybb->input['percentage'] < 0)
{
$errors[] = $lang->error_invalid_warning_percentage;

		if(!is_numeric($mybb->input['percentage']) || $mybb->input['percentage'] > 100 || $mybb->input['percentage'] < 0)
{
$errors[] = $lang->error_invalid_warning_percentage;

 
		}

if(!$mybb->input['action_type'])
{
$errors[] = $lang->error_missing_action_type;

		}

if(!$errors)

		}

if(!$errors)

Zeile 250Zeile 260
				"percentage" => (int)$mybb->input['percentage'],
"action" => serialize($action)
);

				"percentage" => (int)$mybb->input['percentage'],
"action" => serialize($action)
);


$db->update_query("warninglevels", $updated_level, "lid='{$level['lid']}'");

 

$plugins->run_hooks("admin_config_warning_edit_level_commit");


$plugins->run_hooks("admin_config_warning_edit_level_commit");

 

$db->update_query("warninglevels", $updated_level, "lid='{$level['lid']}'");


// Log admin action
log_admin_action($level['lid'], $mybb->input['percentage']);

flash_message($lang->success_warning_level_updated, 'success');
admin_redirect("index.php?module=config-warning&action=levels");


// Log admin action
log_admin_action($level['lid'], $mybb->input['percentage']);

flash_message($lang->success_warning_level_updated, 'success');
admin_redirect("index.php?module=config-warning&action=levels");

		}
}


		}
}


	$page->add_breadcrumb_item($lang->edit_warning_level);
$page->output_header($lang->warning_levels." - ".$lang->edit_warning_level);


	$page->add_breadcrumb_item($lang->edit_warning_level);
$page->output_header($lang->warning_levels." - ".$lang->edit_warning_level);


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

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

			$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']);
$mybb->input['action_3_time'] = $length['time'];
$mybb->input['action_3_period'] = $length['period'];

			$length = fetch_friendly_expiration($action['length']);
$mybb->input['action_3_time'] = $length['time'];
$mybb->input['action_3_period'] = $length['period'];

Zeile 309Zeile 319
	}

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

	}

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

	$form_container->output_row($lang->warning_points_percentage, $lang->warning_points_percentage_desc, $form->generate_text_box('percentage', $mybb->input['percentage'], array('id' => 'percentage')), 'percentage');

	$form_container->output_row($lang->warning_points_percentage, $lang->warning_points_percentage_desc, $form->generate_numeric_field('percentage', $mybb->input['percentage'], array('id' => 'percentage')), 'percentage');


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


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

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

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

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

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

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

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

Zeile 366Zeile 376
			<table cellpadding=\"4\">
<tr>
<td><small>{$lang->suspension_length}</small></td>

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

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

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

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

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

Zeile 375Zeile 385
			<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_text_box('action_3_time', $mybb->input['action_3_time'], array('style' => 'width: 2em;'))." ".$form->generate_select_box('action_3_period', $periods, $mybb->input['action_3_period'])."</td>

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

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

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

Zeile 425Zeile 435
		log_admin_action($level['lid'], $level['percentage']);

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

		log_admin_action($level['lid'], $level['percentage']);

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

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

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

	}
else
{

	}
else
{

Zeile 492Zeile 502

$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 = 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_text_box('points', $mybb->input['points'], array('id' => 'points')), 'points');

	$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')), 'points');

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

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

Zeile 500Zeile 510
		"months" => $lang->expiration_months,
"never" => $lang->expiration_never
);

		"months" => $lang->expiration_months,
"never" => $lang->expiration_never
);

	$form_container->output_row($lang->warning_expiry, $lang->warning_expiry_desc, $form->generate_text_box('expire_time', $mybb->input['expire_time'], array('id' => 'expire_time'))." ".$form->generate_select_box('expire_period', $expiration_periods, $mybb->input['expire_period'], array('id' => 'expire_period')), 'expire_time');

	$form_container->output_row($lang->warning_expiry, $lang->warning_expiry_desc, $form->generate_numeric_field('expire_time', $mybb->input['expire_time'], array('id' => 'expire_time'))." ".$form->generate_select_box('expire_period', $expiration_periods, $mybb->input['expire_period'], array('id' => 'expire_period')), 'expire_time');

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->save_warning_type);

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->save_warning_type);

Zeile 544Zeile 554
				"points" => (int)$mybb->input['points'],
"expirationtime" => fetch_time_length($mybb->input['expire_time'], $mybb->input['expire_period'])
);

				"points" => (int)$mybb->input['points'],
"expirationtime" => fetch_time_length($mybb->input['expire_time'], $mybb->input['expire_period'])
);


$db->update_query("warningtypes", $updated_type, "tid='{$type['tid']}'");

 

$plugins->run_hooks("admin_config_warning_edit_type_commit");


$plugins->run_hooks("admin_config_warning_edit_type_commit");

 

$db->update_query("warningtypes", $updated_type, "tid='{$type['tid']}'");


// Log admin action
log_admin_action($type['tid'], $mybb->input['title']);


// Log admin action
log_admin_action($type['tid'], $mybb->input['title']);

Zeile 588Zeile 598

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


$form_container = new FormContainer($lang->edit_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_text_box('points', $mybb->input['points'], array('id' => 'points')), 'points');

	$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')), 'points');

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

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

Zeile 596Zeile 606
		"months" => $lang->expiration_months,
"never" => $lang->expiration_never
);

		"months" => $lang->expiration_months,
"never" => $lang->expiration_never
);

	$form_container->output_row($lang->warning_expiry, $lang->warning_expiry_desc, $form->generate_text_box('expire_time', $mybb->input['expire_time'], array('id' => 'expire_time'))." ".$form->generate_select_box('expire_period', $expiration_periods, $mybb->input['expire_period'], array('id' => 'expire_period')), 'expire_time');

	$form_container->output_row($lang->warning_expiry, $lang->warning_expiry_desc, $form->generate_numeric_field('expire_time', $mybb->input['expire_time'], array('id' => 'expire_time'))." ".$form->generate_select_box('expire_period', $expiration_periods, $mybb->input['expire_period'], array('id' => 'expire_period')), 'expire_time');

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->save_warning_type);

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->save_warning_type);