Vergleich modcp.php - 1.6.12 - 1.6.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19
$templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements,modcp_editprofile_select_option,modcp_editprofile_select,modcp_finduser_noresults";
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special,modcp_warninglogs_warning_revoked,modcp_warninglogs_warning,modcp_ipsearch_result";
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields,modcp_ipsearch_noresults,modcp_ipsearch_results,modcp_ipsearch_misc_info";

$templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements,modcp_editprofile_select_option,modcp_editprofile_select,modcp_finduser_noresults";
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special,modcp_warninglogs_warning_revoked,modcp_warninglogs_warning,modcp_ipsearch_result";
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields,modcp_ipsearch_noresults,modcp_ipsearch_results,modcp_ipsearch_misc_info";

$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread";

$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread,modcp_nobanned";

$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,modcp_announcements_forum_nomod,modcp_announcements_announcement,multipage_prevpage";
$templatelist .= ",multipage_start,multipage_page_current,multipage_page,multipage_end,multipage_nextpage,multipage";


$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,modcp_announcements_forum_nomod,modcp_announcements_announcement,multipage_prevpage";
$templatelist .= ",multipage_start,multipage_page_current,multipage_page,multipage_end,multipage_nextpage,multipage";


Zeile 40Zeile 40
if($mybb->user['uid'] == 0 || $mybb->usergroup['canmodcp'] != 1)
{
error_no_permission();

if($mybb->user['uid'] == 0 || $mybb->usergroup['canmodcp'] != 1)
{
error_no_permission();

 
}

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

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

}

$errors = '';

}

$errors = '';

Zeile 68Zeile 78
else
{
$flist = $tflist = '';

else
{
$flist = $tflist = '';

}

}


// Retrieve a list of unviewable forums
$unviewableforums = get_unviewable_forums();


// Retrieve a list of unviewable forums
$unviewableforums = get_unviewable_forums();

Zeile 95Zeile 105
add_breadcrumb($lang->nav_modcp, "modcp.php");

if($mybb->input['action'] == "do_reports")

add_breadcrumb($lang->nav_modcp, "modcp.php");

if($mybb->input['action'] == "do_reports")

{

{

	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


Zeile 112Zeile 122
		$rids = "'0','{$rids}'";

$sql = "rid IN ({$rids})";

		$rids = "'0','{$rids}'";

$sql = "rid IN ({$rids})";

	}


	}


	$plugins->run_hooks("modcp_do_reports");

$db->update_query("reportedposts", array('reportstatus' => 1), "{$sql}{$flist}");

	$plugins->run_hooks("modcp_do_reports");

$db->update_query("reportedposts", array('reportstatus' => 1), "{$sql}{$flist}");

Zeile 131Zeile 141
	if(!$mybb->settings['threadsperpage'])
{
$mybb->settings['threadsperpage'] = 20;

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

	}

	}


// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];


// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];

Zeile 144Zeile 154
	$report_count = $db->fetch_field($query, "count");

$mybb->input['rid'] = intval($mybb->input['rid']);

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

$mybb->input['rid'] = intval($mybb->input['rid']);


if($mybb->input['rid'])
{
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'");
$result = $db->fetch_field($query, "count");
if(($result % $perpage) == 0)


if($mybb->input['rid'])
{
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'");
$result = $db->fetch_field($query, "count");
if(($result % $perpage) == 0)

		{
$page = $result / $perpage;
}

		{
$page = $result / $perpage;
}

Zeile 163Zeile 173
	$pages = ceil($pages);

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

	$pages = ceil($pages);

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

	{

	{

		$page = $pages;

		$page = $pages;

	}

	}


if($page > $pages || $page <= 0)


if($page > $pages || $page <= 0)

	{
$page = 1;
}

	{
$page = 1;
}


if($page && $page > 0)
{


if($page && $page > 0)
{

Zeile 198Zeile 208
	$plugins->run_hooks("modcp_reports_start");

$reports = '';

	$plugins->run_hooks("modcp_reports_start");

$reports = '';

	$query = $db->query("
SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."reportedposts r
LEFT JOIN ".TABLE_PREFIX."posts p ON (r.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)

	$query = $db->query("
SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."reportedposts r
LEFT JOIN ".TABLE_PREFIX."posts p ON (r.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)

		LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
WHERE r.reportstatus='0'
ORDER BY r.dateline DESC

		LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
WHERE r.reportstatus='0'
ORDER BY r.dateline DESC

Zeile 226Zeile 236

$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);


$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);

 


			$report['posterlink'] = get_profile_link($report['postuid']);

			$report['posterlink'] = get_profile_link($report['postuid']);

 
			if(!$report['postuid'])
{
$report['posterlink'] = $report['postlink'];
$report['postusername'] = $lang->guest;
}


			$report['reporterlink'] = get_profile_link($report['uid']);

			$report['reporterlink'] = get_profile_link($report['uid']);

 
			if($report['uid'] > 0 && !$report['username'])
{
$report['reporterlink'] = $report['postlink'];
$report['username'] = $lang->na_deleted;
}


			$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));

eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");
}

			$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));

eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");
}

	}

$plugins->run_hooks("modcp_reports_end");


	}

$plugins->run_hooks("modcp_reports_end");


	eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";");
output_page($reportedposts);
}

	eval("\$reportedposts = \"".$templates->get("modcp_reports")."\";");
output_page($reportedposts);
}

