Vergleich admin/modules/tools/spamlog.php - 1.8.2 - 1.8.37

  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 86Zeile 87
	$page->output_nav_tabs($sub_tabs, 'prune_spam_logs');

// Fetch filter options

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

// Fetch filter options

	$sortbysel[$mybb->input['sortby']] = 'selected="selected"';
$ordersel[$mybb->input['order']] = 'selected="selected"';

	$sortbysel[$mybb->get_input('sortby')] = 'selected="selected"';
$ordersel[$mybb->get_input('order')] = 'selected="selected"';


$form = new Form("index.php?module=tools-spamlog&amp;action=prune", "post");
$form_container = new FormContainer($lang->prune_spam_logs);


$form = new Form("index.php?module=tools-spamlog&amp;action=prune", "post");
$form_container = new FormContainer($lang->prune_spam_logs);

	$form_container->output_row($lang->spam_username, "", $form->generate_text_box('filter_username', $mybb->input['filter_username'], array('id' => 'filter_username')), 'filter_username');
$form_container->output_row($lang->spam_email, "", $form->generate_text_box('filter_email', $mybb->input['filter_email'], array('id' => 'filter_email')), 'filter_email');
if(!$mybb->input['older_than'])

	$form_container->output_row($lang->spam_username, "", $form->generate_text_box('filter_username', $mybb->get_input('filter_username'), array('id' => 'filter_username')), 'filter_username');
$form_container->output_row($lang->spam_email, "", $form->generate_text_box('filter_email', $mybb->get_input('filter_email'), array('id' => 'filter_email')), 'filter_email');
if(!$mybb->get_input('older_than'))

	{
$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->get_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 106Zeile 107
	$page->output_footer();
}


	$page->output_footer();
}


if(!$mybb->input['action'])

if(!$mybb->get_input('action'))

{
$plugins->run_hooks("admin_tools_spamlog_start");


{
$plugins->run_hooks("admin_tools_spamlog_start");


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


// Searching for entries witha specific username

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



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


	// Searching for entries with a specific email

	// Searching for entries with a specific email

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


	if($mybb->get_input('email'))
{
$where .= " AND email='".$db->escape_string($mybb->get_input('email'))."'";
$additional_criteria[] = "email=".urlencode($mybb->get_input('email'));
}

	
// Searching for entries with a specific IP

	
// Searching for entries with a specific IP

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











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

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

	{

	{

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

		$additional_criteria = '';

	}

// Order?

	}

// Order?

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

	switch($mybb->get_input('sortby'))

	{
case "username":

	{
case "username":

			$sortby = "l.username";

			$sortby = "username";

			break;
case "email":

			break;
case "email":

			$sortby = "l.email";

			$sortby = "email";

			break;
case "ipaddress":

			break;
case "ipaddress":

			$sortby = "l.ipaddress";

			$sortby = "ipaddress";

			break;
default:

			break;
default:

			$sortby = "l.dateline";

			$sortby = "dateline";

	}

	}

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

	$order = $mybb->get_input('order');

	if($order != "asc")
{
$order = "desc";
}


	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.

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


	if($mybb->get_input('page') != "last")
{
$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->get_input('page') == "last")
{

		$pagecnt = $pages;

		$pagecnt = $pages;

	}

	}


if($pagecnt > $pages)
{


if($pagecnt > $pages)
{

Zeile 192Zeile 202
	if($pagecnt)
{
$start = ($pagecnt-1) * $perpage;

	if($pagecnt)
{
$start = ($pagecnt-1) * $perpage;

	}

	}

	else
{
$start = 0;
$pagecnt = 1;
}

	else
{
$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->construct_header($lang->spam_email, 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%'));

	$table = new Table;
$table->construct_header($lang->spam_username, array('width' => '20%'));
$table->construct_header($lang->spam_email, 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_row();

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

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

	// 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->get_input('sortby')}&amp;order={$order}")."<br />";

	}

	}

	



	// Fetch filter options

	// Fetch filter options

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

	$sortbysel[$mybb->get_input('sortby')] = "selected=\"selected\"";
$ordersel[$mybb->get_input('order')] = "selected=\"selected\"";


$sort_by = array(
'dateline' => $lang->spam_date,


$sort_by = array(
'dateline' => $lang->spam_date,

Zeile 280Zeile 281

$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_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->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->get_input('email'), array('id' => 'email')), 'email');
$form_container->output_row($lang->spam_ip, "", $form->generate_text_box('ipaddress', $mybb->get_input('ipaddress'), array('id' => 'ipaddress')), 'ipaddress');
$form_container->output_row($lang->sort_by, "", $form->generate_select_box('sortby', $sort_by, $mybb->get_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', '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();
}