Vergleich admin/modules/tools/warninglog.php - 1.8.18 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 24Zeile 24
	$query = $db->simple_select("warnings", "*", "wid='".$mybb->get_input('wid', MyBB::INPUT_INT)."'");
$warning = $db->fetch_array($query);


	$query = $db->simple_select("warnings", "*", "wid='".$mybb->get_input('wid', MyBB::INPUT_INT)."'");
$warning = $db->fetch_array($query);


	if(!$warning['wid'])

	if(!$warning)

	{
flash_message($lang->error_invalid_warning, 'error');
admin_redirect("index.php?module=tools-warninglog");

	{
flash_message($lang->error_invalid_warning, 'error');
admin_redirect("index.php?module=tools-warninglog");

Zeile 96Zeile 96
	");
$warning = $db->fetch_array($query);


	");
$warning = $db->fetch_array($query);


	if(!$warning['wid'])

	if(!$warning)

	{
flash_message($lang->error_invalid_warning, 'error');
admin_redirect("index.php?module=tools-warninglog");

	{
flash_message($lang->error_invalid_warning, 'error');
admin_redirect("index.php?module=tools-warninglog");

Zeile 112Zeile 112

$user_link = build_profile_link(htmlspecialchars_uni($user['username']), $user['uid'], "_blank");



$user_link = build_profile_link(htmlspecialchars_uni($user['username']), $user['uid'], "_blank");


	if(is_array($warn_errors))

	if(isset($warn_errors) && is_array($warn_errors))

	{
$page->output_inline_error($warn_errors);
$mybb->input['reason'] = htmlspecialchars_uni($mybb->input['reason']);

	{
$page->output_inline_error($warn_errors);
$mybb->input['reason'] = htmlspecialchars_uni($mybb->input['reason']);

Zeile 204Zeile 204
		$form_container = new FormContainer($lang->revoke_warning);
echo $form->generate_hidden_field('action', 'do_revoke');
echo $form->generate_hidden_field('wid', $warning['wid']);

		$form_container = new FormContainer($lang->revoke_warning);
echo $form->generate_hidden_field('action', 'do_revoke');
echo $form->generate_hidden_field('wid', $warning['wid']);

		$form_container->output_row("", $lang->revoke_warning_desc, $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason')), 'reason');

		$form_container->output_row("", $lang->revoke_warning_desc, $form->generate_text_area('reason', $mybb->get_input('reason'), array('id' => 'reason')), 'reason');


$form_container->end();
$buttons[] = $form->generate_submit_button($lang->revoke_warning);


$form_container->end();
$buttons[] = $form->generate_submit_button($lang->revoke_warning);

Zeile 245Zeile 245
	);

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

	);

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

 

if(empty($mybb->input['filter']))
{
$mybb->input['filter'] = array();
}


// Filter options
$where_sql = '';


// Filter options
$where_sql = '';

Zeile 253Zeile 258
		$search_user = get_user_by_username($mybb->input['filter']['username']);

$mybb->input['filter']['uid'] = (int)$search_user['uid'];

		$search_user = get_user_by_username($mybb->input['filter']['username']);

$mybb->input['filter']['uid'] = (int)$search_user['uid'];

		$mybb->input['filter']['uid'] = $db->fetch_field($query, "uid");

 
	}

	}

	if($mybb->input['filter']['uid'])

	if(!empty($mybb->input['filter']['uid']))

	{
$search['uid'] = (int)$mybb->input['filter']['uid'];
$where_sql .= " AND w.uid='{$search['uid']}'";

	{
$search['uid'] = (int)$mybb->input['filter']['uid'];
$where_sql .= " AND w.uid='{$search['uid']}'";

Zeile 271Zeile 275

$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid'];
}


$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid'];
}

	if($mybb->input['filter']['mod_uid'])

	if(!empty($mybb->input['filter']['mod_uid']))

	{
$search['mod_uid'] = (int)$mybb->input['filter']['mod_uid'];
$where_sql .= " AND w.issuedby='{$search['mod_uid']}'";

	{
$search['mod_uid'] = (int)$mybb->input['filter']['mod_uid'];
$where_sql .= " AND w.issuedby='{$search['mod_uid']}'";

Zeile 281Zeile 285
			$mybb->input['search']['mod_username'] = $mod_user['username'];
}
}

			$mybb->input['search']['mod_username'] = $mod_user['username'];
}
}

	if($mybb->input['filter']['reason'])

	if(!empty($mybb->input['filter']['reason']))

	{
$search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']);
$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
}
$sortbysel = array();

	{
$search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']);
$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
}
$sortbysel = array();

	switch($mybb->input['filter']['sortby'])






	$sortby_input = '';
if(!empty($mybb->input['filter']['sortby']))
{
$sortby_input = $mybb->input['filter']['sortby'];
}
switch($sortby_input)

	{
case "username":
$sortby = "u.username";
$sortbysel['username'] = ' selected="selected"';

	{
case "username":
$sortby = "u.username";
$sortbysel['username'] = ' selected="selected"';

			break;

			break;

		case "expires":
$sortby = "w.expires";
$sortbysel['expires'] = ' selected="selected"';

		case "expires":
$sortby = "w.expires";
$sortbysel['expires'] = ' selected="selected"';

			break;

			break;

		case "issuedby":
$sortby = "i.username";
$sortbysel['issuedby'] = ' selected="selected"';

		case "issuedby":
$sortby = "i.username";
$sortbysel['issuedby'] = ' selected="selected"';

Zeile 304Zeile 313
		default: // "dateline"
$sortby = "w.dateline";
$sortbysel['dateline'] = ' selected="selected"';

		default: // "dateline"
$sortby = "w.dateline";
$sortbysel['dateline'] = ' selected="selected"';

	}
$order = $mybb->input['filter']['order'];

	}


	$ordersel = array();

	$ordersel = array();

	if($order != "asc")
{

	if(empty($mybb->input['filter']['order']) || $mybb->input['filter']['order'] != "asc")
{

		$order = "desc";
$ordersel['desc'] = ' selected="selected"';

		$order = "desc";
$ordersel['desc'] = ' selected="selected"';

	}

	}

	else
{
$ordersel['asc'] = ' selected="selected"';
}

	else
{
$ordersel['asc'] = ' selected="selected"';
}





	// Expire any warnings past their expiration date
require_once MYBB_ROOT.'inc/datahandlers/warnings.php';
$warningshandler = new WarningsHandler('update');

	// Expire any warnings past their expiration date
require_once MYBB_ROOT.'inc/datahandlers/warnings.php';
$warningshandler = new WarningsHandler('update');

Zeile 328Zeile 336
		SELECT COUNT(wid) as count
FROM
".TABLE_PREFIX."warnings w

		SELECT COUNT(wid) as count
FROM
".TABLE_PREFIX."warnings w

			LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid)