Zeile 253Zeile 276

// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];


// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];

	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);
}


	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);
}


	$query = $db->simple_select("reportedposts", "COUNT(rid) AS count");
$warnings = $db->fetch_field($query, "count");


	$query = $db->simple_select("reportedposts", "COUNT(rid) AS count");
$warnings = $db->fetch_field($query, "count");


Zeile 335Zeile 358
			$report['posterlink'] = get_profile_link($report['postuid']);
$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['postusername'] = build_profile_link($report['postusername'], $report['postuid']);

			$report['posterlink'] = get_profile_link($report['postuid']);
$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['postusername'] = build_profile_link($report['postusername'], $report['postuid']);

 


			$report['reporterlink'] = get_profile_link($report['uid']);

			$report['reporterlink'] = get_profile_link($report['uid']);

 
			if($report['uid'] > 0 && !$report['username'])
{
$report['reporterlink'] = $report['postlink'];
$report['username'] = $lang->na_deleted;
}


$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);


$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);

Zeile 417Zeile 446

$query = $db->query("
SELECT COUNT(l.dateline) AS count


$query = $db->query("
SELECT COUNT(l.dateline) AS count

		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)

		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)

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

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

Zeile 428Zeile 457
	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

	}

	}


$postcount = intval($rescount);
$pages = $postcount / $perpage;


$postcount = intval($rescount);
$pages = $postcount / $perpage;

Zeile 440Zeile 469
	}

if($page > $pages || $page <= 0)

	}

if($page > $pages || $page <= 0)

	{

	{

		$page = 1;
}


		$page = 1;
}


Zeile 452Zeile 481
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}

	}


$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&amp;perpage=$perpage&amp;uid={$mybb->input['uid']}&amp;fid={$mybb->input['fid']}&amp;sortby={$mybb->input['sortby']}&amp;order={$mybb->input['order']}");
if($postcount > $perpage)


$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&amp;perpage=$perpage&amp;uid={$mybb->input['uid']}&amp;fid={$mybb->input['fid']}&amp;sortby={$mybb->input['sortby']}&amp;order={$mybb->input['order']}");
if($postcount > $perpage)

Zeile 460Zeile 489
		eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
}
$query = $db->query("

		eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
}
$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 1=1 {$where}{$tflist}

		WHERE 1=1 {$where}{$tflist}

		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");
while($logitem = $db->fetch_array($query))
{
$information = '';
$logitem['action'] = htmlspecialchars_uni($logitem['action']);
$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);

		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");
while($logitem = $db->fetch_array($query))
{
$information = '';
$logitem['action'] = htmlspecialchars_uni($logitem['action']);
$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);

		$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])

		$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])

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

		{
$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\">{$logitem['fname']}</a><br />";

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

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

// Edited a user?
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])

		}

// Edited a user or managed announcement?
if(!$logitem['tsubject'] || !$logitem['fname'])





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

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

			{

			{

				$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
}

				$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
}

		}






			if($data['aid'])
{
$information = "<strong>{$lang->announcement}:</strong> <a href=\"".get_announcement_link($data['aid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['subject'])."</a>";
}
}


		eval("\$results .= \"".$templates->get("modcp_modlogs_result")."\";");
}

if(!$results)

		eval("\$results .= \"".$templates->get("modcp_modlogs_result")."\";");
}

if(!$results)

	{

	{

		eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";");
}


		eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";");
}


Zeile 533Zeile 561
		if($mybb->input['uid'] == $user['uid'])
{
$selected = " selected=\"selected\"";

		if($mybb->input['uid'] == $user['uid'])
{
$selected = " selected=\"selected\"";

		}

		}

		$user_options .= "<option value=\"{$user['uid']}\"{$selected}>".htmlspecialchars_uni($user['username'])."</option>\n";
}


		$user_options .= "<option value=\"{$user['uid']}\"{$selected}>".htmlspecialchars_uni($user['username'])."</option>\n";
}


Zeile 547Zeile 575
{
verify_post_check($mybb->input['my_post_key']);


{
verify_post_check($mybb->input['my_post_key']);


	$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);
}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();
}

$plugins->run_hooks("modcp_do_delete_announcement");


	$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);
}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();
}

$plugins->run_hooks("modcp_do_delete_announcement");


	$db->delete_query("announcements", "aid='{$aid}'");

	$db->delete_query("announcements", "aid='{$aid}'");

 
	log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted);

	$cache->update_forumsdisplay();

redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);

	$cache->update_forumsdisplay();

redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);

}


}


if($mybb->input['action'] == "delete_announcement")
{
$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");

$announcement = $db->fetch_array($query);

if($mybb->input['action'] == "delete_announcement")
{
$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");

$announcement = $db->fetch_array($query);

	$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);

	$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);


if(!$announcement['aid'])
{


if(!$announcement['aid'])
{

Zeile 587Zeile 616
	}

$plugins->run_hooks("modcp_delete_announcement");

	}

$plugins->run_hooks("modcp_delete_announcement");





	eval("\$announcements = \"".$templates->get("modcp_announcements_delete")."\";");
output_page($announcements);
}

	eval("\$announcements = \"".$templates->get("modcp_announcements_delete")."\";");
output_page($announcements);
}

Zeile 688Zeile 717
			'allowmycode' => $db->escape_string($mybb->input['allowmycode']),
