Vergleich admin/modules/tools/spamlog.php - 1.8.3 - 1.8.19

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 41Zeile 41
	if($mybb->request_method == 'post')
{
$is_today = false;

	if($mybb->request_method == 'post')
{
$is_today = false;

 
		$mybb->input['older_than'] = $mybb->get_input('older_than', MyBB::INPUT_INT);

		if($mybb->input['older_than'] <= 0)
{
$is_today = true;
$mybb->input['older_than'] = 1;
}

		if($mybb->input['older_than'] <= 0)
{
$is_today = true;
$mybb->input['older_than'] = 1;
}

		$where = 'dateline < '.(TIME_NOW-((int)$mybb->input['older_than']*86400));

		$where = 'dateline < '.(TIME_NOW-($mybb->input['older_than']*86400));


// Searching for entries in a specific module
if($mybb->input['filter_username'])


// Searching for entries in a specific module
if($mybb->input['filter_username'])

Zeile 97Zeile 98
	{
$mybb->input['older_than'] = '30';
}

	{
$mybb->input['older_than'] = '30';
}

	$form_container->output_row($lang->date_range, "", $lang->older_than.$form->generate_numeric_field('older_than', $mybb->input['older_than'], array('id' => 'older_than', 'style' => 'width: 30px'))." {$lang->days}", 'older_than');

	$form_container->output_row($lang->date_range, "", $lang->older_than.$form->generate_numeric_field('older_than', $mybb->input['older_than'], array('id' => 'older_than', 'style' => 'width: 50px', 'min' => 0))." {$lang->days}", 'older_than');

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

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

Zeile 114Zeile 115

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



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


	$perpage = $mybb->get_input('perpage', 1);

	$perpage = $mybb->get_input('perpage', MyBB::INPUT_INT);

	if(!$perpage)
{
$perpage = 20;
}


	if(!$perpage)
{
$perpage = 20;
}


	$where = 'WHERE 1=1';



	$where = '1=1';

$additional_criteria = array();


// Searching for entries witha specific username
if($mybb->input['username'])
{


// Searching for entries witha specific username
if($mybb->input['username'])
{

		$where .= " AND l.username='".$db->escape_string($mybb->input['username'])."'";
}

// Searching for entries with a specific email
if($mybb->input['email'] > 0)
{
$where .= " AND l.email='".$db->escape_string($mybb->input['email'])."'";



		$where .= " AND username='".$db->escape_string($mybb->input['username'])."'";
$additional_criteria[] = "username=".urlencode($mybb->input['username']);
}

// Searching for entries with a specific email
if($mybb->input['email'])
{
$where .= " AND email='".$db->escape_string($mybb->input['email'])."'";
$additional_criteria[] = "email=".urlencode($mybb->input['email']);

	}

// Searching for entries with a specific IP

	}

// Searching for entries with a specific IP

	if($mybb->input['email'] > 0)

	if($mybb->input['ipaddress'] > 0)

	{

	{

		$where .= " AND l.ipaddress='".$db->escape_binary(my_inet_pton($mybb->input['ipaddress']))."'";











		$where .= " AND ipaddress=".$db->escape_binary(my_inet_pton($mybb->input['ipaddress']));
$additional_criteria[] = "ipaddress=".urlencode($mybb->input['ipaddress']);
}

if($additional_criteria)
{
$additional_criteria = "&amp;".implode("&amp;", $additional_criteria);
}
else
{
$additional_criteria = '';

	}

// Order?
switch($mybb->input['sortby'])
{
case "username":

	}

// Order?
switch($mybb->input['sortby'])
{
case "username":

			$sortby = "l.username";
break;

			$sortby = "username";
break;

		case "email":

		case "email":

			$sortby = "l.email";
break;

			$sortby = "email";
break;

		case "ipaddress":

		case "ipaddress":

			$sortby = "l.ipaddress";

			$sortby = "ipaddress";

			break;
default:

			break;
default:

			$sortby = "l.dateline";
}

			$sortby = "dateline";
}

	$order = $mybb->input['order'];
if($order != "asc")
{
$order = "desc";

	$order = $mybb->input['order'];
if($order != "asc")
{
$order = "desc";

	}

// Pagination stuff
$sql = "
SELECT COUNT(sid) as count
FROM ".TABLE_PREFIX."spamlog
{$where};
";

	}

$query = $db->simple_select("spamlog", "COUNT(sid) AS count", $where);






	$rescount = $db->fetch_field($query, "count");

// Figure out if we need to display multiple pages.
if($mybb->input['page'] != "last")

	$rescount = $db->fetch_field($query, "count");

// Figure out if we need to display multiple pages.
if($mybb->input['page'] != "last")

	{
$pagecnt = $mybb->get_input('page', 1);
}

	{
$pagecnt = $mybb->get_input('page', MyBB::INPUT_INT);
}


$logcount = (int)$rescount;
$pages = $logcount / $perpage;
$pages = ceil($pages);


$logcount = (int)$rescount;
$pages = $logcount / $perpage;
$pages = ceil($pages);





	if($mybb->input['page'] == "last")

	if($mybb->input['page'] == "last")

	{

	{

		$pagecnt = $pages;

		$pagecnt = $pages;

	}

	}


if($pagecnt > $pages)
{


if($pagecnt > $pages)
{

Zeile 190Zeile 200
	}

if($pagecnt)

	}

if($pagecnt)

	{

	{

		$start = ($pagecnt-1) * $perpage;
}
else

		$start = ($pagecnt-1) * $perpage;
}
else

Zeile 198Zeile 208
		$start = 0;
$pagecnt = 1;
}

		$start = 0;
$pagecnt = 1;
}

	
// Build the base URL for pagination links
$url = 'index.php?module=tools-spamlog';

