Vergleich admin/modules/tools/warninglog.php - 1.8.10 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
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";

	{
case "username":
$sortby = "u.username";

Zeile 305Zeile 314
			$sortby = "w.dateline";
$sortbysel['dateline'] = ' selected="selected"';
}

			$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"';

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}

			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)

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

	{

	{

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

		$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'];

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

	}

	}

	$start = ($view_page-1) * $per_page;

	$start = ($view_page-1) * $per_page;

 
	$pages = ceil($total_warnings / $per_page);
if($view_page > $pages)
{
$start = 0;
$view_page = 1;
}

	// Build the base URL for pagination links
$url = 'index.php?module=tools-warninglog';
if(is_array($mybb->input['filter']) && count($mybb->input['filter']))

	// Build the base URL for pagination links
$url = 'index.php?module=tools-warninglog';
if(is_array($mybb->input['filter']) && count($mybb->input['filter']))

Zeile 382Zeile 396
	$table->construct_header($lang->expires, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->issued_by, array("class" => "align_center", 'width' => '15%'));
$table->construct_header($lang->options, array("class" => "align_center", 'width' => '5%'));

	$table->construct_header($lang->expires, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->issued_by, array("class" => "align_center", 'width' => '15%'));
$table->construct_header($lang->options, array("class" => "align_center", 'width' => '5%'));





	while($row = $db->fetch_array($query))
{
if(!$row['username'])

	while($row = $db->fetch_array($query))
{
if(!$row['username'])

		{

		{

			$row['username'] = $lang->guest;
}


			$row['username'] = $lang->guest;
}


Zeile 395Zeile 409
		if(!$row['uid'])
{
$username_link = $username;

		if(!$row['uid'])
{
$username_link = $username;

		}

		}

		else
{
$username_link = build_profile_link($username, $row['uid'], "_blank");

		else
{
$username_link = build_profile_link($username, $row['uid'], "_blank");

Zeile 408Zeile 422
		{
$revoked_date = my_date('relative', $row['daterevoked']);
$revoked_text = "<br /><small><strong>{$lang->revoked}</strong> {$revoked_date}</small>";

		{
$revoked_date = my_date('relative', $row['daterevoked']);
$revoked_text = "<br /><small><strong>{$lang->revoked}</strong> {$revoked_date}</small>";

		}

		}

		if($row['expires'] > 0)

		if($row['expires'] > 0)

		{

		{

			$expire_date = my_date('relative', $row['expires']);
}
else
{
$expire_date = $lang->never;

			$expire_date = my_date('relative', $row['expires']);
}
else
{
$expire_date = $lang->never;

		}

		}

		$title = $row['title'];
if(empty($row['title']))

		$title = $row['title'];
if(empty($row['title']))

		{

		{

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

			$title = $row['custom_title'];
}
$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"));

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

Zeile 449Zeile 464
	if($total_warnings > $per_page)
{
echo draw_admin_pagination($view_page, $per_page, $total_warnings, $url)."<br />";

	if($total_warnings > $per_page)
{
echo draw_admin_pagination($view_page, $per_page, $total_warnings, $url)."<br />";

	}

	}


$sort_by = array(
'expires' => $lang->expiry_date,


$sort_by = array(
'expires' => $lang->expiry_date,

Zeile 462Zeile 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] = null;
}
}


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