'allowsmilies' => $db->escape_string($mybb->input['allowsmilies']),
);

			'allowmycode' => $db->escape_string($mybb->input['allowmycode']),
'allowsmilies' => $db->escape_string($mybb->input['allowsmilies']),
);



 
		$aid = $db->insert_query("announcements", $insert_announcement);

		$aid = $db->insert_query("announcements", $insert_announcement);

 

log_moderator_action(array("aid" => $aid, "subject" => $db->escape_string($mybb->input['title'])), $lang->announcement_added);


$plugins->run_hooks("modcp_do_new_announcement_end");



$plugins->run_hooks("modcp_do_new_announcement_end");


Zeile 907Zeile 937
		if($startdate[0] >= 24)
{
$startdate[0] = "00";

		if($startdate[0] >= 24)
{
$startdate[0] = "00";

		}
}


		}
}


	if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];
if($enddate[0] >= 24)
{
$enddate[0] = "00";

	if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];
if($enddate[0] >= 24)
{
$enddate[0] = "00";

		}
}

		}
}


$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;


$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;

	}


	}


	$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));
if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)
{

	$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));
if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)
{

Zeile 932Zeile 962
	}

if($mybb->input['endtime_type'] == "2")

	}

if($mybb->input['endtime_type'] == "2")

	{

	{

		$enddate = '0';
}
else

		$enddate = '0';
}
else

Zeile 969Zeile 999
		);

$db->update_query("announcements", $update_announcement, "aid='{$aid}'");

		);

$db->update_query("announcements", $update_announcement, "aid='{$aid}'");

 

log_moderator_action(array("aid" => $announcement['aid'], "subject" => $db->escape_string($mybb->input['title'])), $lang->announcement_edited);


$plugins->run_hooks("modcp_do_edit_announcement_end");



$plugins->run_hooks("modcp_do_edit_announcement_end");


Zeile 1379Zeile 1411
		$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");

$query = $db->query("

		$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");

$query = $db->query("

			SELECT t.tid, t.dateline, t.fid, t.subject, p.message AS postmessage, u.username AS username, t.uid

			SELECT t.tid, t.dateline, t.fid, t.subject, t.username AS threadusername, p.message AS postmessage, u.username AS username, t.uid

			FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=t.firstpost)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

			FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=t.firstpost)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

Zeile 1396Zeile 1428
			$forum_name = $forum_cache[$thread['fid']]['name'];
$threaddate = my_date($mybb->settings['dateformat'], $thread['dateline']);
$threadtime = my_date($mybb->settings['timeformat'], $thread['dateline']);

			$forum_name = $forum_cache[$thread['fid']]['name'];
$threaddate = my_date($mybb->settings['dateformat'], $thread['dateline']);
$threadtime = my_date($mybb->settings['timeformat'], $thread['dateline']);

			$profile_link = build_profile_link($thread['username'], $thread['uid']);


















if($thread['username'] == "")
{
if($thread['threadusername'] != "")
{
$profile_link = $thread['threadusername'];
}
else
{
$profile_link = $lang->guest;
}
}
else
{
$profile_link = build_profile_link($thread['username'], $thread['uid']);
}


			$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));
$forum = "<strong>{$lang->meta_forum} <a href=\"{$thread['forumlink']}\">{$forum_name}</a></strong>";
eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");

			$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));
$forum = "<strong>{$lang->meta_forum} <a href=\"{$thread['forumlink']}\">{$forum_name}</a></strong>";
eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");

Zeile 1408Zeile 1456
		}

if($threads)

		}

if($threads)

		{

		{

			add_breadcrumb($lang->mcp_nav_modqueue_threads, "modcp.php?action=modqueue&amp;type=threads");

$plugins->run_hooks("modcp_modqueue_threads_end");

			add_breadcrumb($lang->mcp_nav_modqueue_threads, "modcp.php?action=modqueue&amp;type=threads");

$plugins->run_hooks("modcp_modqueue_threads_end");

Zeile 1440Zeile 1488

$perpage = $mybb->settings['postsperpage'];
$pages = $unapproved_posts / $perpage;


$perpage = $mybb->settings['postsperpage'];
$pages = $unapproved_posts / $perpage;

		$pages = ceil($pages);

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

		$pages = ceil($pages);

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

			$page = $pages;
}

if($page > $pages || $page <= 0)

			$page = $pages;
}

if($page > $pages || $page <= 0)

		{
$page = 1;

		{
$page = 1;

		}

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

		}

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

		}

		}

		else
{
$start = 0;
$page = 1;

		else
{
$start = 0;
$page = 1;

		}


		}


		$multipage = multipage($unapproved_posts, $perpage, $page, "modcp.php?action=modqueue&amp;type=posts");

$query = $db->query("

		$multipage = multipage($unapproved_posts, $perpage, $page, "modcp.php?action=modqueue&amp;type=posts");

$query = $db->query("

			SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline

			SELECT p.pid, p.subject, p.message, p.username AS postusername, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline

			FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

			FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

Zeile 1483Zeile 1531
			$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);

			$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);

			$profile_link = build_profile_link($post['username'], $post['uid']);


















if($post['username'] == "")
{
if($post['postusername'] != "")
{
$profile_link = $post['postusername'];
}
else
{
$profile_link = $lang->guest;
}
}
else
{
$profile_link = build_profile_link($post['username'], $post['uid']);
}


			$thread = "<strong>{$lang->meta_thread} <a href=\"{$post['threadlink']}\">{$post['threadsubject']}</a></strong>";