WHERE 1=1
{$where_sql}
";
$query = $db->query($sql);

			LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid)
WHERE 1=1
{$where_sql}
";
$query = $db->query($sql);

	$total_warnings = $db->fetch_field($query, 'count');
$view_page = 1;
if(isset($mybb->input['page']) && $mybb->get_input('page', MyBB::INPUT_INT) > 0)

	$total_warnings = $db->fetch_field($query, 'count');
$view_page = 1;
if(isset($mybb->input['page']) && $mybb->get_input('page', MyBB::INPUT_INT) > 0)

	{

	{

		$view_page = $mybb->get_input('page', MyBB::INPUT_INT);
}
$per_page = 20;
if(isset($mybb->input['filter']['per_page']) && (int)$mybb->input['filter']['per_page'] > 0)
{
$per_page = (int)$mybb->input['filter']['per_page'];

		$view_page = $mybb->get_input('page', MyBB::INPUT_INT);
}
$per_page = 20;
if(isset($mybb->input['filter']['per_page']) && (int)$mybb->input['filter']['per_page'] > 0)
{
$per_page = (int)$mybb->input['filter']['per_page'];

	}

	}

	$start = ($view_page-1) * $per_page;
$pages = ceil($total_warnings / $per_page);
if($view_page > $pages)

	$start = ($view_page-1) * $per_page;
$pages = ceil($total_warnings / $per_page);
if($view_page > $pages)

Zeile 359Zeile 367
		{
$value = urlencode($value);
$url .= "&filter[{$field}]={$value}";

		{
$value = urlencode($value);
$url .= "&filter[{$field}]={$value}";

		}

		}

	}

// The actual query

	}

// The actual query

Zeile 431Zeile 439
		$title = htmlspecialchars_uni($title);
if($row['points'] > 0)
{

		$title = htmlspecialchars_uni($title);
if($row['points'] > 0)
{

			$points = '+'.$row['points'];

			$row['points'] = "+{$row['points']}";

		}

		}

 
		$points = $lang->sprintf($lang->warning_points, $row['points']);


