Vergleich admin/modules/tools/modlog.php - 1.6.4 - 1.6.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: modlog.php 5453 2011-04-21 23:58:33Z jammerx2 $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 33Zeile 33
if($mybb->input['action'] == 'prune')
{
$plugins->run_hooks("admin_tools_modlog_prune");

if($mybb->input['action'] == 'prune')
{
$plugins->run_hooks("admin_tools_modlog_prune");

	



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

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

		



		// Searching for entries by a particular user
if($mybb->input['uid'])
{
$where .= " AND uid='".intval($mybb->input['uid'])."'";

		// Searching for entries by a particular user
if($mybb->input['uid'])
{
$where .= " AND uid='".intval($mybb->input['uid'])."'";

		}


		}


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

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

		{

		{

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

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

		





		else
{
$mybb->input['fid'] = 0;
}


		$db->delete_query("moderatorlog", $where);
$num_deleted = $db->affected_rows();

		$db->delete_query("moderatorlog", $where);
$num_deleted = $db->affected_rows();

		



		$plugins->run_hooks("admin_tools_modlog_prune_commit");

		$plugins->run_hooks("admin_tools_modlog_prune_commit");

		



		if(!is_array($forum_cache))
{
$forum_cache = cache_forums();
}

		if(!is_array($forum_cache))
{
$forum_cache = cache_forums();
}

		



		// Log admin action
log_admin_action($mybb->input['older_than'], $mybb->input['uid'], $mybb->input['fid'], $num_deleted, $forum_cache[$mybb->input['fid']]['name']);


		// Log admin action
log_admin_action($mybb->input['older_than'], $mybb->input['uid'], $mybb->input['fid'], $num_deleted, $forum_cache[$mybb->input['fid']]['name']);


Zeile 69Zeile 73
	$page->add_breadcrumb_item($lang->prune_mod_logs, "index.php?module=tools-modlog&amp;action=prune");
$page->output_header($lang->prune_mod_logs);
$page->output_nav_tabs($sub_tabs, 'prune_mod_logs');

	$page->add_breadcrumb_item($lang->prune_mod_logs, "index.php?module=tools-modlog&amp;action=prune");
$page->output_header($lang->prune_mod_logs);
$page->output_nav_tabs($sub_tabs, 'prune_mod_logs');

	



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

	



	$user_options[''] = $lang->all_moderators;
$user_options['0'] = '----------';

	$user_options[''] = $lang->all_moderators;
$user_options['0'] = '----------';

	



	$query = $db->query("
SELECT DISTINCT l.uid, u.username
FROM ".TABLE_PREFIX."moderatorlog l

	$query = $db->query("
SELECT DISTINCT l.uid, u.username
FROM ".TABLE_PREFIX."moderatorlog l

Zeile 84Zeile 88
		ORDER BY u.username ASC
");
while($user = $db->fetch_array($query))

		ORDER BY u.username ASC
");
while($user = $db->fetch_array($query))

	{

	{

		$user_options[$user['uid']] = $user['username'];

		$user_options[$user['uid']] = $user['username'];

	}


	}


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

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

	$form_container->output_row($lang->forum, "", $form->generate_forum_select('fid', $mybb->input['fid'], array('id' => 'fid', 'main_option' => $lang->all_forums)), 'fid');	

	$form_container->output_row($lang->forum, "", $form->generate_forum_select('fid', $mybb->input['fid'], array('id' => 'fid', 'main_option' => $lang->all_forums)), 'fid');

	$form_container->output_row($lang->forum_moderator, "", $form->generate_select_box('uid', $user_options, $mybb->input['uid'], array('id' => 'uid')), 'uid');
if(!$mybb->input['older_than'])
{

	$form_container->output_row($lang->forum_moderator, "", $form->generate_select_box('uid', $user_options, $mybb->input['uid'], array('id' => 'uid')), 'uid');
if(!$mybb->input['older_than'])
{

Zeile 101Zeile 105
	$buttons[] = $form->generate_submit_button($lang->prune_moderator_logs);
$form->output_submit_wrapper($buttons);
$form->end();

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

	



	$page->output_footer();
}

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_tools_modlog_start");

	$page->output_footer();
}

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_tools_modlog_start");

	



	$page->output_header($lang->mod_logs);

	$page->output_header($lang->mod_logs);

	



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

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

	



	$perpage = intval($mybb->input['perpage']);
if(!$perpage)
{
$perpage = $mybb->settings['threadsperpage'];

	$perpage = intval($mybb->input['perpage']);
if(!$perpage)
{
$perpage = $mybb->settings['threadsperpage'];

	}

	}


$where = 'WHERE 1=1';



$where = 'WHERE 1=1';


Zeile 138Zeile 142
	{
case "username":
$sortby = "u.username";

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

			break;

			break;

		case "forum":
$sortby = "f.name";

		case "forum":
$sortby = "f.name";

			break;

			break;

		case "thread":
$sortby = "t.subject";
break;

		case "thread":
$sortby = "t.subject";
break;

Zeile 160Zeile 164
		{$where}
");
$rescount = $db->fetch_field($query, "count");

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

	



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

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

Zeile 190Zeile 194
		$start = 0;
$pagecnt = 1;
}

		$start = 0;
$pagecnt = 1;
}

	



	$table = new Table;
$table->construct_header($lang->username, array('width' => '10%'));
$table->construct_header($lang->date, array("class" => "align_center", 'width' => '15%'));
$table->construct_header($lang->action, array("class" => "align_center", 'width' => '35%'));
$table->construct_header($lang->information, array("class" => "align_center", 'width' => '30%'));
$table->construct_header($lang->ipaddress, array("class" => "align_center", 'width' => '10%'));

	$table = new Table;
$table->construct_header($lang->username, array('width' => '10%'));
$table->construct_header($lang->date, array("class" => "align_center", 'width' => '15%'));
$table->construct_header($lang->action, array("class" => "align_center", 'width' => '35%'));
$table->construct_header($lang->information, array("class" => "align_center", 'width' => '30%'));
$table->construct_header($lang->ipaddress, array("class" => "align_center", 'width' => '10%'));

	



	$query = $db->query("
SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject
FROM ".TABLE_PREFIX."moderatorlog l

	$query = $db->query("
SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject
FROM ".TABLE_PREFIX."moderatorlog l

Zeile 212Zeile 216
	while($logitem = $db->fetch_array($query))
{
$information = '';

	while($logitem = $db->fetch_array($query))
{
$information = '';

		$logitem['action'] = $logitem['action'];

		$logitem['action'] = htmlspecialchars_uni($logitem['action']);

		$logitem['dateline'] = date("jS M Y, G:i", $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);

		$logitem['dateline'] = date("jS M Y, G:i", $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);

Zeile 235Zeile 239
			$data = unserialize($logitem['data']);
if($data['uid'])
{

			$data = unserialize($logitem['data']);
if($data['uid'])
{

				$information = $lang->user_info." <a href=\"".get_profile_link($data['uid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['username'])."</a>";

				$information = $lang->user_info." <a href=\"../".get_profile_link($data['uid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['username'])."</a>";

			}
}


			}
}


Zeile 246Zeile 250
		$table->construct_cell($logitem['ipaddress'], array("class" => "align_center"));
$table->construct_row();
}

		$table->construct_cell($logitem['ipaddress'], array("class" => "align_center"));
$table->construct_row();
}

	



	if($table->num_rows() == 0)

	if($table->num_rows() == 0)

	{

	{

		$table->construct_cell($lang->no_modlogs, array("colspan" => "5"));
$table->construct_row();
}

		$table->construct_cell($lang->no_modlogs, array("colspan" => "5"));
$table->construct_row();
}

	



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

	$table->output($lang->mod_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 />";
}

	// 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 />";
}

	



	// 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\"";

	



	$user_options[''] = $lang->all_moderators;
$user_options['0'] = '----------';

	$user_options[''] = $lang->all_moderators;
$user_options['0'] = '----------';

	



	$query = $db->query("
SELECT DISTINCT l.uid, u.username
FROM ".TABLE_PREFIX."moderatorlog l

	$query = $db->query("
SELECT DISTINCT l.uid, u.username
FROM ".TABLE_PREFIX."moderatorlog l

Zeile 283Zeile 287
		}
$user_options[$user['uid']] = $user['username'];
}

		}
$user_options[$user['uid']] = $user['username'];
}

	



	$sort_by = array(
'dateline' => $lang->date,
'username' => $lang->username,
'forum' => $lang->forum_name,
'thread' => $lang->thread_subject
);

	$sort_by = array(
'dateline' => $lang->date,
'username' => $lang->username,
'forum' => $lang->forum_name,
'thread' => $lang->thread_subject
);

	



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

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

Zeile 298Zeile 302

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


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

	$form_container->output_row($lang->forum, "", $form->generate_forum_select('fid', $mybb->input['fid'], array('id' => 'fid', 'main_option' => $lang->all_forums)), 'fid');	
$form_container->output_row($lang->forum_moderator, "", $form->generate_select_box('uid', $user_options, $mybb->input['uid'], array('id' => 'uid')), 'uid');
$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_text_box('perpage', $perpage, array('id' => 'perpage')), 'perpage');


	$form_container->output_row($lang->forum, "", $form->generate_forum_select('fid', $mybb->input['fid'], array('id' => 'fid', 'main_option' => $lang->all_forums)), 'fid');
$form_container->output_row($lang->forum_moderator, "", $form->generate_select_box('uid', $user_options, $mybb->input['uid'], array('id' => 'uid')), 'uid');
$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_text_box('perpage', $perpage, array('id' => 'perpage')), 'perpage');


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

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

	



	$page->output_footer();
}
?>

	$page->output_footer();
}
?>