$forum = "<strong>{$lang->meta_forum} <a href=\"{$post['forumlink']}\">{$forum_name}</a></strong><br />";
$post['message'] = nl2br(htmlspecialchars_uni($post['message']));

			$thread = "<strong>{$lang->meta_thread} <a href=\"{$post['threadlink']}\">{$post['threadsubject']}</a></strong>";
$forum = "<strong>{$lang->meta_forum} <a href=\"{$post['forumlink']}\">{$forum_name}</a></strong><br />";
$post['message'] = nl2br(htmlspecialchars_uni($post['message']));

Zeile 1491Zeile 1555
		}

if(!$posts && $mybb->input['type'] == "posts")

		}

if(!$posts && $mybb->input['type'] == "posts")

		{
eval("\$posts = \"".$templates->get("modcp_modqueue_posts_empty")."\";");

		{
eval("\$posts = \"".$templates->get("modcp_modqueue_posts_empty")."\";");

		}

if($posts)
{
add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&amp;type=posts");

		}

if($posts)
{
add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&amp;type=posts");





			$plugins->run_hooks("modcp_modqueue_posts_end");

eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$postqueue = \"".$templates->get("modcp_modqueue_posts")."\";");
output_page($postqueue);

			$plugins->run_hooks("modcp_modqueue_posts_end");

eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$postqueue = \"".$templates->get("modcp_modqueue_posts")."\";");
output_page($postqueue);

		}

		}

	}

if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue))

	}

if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue))

Zeile 1522Zeile 1586
		if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

		if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

		}

		}


$perpage = $mybb->settings['postsperpage'];
$pages = $unapproved_attachments / $perpage;


$perpage = $mybb->settings['postsperpage'];
$pages = $unapproved_attachments / $perpage;

Zeile 1539Zeile 1603
		}

if($page)

		}

if($page)

		{

		{

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

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

Zeile 1621Zeile 1685
	$user = get_user($mybb->input['uid']);
if(!$user['uid'])
{

	$user = get_user($mybb->input['uid']);
if(!$user['uid'])
{

		error($lang->invalid_user);

		error($lang->error_nomember);

	}

// Check if the current user has permission to edit this user

	}

// Check if the current user has permission to edit this user

Zeile 1774Zeile 1838
						{
$extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length;
}

						{
$extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length;
}

					}

					}

				}
}
}

				}
}
}

Zeile 1787Zeile 1851
		}

if(is_array($errors))

		}

if(is_array($errors))

		{

		{

			$mybb->input['action'] = "editprofile";
}
else

			$mybb->input['action'] = "editprofile";
}
else

Zeile 1800Zeile 1864
			log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);

$plugins->run_hooks("modcp_do_editprofile_end");

			log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);

$plugins->run_hooks("modcp_do_editprofile_end");





			redirect("modcp.php?action=finduser", $lang->redirect_user_updated);
}
}

			redirect("modcp.php?action=finduser", $lang->redirect_user_updated);
}
}

Zeile 1812Zeile 1876

$user = get_user($mybb->input['uid']);
if(!$user['uid'])


$user = get_user($mybb->input['uid']);
if(!$user['uid'])

	{
error($lang->invalid_user);
}

	{
error($lang->error_nomember);
}


// Check if the current user has permission to edit this user
if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();


// Check if the current user has permission to edit this user
if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();

	}


	}


	if($user['website'] == "" || $user['website'] == "http://")

	if($user['website'] == "" || $user['website'] == "http://")

	{

	{

		$user['website'] = "http://";
}

if($user['icq'] != "0")

		$user['website'] = "http://";
}

if($user['icq'] != "0")

	{

	{

		$user['icq'] = intval($user['icq']);

		$user['icq'] = intval($user['icq']);

	}

	}

	if($user['icq'] == 0)
{
$user['icq'] = "";

	if($user['icq'] == 0)
{
$user['icq'] = "";

	}

	}


if(!$errors)
{
$mybb->input = array_merge($user, $mybb->input);
list($mybb->input['birthday_day'], $mybb->input['birthday_month'], $mybb->input['birthday_year']) = explode("-", $user['birthday']);


if(!$errors)
{
$mybb->input = array_merge($user, $mybb->input);
list($mybb->input['birthday_day'], $mybb->input['birthday_month'], $mybb->input['birthday_year']) = explode("-", $user['birthday']);

	}

	}

	else
{
$errors = inline_error($errors);

	else
{
$errors = inline_error($errors);

Zeile 1863Zeile 1927

if(!empty($display_group['usertitle']))
{


if(!empty($display_group['usertitle']))
{

		$defaulttitle = $display_group['usertitle'];

		$defaulttitle = htmlspecialchars_uni($display_group['usertitle']);

	}
else
{

	}
else
{

Zeile 1880Zeile 1944
	}

if(empty($user['usertitle']))

	}

if(empty($user['usertitle']))

	{
$lang->current_custom_usertitle = '';
}

	{
$lang->current_custom_usertitle = '';
}


$bdaysel = '';
for($i = 1; $i <= 31; ++$i)


$bdaysel = '';
for($i = 1; $i <= 31; ++$i)

Zeile 1890Zeile 1954
		if($mybb->input['birthday_day'] == $i)
{
$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		if($mybb->input['birthday_day'] == $i)
{
$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		}
else

		}
else

		{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
}

		{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
}

Zeile 1910Zeile 1974
	while($profilefield = $db->fetch_array($query))
{
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);

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

 
		$profilefield['name'] = htmlspecialchars_uni($profilefield['name']);

		$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);
$thing = explode("\n", $profilefield['type'], "2");
$type = $thing[0];

		$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);