// The actual query
$sql = "
SELECT * FROM ".TABLE_PREFIX."spamlog l {$where}
ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
";
$query = $db->query($sql);


 

$table = new Table;
$table->construct_header($lang->spam_username, array('width' => '20%'));


$table = new Table;
$table->construct_header($lang->spam_username, array('width' => '20%'));

Zeile 217Zeile 215
	$table->construct_header($lang->spam_ip, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->spam_date, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->spam_confidence, array("class" => "align_center", 'width' => '20%'));

	$table->construct_header($lang->spam_ip, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->spam_date, array("class" => "align_center", 'width' => '20%'));
$table->construct_header($lang->spam_confidence, array("class" => "align_center", 'width' => '20%'));





$query = $db->simple_select("spamlog", "*", $where, array('order_by' => $sortby, 'order_dir' => $order, 'limit_start' => $start, 'limit' => $perpage));

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

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

Zeile 239Zeile 238
				$confidence = (double)$data['confidence'].'%';
}
}

				$confidence = (double)$data['confidence'].'%';
}
}

 

$search_sfs = "<div class=\"float_right\"><a href=\"http://www.stopforumspam.com/ipcheck/{$ip_address}\" target=\"_blank\" rel=\"noopener\"><img src=\"styles/{$page->style}/images/icons/find.png\" title=\"{$lang->search_ip_on_sfs}\" alt=\"{$lang->search}\" /></a></div>";


$table->construct_cell($username);
$table->construct_cell($email);


$table->construct_cell($username);
$table->construct_cell($email);

		$table->construct_cell($ip_address);

		$table->construct_cell("{$search_sfs}<div>{$ip_address}</div>");

		$table->construct_cell($dateline);
$table->construct_cell($confidence);

		$table->construct_cell($dateline);
$table->construct_cell($confidence);

		$table->construct_row();
}


		$table->construct_row();
}


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

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

	}


	}


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

// Do we need to construct the pagination?
if($rescount > $perpage)
{

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

// Do we need to construct the pagination?
if($rescount > $perpage)
{

		echo draw_admin_pagination($pagecnt, $perpage, $rescount, "index.php?module=tools-modlog&amp;perpage=$perpage&amp;uid={$mybb->input['uid']}&amp;fid={$mybb->input['fid']}&amp;sortby={$mybb->input['sortby']}&amp;order={$order}")."<br />";

		echo draw_admin_pagination($pagecnt, $perpage, $rescount, "index.php?module=tools-spamlog&amp;perpage={$perpage}{$additional_criteria}&amp;sortby={$mybb->input['sortby']}&amp;order={$order}")."<br />";

	}

	}

	



	// Fetch filter options
$sortbysel[$mybb->input['sortby']] = "selected=\"selected\"";
$ordersel[$mybb->input['order']] = "selected=\"selected\"";

	// Fetch filter options
$sortbysel[$mybb->input['sortby']] = "selected=\"selected\"";
$ordersel[$mybb->input['order']] = "selected=\"selected\"";

Zeile 271Zeile 272
		'username' => $lang->spam_username,
'email' => $lang->spam_email,
'ipaddress' => $lang->spam_ip,

		'username' => $lang->spam_username,
'email' => $lang->spam_email,
'ipaddress' => $lang->spam_ip,

	);


	);


	$order_array = array(
'asc' => $lang->asc,
'desc' => $lang->desc
);

	$order_array = array(
'asc' => $lang->asc,
'desc' => $lang->desc
);





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

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

	$form_container->output_row($lang->spam_username, "", $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'suername');

	$form_container->output_row($lang->spam_username, "", $form->generate_text_box('username', htmlspecialchars_uni($mybb->get_input('username')), array('id' => 'username')), 'suername');

	$form_container->output_row($lang->spam_email, "", $form->generate_text_box('email', $mybb->input['email'], array('id' => 'email')), 'email');
$form_container->output_row($lang->spam_ip, "", $form->generate_text_box('ipaddress', $mybb->input['ipaddress'], array('id' => 'ipaddress')), 'ipaddress');
$form_container->output_row($lang->sort_by, "", $form->generate_select_box('sortby', $sort_by, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('order', $order_array, $order, array('id' => 'order'))." {$lang->order}", 'order');

	$form_container->output_row($lang->spam_email, "", $form->generate_text_box('email', $mybb->input['email'], array('id' => 'email')), 'email');
$form_container->output_row($lang->spam_ip, "", $form->generate_text_box('ipaddress', $mybb->input['ipaddress'], array('id' => 'ipaddress')), 'ipaddress');
$form_container->output_row($lang->sort_by, "", $form->generate_select_box('sortby', $sort_by, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('order', $order_array, $order, array('id' => 'order'))." {$lang->order}", 'order');

	$form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('perpage', $perpage, array('id' => 'perpage')), 'perpage');

	$form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('perpage', $perpage, array('id' => 'perpage', 'min' => 1)), 'perpage');


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


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


$page->output_footer();

 

$page->output_footer();
}


$page->output_footer();
}