$table->construct_cell($username_link);


$table->construct_cell($username_link);

		$table->construct_cell("{$title} ({$points})");

		$table->construct_cell("{$title} {$points}");

		$table->construct_cell($issued_date, array("class" => "align_center"));
$table->construct_cell($expire_date.$revoked_text, array("class" => "align_center"));
$table->construct_cell($mod_username_link);
$table->construct_cell("<a href=\"index.php?module=tools-warninglog&amp;action=view&amp;wid={$row['wid']}\">{$lang->view}</a>", array("class" => "align_center"));

		$table->construct_cell($issued_date, array("class" => "align_center"));
$table->construct_cell($expire_date.$revoked_text, array("class" => "align_center"));
$table->construct_cell($mod_username_link);
$table->construct_cell("<a href=\"index.php?module=tools-warninglog&amp;action=view&amp;wid={$row['wid']}\">{$lang->view}</a>", array("class" => "align_center"));

		$table->construct_row();
}

		$table->construct_row();
}


if($table->num_rows() == 0)
{
$table->construct_cell($lang->no_warning_logs, array("colspan" => "6"));
$table->construct_row();


if($table->num_rows() == 0)
{
$table->construct_cell($lang->no_warning_logs, array("colspan" => "6"));
$table->construct_row();

	}


	}


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

// Do we need to construct the pagination?

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

// Do we need to construct the pagination?

Zeile 468Zeile 477
		'asc' => $lang->asc,
'desc' => $lang->desc
);

		'asc' => $lang->asc,
'desc' => $lang->desc
);

 

$user_filters = array();
$input_filters = $mybb->get_input('filter', MyBB::INPUT_ARRAY);
foreach(array('username', 'mod_username', 'reason', 'sortby') as $key)
{
if(isset($input_filters[$key]))
{
$user_filters[$key] = $input_filters[$key];
}
else
{
$user_filters[$key] = '';
}
}


$form = new Form("index.php?module=tools-warninglog", "post");
$form_container = new FormContainer($lang->filter_warning_logs);


$form = new Form("index.php?module=tools-warninglog", "post");
$form_container = new FormContainer($lang->filter_warning_logs);

	$form_container->output_row($lang->filter_warned_user, "", $form->generate_text_box('filter[username]', $mybb->input['filter']['username'], array('id' => 'filter_username')), 'filter_username');
$form_container->output_row($lang->filter_issued_by, "", $form->generate_text_box('filter[mod_username]', $mybb->input['filter']['mod_username'], array('id' => 'filter_mod_username')), 'filter_mod_username');
$form_container->output_row($lang->filter_reason, "", $form->generate_text_box('filter[reason]', $mybb->input['filter']['reason'], array('id' => 'filter_reason')), 'filter_reason');
$form_container->output_row($lang->sort_by, "", $form->generate_select_box('filter[sortby]', $sort_by, $mybb->input['filter']['sortby'], array('id' => 'filter_sortby'))." {$lang->in} ".$form->generate_select_box('filter[order]', $order_array, $order, array('id' => 'filter_order'))." {$lang->order}", 'filter_order');

	$form_container->output_row($lang->filter_warned_user, "", $form->generate_text_box('filter[username]', $user_filters['username'], array('id' => 'filter_username')), 'filter_username');
$form_container->output_row($lang->filter_issued_by, "", $form->generate_text_box('filter[mod_username]', $user_filters['mod_username'], array('id' => 'filter_mod_username')), 'filter_mod_username');
$form_container->output_row($lang->filter_reason, "", $form->generate_text_box('filter[reason]', $user_filters['reason'], array('id' => 'filter_reason')), 'filter_reason');
$form_container->output_row($lang->sort_by, "", $form->generate_select_box('filter[sortby]', $sort_by, $user_filters['sortby'], array('id' => 'filter_sortby'))." {$lang->in} ".$form->generate_select_box('filter[order]', $order_array, $order, array('id' => 'filter_order'))." {$lang->order}", 'filter_order');

	$form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('filter[per_page]', $per_page, array('id' => 'filter_per_page', 'min' => 1)), 'filter_per_page');

$form_container->end();

	$form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('filter[per_page]', $per_page, array('id' => 'filter_per_page', 'min' => 1)), 'filter_per_page');

$form_container->end();