$thing = explode("\n", $profilefield['type'], "2");
$type = $thing[0];

Zeile 1919Zeile 1984
		if($errors)
{
$userfield = $mybb->input['profile_fields'][$field];

		if($errors)
{
$userfield = $mybb->input['profile_fields'][$field];

		}

		}

		else

		else

		{

		{

			$userfield = $user_fields[$field];
}
if($type == "multiselect")

			$userfield = $user_fields[$field];
}
if($type == "multiselect")

		{
if($errors)
{
$useropts = $userfield;
}
else
{
$useropts = explode("\n", $userfield);








		{
if($errors)
{
$useropts = $userfield;
}
else
{
$useropts = explode("\n", $userfield);
}
if(is_array($useropts))
{
foreach($useropts as $key => $val)
{
$seloptions[$val] = $val;
}

			}

			}

			if(is_array($useropts))
{
foreach($useropts as $key => $val)
{
$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))

			$expoptions = explode("\n", $options);
if(is_array($expoptions))








			{
foreach($expoptions as $key => $val)
{

			{
foreach($expoptions as $key => $val)
{

Zeile 1955Zeile 2020
						$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

						$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

				}
if(!$profilefield['length'])

				}
if(!$profilefield['length'])

				{
$profilefield['length'] = 3;
}

				{
$profilefield['length'] = 3;
}

Zeile 1987Zeile 2052
			}
}
elseif($type == "radio")

			}
}
elseif($type == "radio")

		{
$expoptions = explode("\n", $options);
if(is_array($expoptions))

		{
$expoptions = explode("\n", $options);
if(is_array($expoptions))

			{
foreach($expoptions as $key => $val)
{
$checked = "";
if($val == $userfield)

			{
foreach($expoptions as $key => $val)
{
$checked = "";
if($val == $userfield)

					{
$checked = " checked=\"checked\"";

					{
$checked = " checked=\"checked\"";

					}
$code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />";
}
}
}
elseif($type == "checkbox")

					}
$code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />";
}
}
}
elseif($type == "checkbox")

		{

		{

			if($errors)
{
$useropts = $userfield;

			if($errors)
{
$useropts = $userfield;

Zeile 2043Zeile 2108
			$value = htmlspecialchars_uni($userfield);
$maxlength = "";
if($profilefield['maxlength'] > 0)

			$value = htmlspecialchars_uni($userfield);
$maxlength = "";
if($profilefield['maxlength'] > 0)

			{

			{

				$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";
}
if($profilefield['required'] == 1)

				$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";
}
if($profilefield['required'] == 1)

		{

		{

			eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
else

			eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
else

Zeile 2068Zeile 2133
	if($customfields)
{
eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");

	if($customfields)
{
eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");

	}

	}


$lang->edit_profile = $lang->sprintf($lang->edit_profile, $user['username']);
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);


$lang->edit_profile = $lang->sprintf($lang->edit_profile, $user['username']);
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);

Zeile 2080Zeile 2145
	{
$checked = 1;
$checked_item = "checked=\"checked\"";

	{
$checked = 1;
$checked_item = "checked=\"checked\"";

	}
else

	}
else

	{
$checked = 0;
}

// Do we mark the moderate posts box?
if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))

	{
$checked = 0;
}

// Do we mark the moderate posts box?
if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))

	{

	{

		$modpost_check = 1;
$modpost_checked = "checked=\"checked\"";

		$modpost_check = 1;
$modpost_checked = "checked=\"checked\"";

	}

	}

	else
{
$modpost_check = 0;

	else
{
$modpost_check = 0;

	}


	}


	// Do we mark the suspend posts box?
if($user['suspendposting'] || ($mybb->input['suspendposting'] && !empty($errors)))
{

	// Do we mark the suspend posts box?
if($user['suspendposting'] || ($mybb->input['suspendposting'] && !empty($errors)))
{

Zeile 2204Zeile 2269
			case "suspendposting":
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";");
break;

			case "suspendposting":
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";");
break;

		}
}


		}
}


	eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");

	eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");





	$plugins->run_hooks("modcp_editprofile_end");

	$plugins->run_hooks("modcp_editprofile_end");





	eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";");
output_page($edituser);
}

	eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";");
output_page($edituser);
}

Zeile 2223Zeile 2288
	if(!$perpage || $perpage <= 0)
{
$perpage = $mybb->settings['threadsperpage'];

	if(!$perpage || $perpage <= 0)
{
$perpage = $mybb->settings['threadsperpage'];

	}

	}

	$where = '';

	$where = '';





	if($mybb->input['username'])
{
$where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->input['username']))."%'";

	if($mybb->input['username'])
{
$where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->input['username']))."%'";

	}


	}


	// Sort order & direction
