Vergleich admin/modules/tools/modlog.php - 1.6.6 - 1.6.17

  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'])

		// Searching for entries by a particular user
if($mybb->input['uid'])

		{

		{

			$where .= " AND uid='".intval($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 90Zeile 94

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

	$page->output_footer();
}





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

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 = intval($mybb->input['perpage']);
if(!$perpage)
{

 
		if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{
$mybb->settings['threadsperpage'] = 20;
}


		$perpage = $mybb->settings['threadsperpage'];
}


		$perpage = $mybb->settings['threadsperpage'];
}


Zeile 160Zeile 169
		{$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 199
		$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("

	$query = $db->query("

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)

 
		{$where}
ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}

		{$where}
ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}

Zeile 220Zeile 228
		if($logitem['tsubject'])
{
$information = "<strong>{$lang->thread}</strong> <a href=\"../".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";

		if($logitem['tsubject'])
{
$information = "<strong>{$lang->thread}</strong> <a href=\"../".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";

		}

		}

		if($logitem['fname'])

		if($logitem['fname'])

		{

		{

			$information .= "<strong>{$lang->forum}</strong> <a href=\"../".get_forum_link($logitem['fid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['fname'])."</a><br />";

			$information .= "<strong>{$lang->forum}</strong> <a href=\"../".get_forum_link($logitem['fid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['fname'])."</a><br />";

		}
if($logitem['psubject'])
{
$information .= "<strong>{$lang->post}</strong> <a href=\"../".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\" target=\"_blank\">".htmlspecialchars_uni($logitem['psubject'])."</a>";

 
		}


		}


		if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])

		if(!$logitem['tsubject'] || !$logitem['fname'])

		{
$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 = "<strong>{$lang->user_info}</strong> <a href=\"../".get_profile_link($data['uid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['username'])."</a>";
}
if($data['aid'])
{
$information = "<strong>{$lang->announcement}</strong> <a href=\"../".get_announcement_link($data['aid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['subject'])."</a>";

			}
}


			}
}


Zeile 246Zeile 254
		$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)
{
$table->construct_cell($lang->no_modlogs, array("colspan" => "5"));
$table->construct_row();
}

	if($table->num_rows() == 0)
{
$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 291
		}
$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 306

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