switch($mybb->input['sortby'])
{

	// Sort order & direction
switch($mybb->input['sortby'])
{

Zeile 2250Zeile 2315
	if($order != "asc")
{
$order = "desc";

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

	}


	}


	$query = $db->simple_select("users", "COUNT(uid) AS count", "1=1 {$where}");
$user_count = $db->fetch_field($query, "count");

	$query = $db->simple_select("users", "COUNT(uid) AS count", "1=1 {$where}");
$user_count = $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")

	{
$page = intval($mybb->input['page']);
}


	{
$page = intval($mybb->input['page']);
}


	$pages = $user_count / $perpage;
$pages = ceil($pages);


	$pages = $user_count / $perpage;
$pages = ceil($pages);


Zeile 2310Zeile 2375
		$regtime = my_date($mybb->settings['timeformat'], $user['regdate']);
$lastdate = my_date($mybb->settings['dateformat'], $user['lastvisit']);
$lasttime = my_date($mybb->settings['timeformat'], $user['lastvisit']);

		$regtime = my_date($mybb->settings['timeformat'], $user['regdate']);
$lastdate = my_date($mybb->settings['dateformat'], $user['lastvisit']);
$lasttime = my_date($mybb->settings['timeformat'], $user['lastvisit']);

		$usergroup = $usergroups_cache[$user['usergroup']]['title'];

		$usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);

		eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");
}


		eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");
}


Zeile 2476Zeile 2541
		if($row['expires'] > 0)
{
$expire_date = my_date($mybb->settings['dateformat'], $row['expires']).' '.my_date($mybb->settings['timeformat'], $row['expires']);

		if($row['expires'] > 0)
{
$expire_date = my_date($mybb->settings['dateformat'], $row['expires']).' '.my_date($mybb->settings['timeformat'], $row['expires']);

		}

		}

		else
{
$expire_date = $lang->never;

		else
{
$expire_date = $lang->never;

Zeile 2488Zeile 2553
		}
$title = htmlspecialchars_uni($title);
if($row['points'] >= 0)

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

		{

		{

			$points = '+'.$row['points'];
}

			$points = '+'.$row['points'];
}





		eval("\$warning_list .= \"".$templates->get("modcp_warninglogs_warning")."\";");

		eval("\$warning_list .= \"".$templates->get("modcp_warninglogs_warning")."\";");

	}


	}


	if(!$warning_list)
{
eval("\$warning_list = \"".$templates->get("modcp_warninglogs_nologs")."\";");

	if(!$warning_list)
{
eval("\$warning_list = \"".$templates->get("modcp_warninglogs_nologs")."\";");

Zeile 2513Zeile 2578
	if($mybb->input['ipaddress'])
{
if(!is_array($groupscache))

	if($mybb->input['ipaddress'])
{
if(!is_array($groupscache))

		{

		{

			$groupscache = $cache->read("usergroups");
}


			$groupscache = $cache->read("usergroups");
}


Zeile 2526Zeile 2591
			if(strpos($mybb->input['ipaddress'], ":") !== false)
{
$post_ip_sql = "ipaddress LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";

			if(strpos($mybb->input['ipaddress'], ":") !== false)
{
$post_ip_sql = "ipaddress LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";

			}
else
{
$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);


			}
else
{
$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);


				if($ip_range)
{
if(!is_array($ip_range))

				if($ip_range)
{
if(!is_array($ip_range))

Zeile 2551Zeile 2616
				$query = $db->query("
SELECT COUNT(pid) AS count
FROM ".TABLE_PREFIX."posts

				$query = $db->query("
SELECT COUNT(pid) AS count
FROM ".TABLE_PREFIX."posts

					WHERE {$post_ip_sql}

					WHERE {$post_ip_sql} AND visible >= 0

				");

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

				");

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

Zeile 2638Zeile 2703
		{
$start = 0;
$page = 1;

		{
$start = 0;
$page = 1;

		}

		}


$page_url = "modcp.php?action=ipsearch&amp;perpage={$perpage}";
foreach(array('ipaddress', 'search_users', 'search_posts') as $input)


$page_url = "modcp.php?action=ipsearch&amp;perpage={$perpage}";
foreach(array('ipaddress', 'search_users', 'search_posts') as $input)

Zeile 2702Zeile 2767
			$query = $db->query("
SELECT username AS postusername, uid, subject, pid, tid, ipaddress
FROM ".TABLE_PREFIX."posts

			$query = $db->query("
SELECT username AS postusername, uid, subject, pid, tid, ipaddress
FROM ".TABLE_PREFIX."posts

				WHERE {$post_ip_sql}

				WHERE {$post_ip_sql} AND visible >= 0

				ORDER BY dateline DESC
LIMIT {$post_start}, {$post_limit}
");

				ORDER BY dateline DESC
LIMIT {$post_start}, {$post_limit}
");

Zeile 2745Zeile 2810
		}

if(!$results)

		}

if(!$results)

		{

		{

			eval("\$results = \"".$templates->get("modcp_ipsearch_noresults")."\";");
}


			eval("\$results = \"".$templates->get("modcp_ipsearch_noresults")."\";");
}


Zeile 2850Zeile 2915
	if($mybb->input['page'] == "last")
{
$page = $pages;

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

	}


	}


	if($page > $pages || $page <= 0)

	if($page > $pages || $page <= 0)

	{
$page = 1;
}


	{
$page = 1;
}


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

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

Zeile 2870Zeile 2935

$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=banning");
if($postcount > $perpage)


$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=banning");
if($postcount > $perpage)

	{

	{

		eval("\$allbannedpages = \"".$templates->get("modcp_banning_multipage")."\";");
}


		eval("\$allbannedpages = \"".$templates->get("modcp_banning_multipage")."\";");
}


Zeile 2904Zeile 2969
		if($banned['reason'])
{
$banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));

		if($banned['reason'])
{
$banned['reason'] = htmlspecialchars_uni($parser->parse_badwords($banned['reason']));

		}
else

		}
else

		{
$banned['reason'] = $lang->na;
}

		{
$banned['reason'] = $lang->na;
}

Zeile 2923Zeile 2988
			$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining < 3600)

			$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining < 3600)

			{

			{

				$timeremaining = "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>";
}
else if($remaining < 86400)
{
$timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";

				$timeremaining = "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>";
}
else if($remaining < 86400)
{
$timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";

			}

			}

			else if($remaining < 604800)
{
$timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>";

			else if($remaining < 604800)
{
$timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>";

Zeile 2941Zeile 3006
		}

eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";");

		}

eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";");

	}


	}


	if(!$bannedusers)
{
eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";");

	if(!$bannedusers)
{
eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";");

Zeile 2955Zeile 3020
}

if($mybb->input['action'] == "liftban")

}

if($mybb->input['action'] == "liftban")

{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	$query = $db->simple_select("banned", "*", "uid='".intval($mybb->input['uid'])."'");
$ban = $db->fetch_array($query);

if(!$ban['uid'])
{
error($lang->error_invalidban);

	$query = $db->simple_select("banned", "*", "uid='".intval($mybb->input['uid'])."'");
$ban = $db->fetch_array($query);

if(!$ban['uid'])
{
error($lang->error_invalidban);

	}


	}


	// Permission to edit this ban?
if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
{
error_no_permission();
}

	// Permission to edit this ban?
if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
{
error_no_permission();
}





	$plugins->run_hooks("modcp_liftban_start");

$query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'");

	$plugins->run_hooks("modcp_liftban_start");

$query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'");

Zeile 2985Zeile 3050
	);
$db->update_query("users", $updated_group, "uid='{$ban['uid']}'");
$db->delete_query("banned", "uid='{$ban['uid']}'");

	);
$db->update_query("users", $updated_group, "uid='{$ban['uid']}'");
$db->delete_query("banned", "uid='{$ban['uid']}'");





	$cache->update_banned();
$cache->update_moderators();
log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);

	$cache->update_banned();
$cache->update_moderators();
log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);

Zeile 3010Zeile 3075
			LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid)
WHERE b.uid='{$mybb->input['uid']}'
");

			LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid)
WHERE b.uid='{$mybb->input['uid']}'
");

		$user = $db->fetch_array($query);
if(!$user['uid'])

		$user = $db->fetch_array($query);
if(!$user['uid'])

		{
error($lang->error_invalidban);
}

// Permission to edit this ban?
if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)

		{
error($lang->error_invalidban);
}

// Permission to edit this ban?
if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)

		{

		{

			error_no_permission();
}
}

			error_no_permission();
}
}

Zeile 3031Zeile 3096
		if(!$user['uid'])
{
$errors[] = $lang->invalid_username;

		if(!$user['uid'])
{
$errors[] = $lang->invalid_username;

		}
}


		}
}


	if($user['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_cannotbanself;

	if($user['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_cannotbanself;

	}


	}


	// Have permissions to ban this user?
if(!modcp_can_manage_user($user['uid']))
{

	// Have permissions to ban this user?
if(!modcp_can_manage_user($user['uid']))
{

Zeile 3065Zeile 3130
		if($db->fetch_field($query, "uid"))
{
$errors[] = $lang->error_useralreadybanned;

		if($db->fetch_field($query, "uid"))
{
$errors[] = $lang->error_useralreadybanned;

		}
}

$plugins->run_hooks("modcp_do_banuser_start");


		}
}

$plugins->run_hooks("modcp_do_banuser_start");


	// Still no errors? Ban the user
if(!$errors)
{

	// Still no errors? Ban the user
if(!$errors)
{

Zeile 3088Zeile 3153
			$username_select = $db->simple_select('users', 'username', "uid='" . (int)$mybb->input['uid'] . "'");
$user['username'] = $db->fetch_field($username_select, 'username');
$update_array = array(

			$username_select = $db->simple_select('users', 'username', "uid='" . (int)$mybb->input['uid'] . "'");
$user['username'] = $db->fetch_field($username_select, 'username');
$update_array = array(

				'gid' => intval($mybb->input['usergroup']),
'admin' => intval($mybb->user['uid']),
'dateline' => TIME_NOW,

				'gid' => intval($mybb->input['usergroup']),
'admin' => intval($mybb->user['uid']),
'dateline' => TIME_NOW,

				'bantime' => $db->escape_string($mybb->input['liftafter']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($mybb->input['banreason'])

				'bantime' => $db->escape_string($mybb->input['liftafter']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($mybb->input['banreason'])

Zeile 3123Zeile 3188
			'additionalgroups' => '',
);
$db->update_query('users', $update_array, "uid = {$user['uid']}");

			'additionalgroups' => '',
);
$db->update_query('users', $update_array, "uid = {$user['uid']}");





		$cache->update_banned();

// Log edit or add ban
if($mybb->input['uid'])
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);

		$cache->update_banned();

// Log edit or add ban
if($mybb->input['uid'])
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);

		}

		}

		else
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user);

		else
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user);

		}

$plugins->run_hooks("modcp_do_banuser_end");


		}

$plugins->run_hooks("modcp_do_banuser_end");


		if($mybb->input['uid'])
{
redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);

		if($mybb->input['uid'])
{
redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);

Zeile 3157Zeile 3222
if($mybb->input['action'] == "banuser")
{
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");

if($mybb->input['action'] == "banuser")
{
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");





	if($mybb->input['uid'])
{
add_breadcrumb($lang->mcp_nav_ban_user);

	if($mybb->input['uid'])
{
add_breadcrumb($lang->mcp_nav_ban_user);

Zeile 3177Zeile 3242
			FROM ".TABLE_PREFIX."banned b
LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid)
WHERE b.uid='{$mybb->input['uid']}'

			FROM ".TABLE_PREFIX."banned b
LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid)
WHERE b.uid='{$mybb->input['uid']}'

		");

		");

		$banned = $db->fetch_array($query);
if($banned['username'])
{

		$banned = $db->fetch_array($query);
if($banned['username'])
{

Zeile 3187Zeile 3252
			$user = get_user($banned['uid']);
$lang->ban_user = $lang->edit_ban; // Swap over lang variables
eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");

			$user = get_user($banned['uid']);
$lang->ban_user = $lang->edit_ban; // Swap over lang variables
eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");

		}
}


		}
}


	// New ban!
if(!$banuser_username)
{

	// New ban!
if(!$banuser_username)
{

Zeile 3222Zeile 3287
	{
$liftlist .= "<option value=\"{$time}\"";
if($banned['bantime'] == $time)

	{
$liftlist .= "<option value=\"{$time}\"";
if($banned['bantime'] == $time)

		{

		{

			$liftlist .= " selected=\"selected\"";

			$liftlist .= " selected=\"selected\"";

		}

		}

		$thatime = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time, $banned['dateline']));
if($time == '---')

		$thatime = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time, $banned['dateline']));
if($time == '---')

		{

		{

			$liftlist .= ">{$title}</option>\n";

			$liftlist .= ">{$title}</option>\n";

		}
else
{

		}
else
{

			$liftlist .= ">{$title} ({$thatime})</option>\n";
}
}

			$liftlist .= ">{$title} ({$thatime})</option>\n";
}
}

Zeile 3251Zeile 3316
	$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";

$plugins->run_hooks("modcp_banuser_end");

	$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";

$plugins->run_hooks("modcp_banuser_end");





	eval("\$banuser = \"".$templates->get("modcp_banuser")."\";");
output_page($banuser);
}

	eval("\$banuser = \"".$templates->get("modcp_banuser")."\";");
output_page($banuser);
}

Zeile 3284Zeile 3349
		WHERE a.visible='0' {$tflist}
");
$unapproved_attachments = $db->fetch_field($query, "unapprovedattachments");

		WHERE a.visible='0' {$tflist}
");
$unapproved_attachments = $db->fetch_field($query, "unapprovedattachments");





	if($unapproved_attachments > 0)
{
$query = $db->query("

	if($unapproved_attachments > 0)
{
$query = $db->query("

Zeile 3381Zeile 3446
	}

$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 l.dateline DESC
LIMIT 5

		{$where}
ORDER BY l.dateline DESC
LIMIT 5

Zeile 3403Zeile 3467
		$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])
{

		$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])
{

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

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

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

		}
if($logitem['fname'])
{
$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']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>";

 
		}


		}


		// Edited a user?
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])

		// Edited a user or managed announcement?
if(!$logitem['tsubject'] || !$logitem['fname'])

		{
$data = unserialize($logitem['data']);
if($data['uid'])
{
$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
}

		{
$data = unserialize($logitem['data']);
if($data['uid'])
{
$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
}

		}





			if($data['aid'])
{
$information = "<strong>{$lang->announcement}:</strong> <a href=\"".get_announcement_link($data['aid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['subject'])."</a>";
}
}


eval("\$modlogresults .= \"".$templates->get("modcp_modlogs_result")."\";");
}


eval("\$modlogresults .= \"".$templates->get("modcp_modlogs_result")."\";");
}

Zeile 3452Zeile 3516
		if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
{
$edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&amp;uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&amp;uid={$banned['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>";

		if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
{
$edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&amp;uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&amp;uid={$banned['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>";

		}


		}


		$admin_profile = build_profile_link($banned['adminuser'], $banned['admin']);

$trow = alt_trow();

		$admin_profile = build_profile_link($banned['adminuser'], $banned['admin']);

$trow = alt_trow();

Zeile 3480Zeile 3544
			$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining <= 0)

			$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining <= 0)

			{

			{

				$timeremaining = "<span style=\"color: red;\">({$lang->ban_ending_imminently})</span>";
}
else if($remaining < 3600)

				$timeremaining = "<span style=\"color: red;\">({$lang->ban_ending_imminently})</span>";
}
else if($remaining < 3600)

Zeile 3500Zeile 3564
				$timeremaining = "({$timeremaining} {$lang->ban_remaining})";
}
}

				$timeremaining = "({$timeremaining} {$lang->ban_remaining})";
}
}





		eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";");
}

if(!$bannedusers)
{

		eval("\$bannedusers .= \"".$templates->get("modcp_banning_ban")."\";");
}

if(!$bannedusers)
{

		eval("\$bannedusers = \"".$templates->get("modcp_banning_nobanned")."\";");

		eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";");

	}

$modnotes = $cache->read("modnotes");

	}

$modnotes = $cache->read("modnotes");