Vergleich modcp.php - 1.6.10 - 1.6.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 51Zeile 51
	while($forum = $db->fetch_array($query))
{
$flist .= ",'{$forum['fid']}'";

	while($forum = $db->fetch_array($query))
{
$flist .= ",'{$forum['fid']}'";

		



		$children = get_child_list($forum['fid']);
if(!empty($children))
{
$flist .= ",'".implode("','", $children)."'";
}
$moderated_forums[] = $forum['fid'];

		$children = get_child_list($forum['fid']);
if(!empty($children))
{
$flist .= ",'".implode("','", $children)."'";
}
$moderated_forums[] = $forum['fid'];

	}

	}

	if($flist)
{
$tflist = " AND t.fid IN (0{$flist})";
$flist = " AND fid IN (0{$flist})";

	if($flist)
{
$tflist = " AND t.fid IN (0{$flist})";
$flist = " AND fid IN (0{$flist})";

	}
}

	}
}

else
{
$flist = $tflist = '';

else
{
$flist = $tflist = '';

Zeile 102Zeile 102
	if(!is_array($mybb->input['reports']))
{
error($lang->error_noselected_reports);

	if(!is_array($mybb->input['reports']))
{
error($lang->error_noselected_reports);

	}

	}


$sql = '1=1';
if(!$mybb->input['allbox'])


$sql = '1=1';
if(!$mybb->input['allbox'])

	{

	{

		$mybb->input['reports'] = array_map("intval", $mybb->input['reports']);
$rids = implode($mybb->input['reports'], "','");
$rids = "'0','{$rids}'";

		$mybb->input['reports'] = array_map("intval", $mybb->input['reports']);
$rids = implode($mybb->input['reports'], "','");
$rids = "'0','{$rids}'";

Zeile 118Zeile 118

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


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

	



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

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

	



	redirect("modcp.php?action=reports&page={$page}", $lang->redirect_reportsmarked);
}

	redirect("modcp.php?action=reports&page={$page}", $lang->redirect_reportsmarked);
}





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

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

Zeile 144Zeile 144
	$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)
{
$page = $result / $perpage;
}
else
{


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;
}
else
{

			$page = intval($result / $perpage) + 1;
}
}
$postcount = intval($report_count);
$pages = $postcount / $perpage;
$pages = ceil($pages);

			$page = intval($result / $perpage) + 1;
}
}
$postcount = intval($report_count);
$pages = $postcount / $perpage;
$pages = ceil($pages);





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

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

Zeile 180Zeile 180
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}

	}

	$upper = $start+$perpage;

$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=reports");
if($postcount > $perpage)
{
eval("\$reportspages = \"".$templates->get("modcp_reports_multipage")."\";");

	$upper = $start+$perpage;

$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=reports");
if($postcount > $perpage)
{
eval("\$reportspages = \"".$templates->get("modcp_reports_multipage")."\";");

	}

	}


$query = $db->simple_select("forums", "fid, name");
while($forum = $db->fetch_array($query))
{
$forums[$forum['fid']] = $forum['name'];
}


$query = $db->simple_select("forums", "fid, name");
while($forum = $db->fetch_array($query))
{
$forums[$forum['fid']] = $forum['name'];
}

	



	$plugins->run_hooks("modcp_reports_start");

$reports = '';

	$plugins->run_hooks("modcp_reports_start");

$reports = '';

Zeile 206Zeile 206
		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'

		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

		ORDER BY r.dateline DESC

		LIMIT {$start}, {$perpage}
");


		LIMIT {$start}, {$perpage}
");


Zeile 305Zeile 305
	{
eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";");
}

	{
eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";");
}

	



	$plugins->run_hooks("modcp_allreports_start");

$query = $db->query("

	$plugins->run_hooks("modcp_allreports_start");

$query = $db->query("

Zeile 329Zeile 329
		while($report = $db->fetch_array($query))
{
$trow = alt_trow();

		while($report = $db->fetch_array($query))
{
$trow = alt_trow();

			



			$report['threadlink'] = get_thread_link($report['tid']);

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

			$report['threadlink'] = get_thread_link($report['tid']);

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

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

if($report['reportstatus'] == 0)

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

if($report['reportstatus'] == 0)

			{

			{

				$trow = "trow_shaded";
}

				$trow = "trow_shaded";
}

			



			// No subject? Set it to N/A
if($report['threadsubject'] == '')
{

			// No subject? Set it to N/A
if($report['threadsubject'] == '')
{

Zeile 355Zeile 355
				// Only parse bad words and sanitize subject if there is one...
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
}

				// Only parse bad words and sanitize subject if there is one...
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
}

			



			$report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>";

eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";");

			$report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>";

eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";");

Zeile 412Zeile 412
	{
$order = "desc";
}

	{
$order = "desc";
}

	



	$plugins->run_hooks("modcp_modlogs_start");

	$plugins->run_hooks("modcp_modlogs_start");





	$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)
WHERE 1=1 {$where}{$tflist}
");

		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");

// Figure out if we need to display multiple pages.

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

// Figure out if we need to display multiple pages.

Zeile 440Zeile 440
	}

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;

	}

	}

	else
{
$start = 0;

	else
{
$start = 0;

Zeile 467Zeile 467
		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}

		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}

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

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

			$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->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";
}
if($logitem['fname'])

Zeile 494Zeile 494

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


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

		{

		{

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

		}

		}


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


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

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

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

	



	$plugins->run_hooks("modcp_modlogs_filter");

// Fetch filter options

	$plugins->run_hooks("modcp_modlogs_filter");

// Fetch filter options

Zeile 528Zeile 528
		{
$user['username'] = $lang->na_deleted;
}

		{
$user['username'] = $lang->na_deleted;
}

		



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

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

	}


	}


	$forum_select = build_forum_jump("", $mybb->input['fid'], 1, '', 0, true, '', "fid");

	$forum_select = build_forum_jump("", $mybb->input['fid'], 1, '', 0, true, '', "fid");





	eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";");
output_page($modlogs);

	eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";");
output_page($modlogs);

}


}


if($mybb->input['action'] == "do_delete_announcement")
{
verify_post_check($mybb->input['my_post_key']);

if($mybb->input['action'] == "do_delete_announcement")
{
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)))


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

	{
error_no_permission();
}

	



	$plugins->run_hooks("modcp_do_delete_announcement");

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

	$plugins->run_hooks("modcp_do_delete_announcement");

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

Zeile 575Zeile 575

$announcement = $db->fetch_array($query);
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);


$announcement = $db->fetch_array($query);
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);





	if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);

	if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);

Zeile 585Zeile 585
	{
error_no_permission();
}

	{
error_no_permission();
}

	



	$plugins->run_hooks("modcp_delete_announcement");

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

	$plugins->run_hooks("modcp_delete_announcement");

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

	output_page($announcements);

	output_page($announcements);

}

}





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

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

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

$announcement_fid = intval($mybb->input['fid']);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();
}

if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;
}

if(!trim($mybb->input['message']))
{
$errors[] = $lang->error_missing_message;
}

if(!trim($mybb->input['fid']))
{
$errors[] = $lang->error_missing_forum;
}

$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);
$enddate = @explode(":", $enddate[0]);

if(stristr($mybb->input['starttime_time'], "pm"))
{
$startdate[0] = 12+$startdate[0];
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";
}
}

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


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

$announcement_fid = intval($mybb->input['fid']);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();
}

if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;
}

if(!trim($mybb->input['message']))
{
$errors[] = $lang->error_missing_message;
}

if(!trim($mybb->input['fid']))
{
$errors[] = $lang->error_missing_forum;
}

$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);
$enddate = @explode(":", $enddate[0]);

if(stristr($mybb->input['starttime_time'], "pm"))
{
$startdate[0] = 12+$startdate[0];
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";
}
}

$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 671Zeile 671
		{
$errors[] = $lang->error_end_before_start;
}

		{
$errors[] = $lang->error_end_before_start;
}

	}


	}


	$plugins->run_hooks("modcp_do_new_announcement_start");

if(!$errors)

	$plugins->run_hooks("modcp_do_new_announcement_start");

if(!$errors)

Zeile 690Zeile 690
		);

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

		);

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

		



		$plugins->run_hooks("modcp_do_new_announcement_end");

		$plugins->run_hooks("modcp_do_new_announcement_end");

		



		$cache->update_forumsdisplay();
redirect("modcp.php?action=announcements", $lang->redirect_add_announcement);
}
else
{
$mybb->input['action'] = 'new_announcement';

		$cache->update_forumsdisplay();
redirect("modcp.php?action=announcements", $lang->redirect_add_announcement);
}
else
{
$mybb->input['action'] = 'new_announcement';

	}
}

	}
}


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


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

Zeile 708Zeile 708
	add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");

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

	add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");

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





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

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

Zeile 718Zeile 718
	if(is_array($errors))
{
$errors = inline_error($errors);

	if(is_array($errors))
{
$errors = inline_error($errors);

		



		// Set $announcement to input stuff
$announcement['subject'] = $mybb->input['title'];
$announcement['message'] = $mybb->input['message'];
$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		// Set $announcement to input stuff
$announcement['subject'] = $mybb->input['title'];
$announcement['message'] = $mybb->input['message'];
$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');


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

		if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

		



		if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;
}

		if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;
}

		



		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

Zeile 852Zeile 852
	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

	



	$plugins->run_hooks("modcp_new_announcement");

eval("\$announcements = \"".$templates->get("modcp_announcements_new")."\";");

	$plugins->run_hooks("modcp_new_announcement");

eval("\$announcements = \"".$templates->get("modcp_announcements_new")."\";");

Zeile 895Zeile 895
	{
$errors[] = $lang->error_missing_forum;
}

	{
$errors[] = $lang->error_missing_forum;
}

	



	$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);

	$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);

Zeile 907Zeile 907
		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(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];

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

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





	$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');			

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

	if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;

Zeile 932Zeile 932
	}

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

	}

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

	{

	{

		$enddate = '0';
}
else

		$enddate = '0';
}
else

	{		

	{

		if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;

		if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;

Zeile 951Zeile 951
			$errors[] = $lang->error_end_before_start;
}
}

			$errors[] = $lang->error_end_before_start;
}
}

	



	$plugins->run_hooks("modcp_do_edit_announcement_start");

// Proceed to update if no errors

	$plugins->run_hooks("modcp_do_edit_announcement_start");

// Proceed to update if no errors

Zeile 967Zeile 967
			'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']),
);





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

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

		



		$plugins->run_hooks("modcp_do_edit_announcement_end");

		$plugins->run_hooks("modcp_do_edit_announcement_end");

		



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

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

	}
else

	}
else

	{
$mybb->input['action'] = 'edit_announcement';
}

	{
$mybb->input['action'] = 'edit_announcement';
}

Zeile 1033Zeile 1033
		$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');


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

		if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

		



		if(!in_array($mybb->input['endtime_month'], $months))

		if(!in_array($mybb->input['endtime_month'], $months))

		{

		{

			$mybb->input['endtime_month'] = 1;
}

			$mybb->input['endtime_month'] = 1;
}

		



		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

Zeile 1078Zeile 1078
	for($i = 1; $i <= 31; ++$i)
{
if($startday == $i)

	for($i = 1; $i <= 31; ++$i)
{
if($startday == $i)

		{

		{

			$startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else
{
$startdateday .= "<option value=\"$i\">$i</option>\n";

			$startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else
{
$startdateday .= "<option value=\"$i\">$i</option>\n";

		}

		}


if($endday == $i)
{


if($endday == $i)
{

Zeile 1130Zeile 1130

$html_sel = $mycode_sel = $smilies_sel = array();
if($announcement['allowhtml'])


$html_sel = $mycode_sel = $smilies_sel = array();
if($announcement['allowhtml'])

	{

	{

		$html_sel['yes'] = ' checked="checked"';
}
else
{
$html_sel['no'] = ' checked="checked"';

		$html_sel['yes'] = ' checked="checked"';
}
else
{
$html_sel['no'] = ' checked="checked"';

	}

	}


if($announcement['allowmycode'])


if($announcement['allowmycode'])

	{

	{

		$mycode_sel['yes'] = ' checked="checked"';

		$mycode_sel['yes'] = ' checked="checked"';

	}
else
{

	}
else
{

		$mycode_sel['no'] = ' checked="checked"';
}

if($announcement['allowsmilies'])
{
$smilies_sel['yes'] = ' checked="checked"';

		$mycode_sel['no'] = ' checked="checked"';
}

if($announcement['allowsmilies'])
{
$smilies_sel['yes'] = ' checked="checked"';

	}

	}

	else
{
$smilies_sel['no'] = ' checked="checked"';

	else
{
$smilies_sel['no'] = ' checked="checked"';

Zeile 1168Zeile 1168
	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

	



	$plugins->run_hooks("modcp_edit_announcement");

eval("\$announcements = \"".$templates->get("modcp_announcements_edit")."\";");

	$plugins->run_hooks("modcp_edit_announcement");

eval("\$announcements = \"".$templates->get("modcp_announcements_edit")."\";");

Zeile 1189Zeile 1189
			continue;
}
$announcements[$announcement['fid']][$announcement['aid']] = $announcement;

			continue;
}
$announcements[$announcement['fid']][$announcement['aid']] = $announcement;

	}


	}


	if($mybb->usergroup['issupermod'] == 1)
{
if($global_announcements && $mybb->usergroup['issupermod'] == 1)

	if($mybb->usergroup['issupermod'] == 1)
{
if($global_announcements && $mybb->usergroup['issupermod'] == 1)

Zeile 1224Zeile 1224
	{
// Moderator is not super, so don't show global annnouncemnets
$announcements_global = '';

	{
// Moderator is not super, so don't show global annnouncemnets
$announcements_global = '';

	}

fetch_forum_announcements();


	}

fetch_forum_announcements();


	if(!$announcements_forum)
{
eval("\$announcements_forum = \"".$templates->get("modcp_no_announcements_forum")."\";");
}

	if(!$announcements_forum)
{
eval("\$announcements_forum = \"".$templates->get("modcp_no_announcements_forum")."\";");
}

	



	$plugins->run_hooks("modcp_announcements");

	$plugins->run_hooks("modcp_announcements");

	



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

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

Zeile 1246Zeile 1246

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


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

	



	$plugins->run_hooks("modcp_do_modqueue_start");

if(is_array($mybb->input['threads']))

	$plugins->run_hooks("modcp_do_modqueue_start");

if(is_array($mybb->input['threads']))

Zeile 1259Zeile 1259
			if($action == "approve")
{
$threads_to_approve[] = $thread['tid'];

			if($action == "approve")
{
$threads_to_approve[] = $thread['tid'];

			}

			}

			else if($action == "delete")
{
$threads_to_delete[] = $thread['tid'];
}
}
if(!empty($threads_to_approve))

			else if($action == "delete")
{
$threads_to_delete[] = $thread['tid'];
}
}
if(!empty($threads_to_approve))

		{

		{

			$moderation->approve_threads($threads_to_approve);
log_moderator_action(array('tids' => $threads_to_approve), $lang->multi_approve_threads);
}

			$moderation->approve_threads($threads_to_approve);
log_moderator_action(array('tids' => $threads_to_approve), $lang->multi_approve_threads);
}

Zeile 1278Zeile 1278
			}
log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);
}

			}
log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);
}

		



		$plugins->run_hooks("modcp_do_modqueue_end");

		$plugins->run_hooks("modcp_do_modqueue_end");

		



		redirect("modcp.php?action=modqueue", $lang->redirect_threadsmoderated);
}
else if(is_array($mybb->input['posts']))

		redirect("modcp.php?action=modqueue", $lang->redirect_threadsmoderated);
}
else if(is_array($mybb->input['posts']))

Zeile 1300Zeile 1300
			}
}
if(is_array($posts_to_approve))

			}
}
if(is_array($posts_to_approve))

		{

		{

			$moderation->approve_posts($posts_to_approve);
}
log_moderator_action(array('pids' => $posts_to_approve), $lang->multi_approve_posts);

			$moderation->approve_posts($posts_to_approve);
}
log_moderator_action(array('pids' => $posts_to_approve), $lang->multi_approve_posts);

		



		$plugins->run_hooks("modcp_do_modqueue_end");

		$plugins->run_hooks("modcp_do_modqueue_end");

		



		redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated);
}
else if(is_array($mybb->input['attachments']))

		redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated);
}
else if(is_array($mybb->input['attachments']))

Zeile 1322Zeile 1322
		{
$action = $mybb->input['attachments'][$attachment['aid']];
if($action == "approve")

		{
$action = $mybb->input['attachments'][$attachment['aid']];
if($action == "approve")

			{

			{

				$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");
}
else if($action == "delete")

				$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");
}
else if($action == "delete")

Zeile 1330Zeile 1330
				remove_attachment($attachment['pid'], '', $attachment['aid']);
}
}

				remove_attachment($attachment['pid'], '', $attachment['aid']);
}
}

		



		$plugins->run_hooks("modcp_do_modqueue_end");

		$plugins->run_hooks("modcp_do_modqueue_end");

		



		redirect("modcp.php?action=modqueue&type=attachments", $lang->redirect_attachmentsmoderated);
}
}

		redirect("modcp.php?action=modqueue&type=attachments", $lang->redirect_attachmentsmoderated);
}
}

Zeile 1354Zeile 1354

$perpage = $mybb->settings['threadsperpage'];
$pages = $unapproved_threads / $perpage;


$perpage = $mybb->settings['threadsperpage'];
$pages = $unapproved_threads / $perpage;

		$pages = ceil($pages);

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

		$pages = ceil($pages);

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

		{
$page = $pages;
}

		{
$page = $pages;
}

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

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

			



			$plugins->run_hooks("modcp_modqueue_threads_end");

			$plugins->run_hooks("modcp_modqueue_threads_end");

			



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

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

Zeile 1436Zeile 1436
		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_posts / $perpage;

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

		$pages = ceil($pages);

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

if($page > $pages || $page <= 0)
{
$page = 1;
}

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

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


		$pages = ceil($pages);

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

if($page > $pages || $page <= 0)
{
$page = 1;
}

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

$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
FROM ".TABLE_PREFIX."posts p

		$query = $db->query("
SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline
FROM ".TABLE_PREFIX."posts p

Zeile 1494Zeile 1494
		{
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");

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

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

Zeile 1568Zeile 1568
			{
$attachment['dateuploaded'] = $attachment['dateline'];
}

			{
$attachment['dateuploaded'] = $attachment['dateline'];
}

			



			$attachdate = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']);
$attachtime = my_date($mybb->settings['timeformat'], $attachment['dateuploaded']);

			$attachdate = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']);
$attachtime = my_date($mybb->settings['timeformat'], $attachment['dateuploaded']);





			$attachment['postsubject'] = htmlspecialchars_uni($attachment['postsubject']);
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
$attachment['threadsubject'] = htmlspecialchars_uni($attachment['threadsubject']);

			$attachment['postsubject'] = htmlspecialchars_uni($attachment['postsubject']);
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
$attachment['threadsubject'] = htmlspecialchars_uni($attachment['threadsubject']);

Zeile 1585Zeile 1585
		}

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

		}

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

		{

		{

			eval("\$attachments = \"".$templates->get("modcp_modqueue_attachments_empty")."\";");
}

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

			eval("\$attachments = \"".$templates->get("modcp_modqueue_attachments_empty")."\";");
}

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

			



			$plugins->run_hooks("modcp_modqueue_attachments_end");

			$plugins->run_hooks("modcp_modqueue_attachments_end");

			



			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";");
output_page($attachmentqueue);
}

			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";");
output_page($attachmentqueue);
}

	}


	}


	// Still nothing? All queues are empty! :-D
if(!$threadqueue && !$postqueue && !$attachmentqueue)
{
add_breadcrumb($lang->mcp_nav_modqueue, "modcp.php?action=modqueue");

	// Still nothing? All queues are empty! :-D
if(!$threadqueue && !$postqueue && !$attachmentqueue)
{
add_breadcrumb($lang->mcp_nav_modqueue, "modcp.php?action=modqueue");

		



		$plugins->run_hooks("modcp_modqueue_end");

		$plugins->run_hooks("modcp_modqueue_end");

		



		eval("\$queue = \"".$templates->get("modcp_modqueue_empty")."\";");
output_page($queue);
}

		eval("\$queue = \"".$templates->get("modcp_modqueue_empty")."\";");
output_page($queue);
}

Zeile 1628Zeile 1628
	if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();

	if(!modcp_can_manage_user($user['uid']))
{
error_no_permission();

	}


	}


	$plugins->run_hooks("modcp_do_editprofile_start");

// Set up user handler.

	$plugins->run_hooks("modcp_do_editprofile_start");

// Set up user handler.

Zeile 1733Zeile 1733

// Skip this option if we haven't selected it
continue;


// Skip this option if we haven't selected it
continue;

			}


			}


			if($mybb->input[$option['action']])
{
if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)

			if($mybb->input[$option['action']])
{
if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)

Zeile 1747Zeile 1747
				if(!is_array($errors))
{
$suspend_length = fetch_time_length(intval($mybb->input[$option['time']]), $mybb->input[$option['period']]);

				if(!is_array($errors))
{
$suspend_length = fetch_time_length(intval($mybb->input[$option['time']]), $mybb->input[$option['period']]);





					if($user[$option['update_field']] == 1 && ($mybb->input[$option['time']] || $mybb->input[$option['period']] == "never"))
{
// We already have a suspension, but entered a new time
if($suspend_length == "-1")
{
// Permanent ban on action

					if($user[$option['update_field']] == 1 && ($mybb->input[$option['time']] || $mybb->input[$option['period']] == "never"))
{
// We already have a suspension, but entered a new time
if($suspend_length == "-1")
{
// Permanent ban on action

							$extra_user_updates[$option['update_length']] = 0;
}

							$extra_user_updates[$option['update_length']] = 0;
}

						elseif($suspend_length && $suspend_length != "-1")
{
// Temporary ban on action

						elseif($suspend_length && $suspend_length != "-1")
{
// Temporary ban on action

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

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

					}
elseif(!$user[$option['update_field']])
{
// New suspension for this user... bad user!

					}
elseif(!$user[$option['update_field']])
{
// New suspension for this user... bad user!

						$extra_user_updates[$option['update_field']] = 1;				

						$extra_user_updates[$option['update_field']] = 1;

						if($suspend_length == "-1")
{
$extra_user_updates[$option['update_length']] = 0;

						if($suspend_length == "-1")
{
$extra_user_updates[$option['update_length']] = 0;

Zeile 1787Zeile 1787
		}

if(is_array($errors))

		}

if(is_array($errors))

		{

		{

			$mybb->input['action'] = "editprofile";
}
else
{
$plugins->run_hooks("modcp_do_editprofile_update");

			$mybb->input['action'] = "editprofile";
}
else
{
$plugins->run_hooks("modcp_do_editprofile_update");

			



			// Continue with the update if there is no errors
$user_info = $userhandler->update_user();
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'");
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);

			// Continue with the update if there is no errors
$user_info = $userhandler->update_user();
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'");
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);

			



			$plugins->run_hooks("modcp_do_editprofile_end");

			$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 1894Zeile 1894
		else
{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";

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

		}
}

		}
}

	$bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';

	$bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';

	



	$plugins->run_hooks("modcp_editprofile_start");

// Fetch profile fields

	$plugins->run_hooks("modcp_editprofile_start");

// Fetch profile fields

Zeile 1917Zeile 1917
		$field = "fid{$profilefield['fid']}";
$select = '';
if($errors)

		$field = "fid{$profilefield['fid']}";
$select = '';
if($errors)

		{

		{

			$userfield = $mybb->input['profile_fields'][$field];
}
else

			$userfield = $mybb->input['profile_fields'][$field];
}
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(is_array($useropts))
{
foreach($useropts as $key => $val)
{
$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);

$sel = "";

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

$sel = "";

					if($val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

					if($val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

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

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

				{
$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";

				{
$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";

			}
}

			}
}

		elseif($type == "select")

		elseif($type == "select")

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

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

					$val = trim($val);
$val = str_replace("\n", "\\n", $val);
$sel = "";

					$val = trim($val);
$val = str_replace("\n", "\\n", $val);
$sel = "";

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

						$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")
{
if($errors)

		elseif($type == "checkbox")
{
if($errors)

Zeile 2106Zeile 2106
	else
{
$suspost_check = 0;

	else
{
$suspost_check = 0;

	}

	}


$moderator_options = array(
1 => array(
"action" => "suspendsignature", // The input action for this option
"option" => "suspendsignature", // The field in the database that this option relates to


$moderator_options = array(
1 => array(
"action" => "suspendsignature", // The input action for this option
"option" => "suspendsignature", // The field in the database that this option relates to

 
			"time" => "action_time", // The time we've entered

			"length" => "suspendsigtime", // The length of suspension field in the database
"select_option" => "action" // The name of the select box of this option
),
2 => array(
"action" => "moderateposting",
"option" => "moderateposts",

			"length" => "suspendsigtime", // The length of suspension field in the database
"select_option" => "action" // The name of the select box of this option
),
2 => array(
"action" => "moderateposting",
"option" => "moderateposts",

 
			"time" => "modpost_time",

			"length" => "moderationtime",
"select_option" => "modpost"
),
3 => array(
"action" => "suspendposting",
"option" => "suspendposting",

			"length" => "moderationtime",
"select_option" => "modpost"
),
3 => array(
"action" => "suspendposting",
"option" => "suspendposting",

 
			"time" => "suspost_time",

			"length" => "suspensiontime",
"select_option" => "suspost"
)

			"length" => "suspensiontime",
"select_option" => "suspost"
)

Zeile 2139Zeile 2142

foreach($moderator_options as $option)
{


foreach($moderator_options as $option)
{

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

		// Display the suspension info, if this user has this option suspended
if($user[$option['option']])
{

		// Display the suspension info, if this user has this option suspended
if($user[$option['option']])
{

Zeile 2204Zeile 2208
	}

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

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

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

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

{

{

	add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");

	add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");

	



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

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

Zeile 2286Zeile 2290
		{
$page_url .= "&amp;{$field}=".htmlspecialchars_uni($mybb->input[$field]);
$mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);

		{
$page_url .= "&amp;{$field}=".htmlspecialchars_uni($mybb->input[$field]);
$mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);

		}
}

$multipage = multipage($user_count, $perpage, $page, $page_url);


		}
}

$multipage = multipage($user_count, $perpage, $page, $page_url);


	$usergroups_cache = $cache->read("usergroups");

	$usergroups_cache = $cache->read("usergroups");

	
$plugins->run_hooks("modcp_finduser_start");


$plugins->run_hooks("modcp_finduser_start");


// Fetch out results
$query = $db->simple_select("users", "*", "1=1 {$where}", array("order_by" => $sortby, "order_dir" => $order, "limit" => $perpage, "limit_start" => $start));


// Fetch out results
$query = $db->simple_select("users", "*", "1=1 {$where}", array("order_by" => $sortby, "order_dir" => $order, "limit" => $perpage, "limit_start" => $start));

Zeile 2308Zeile 2312
		$lasttime = my_date($mybb->settings['timeformat'], $user['lastvisit']);
$usergroup = $usergroups_cache[$user['usergroup']]['title'];
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");

		$lasttime = my_date($mybb->settings['timeformat'], $user['lastvisit']);
$usergroup = $usergroups_cache[$user['usergroup']]['title'];
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");

	}


	}


	// No results?
if(!$users)
{
eval("\$users = \"".$templates->get("modcp_finduser_noresults")."\";");
}

	// No results?
if(!$users)
{
eval("\$users = \"".$templates->get("modcp_finduser_noresults")."\";");
}

	



	$plugins->run_hooks("modcp_finduser_end");

eval("\$finduser = \"".$templates->get("modcp_finduser")."\";");

	$plugins->run_hooks("modcp_finduser_end");

eval("\$finduser = \"".$templates->get("modcp_finduser")."\";");

Zeile 2364Zeile 2368
	}
if($mybb->input['filter']['reason'])
{

	}
if($mybb->input['filter']['reason'])
{

		$search['reason'] = $db->escape_string($mybb->input['filter']['reason']);

		$search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']);

		$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
$mybb->input['filter']['reason'] = htmlspecialchars_uni($mybb->input['filter']['reason']);
}
$sortbysel = array();
switch($mybb->input['filter']['sortby'])

		$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
$mybb->input['filter']['reason'] = htmlspecialchars_uni($mybb->input['filter']['reason']);
}
$sortbysel = array();
switch($mybb->input['filter']['sortby'])

	{

	{

		case "username":
$sortby = "u.username";
$sortbysel['username'] = ' selected="selected"';

		case "username":
$sortby = "u.username";
$sortbysel['username'] = ' selected="selected"';

			break;

			break;

		case "expires":
$sortby = "w.expires";
$sortbysel['expires'] = ' selected="selected"';

		case "expires":
$sortby = "w.expires";
$sortbysel['expires'] = ' selected="selected"';

			break;

			break;

		case "issuedby":
$sortby = "i.username";
$sortbysel['issuedby'] = ' selected="selected"';

		case "issuedby":
$sortby = "i.username";
$sortbysel['issuedby'] = ' selected="selected"';

Zeile 2398Zeile 2402
	{
$ordersel['asc'] = ' selected="selected"';
}

	{
$ordersel['asc'] = ' selected="selected"';
}

	



	$plugins->run_hooks("modcp_warninglogs_start");

// Pagination stuff

	$plugins->run_hooks("modcp_warninglogs_start");

// Pagination stuff

Zeile 2406Zeile 2410
		SELECT COUNT(wid) as count
FROM
".TABLE_PREFIX."warnings w

		SELECT COUNT(wid) as count
FROM
".TABLE_PREFIX."warnings w

			LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid)
WHERE 1=1
{$where_sql}
";

			LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid)
WHERE 1=1
{$where_sql}
";

	$query = $db->query($sql);
$total_warnings = $db->fetch_field($query, 'count');
$page = 1;

	$query = $db->query($sql);
$total_warnings = $db->fetch_field($query, 'count');
$page = 1;

Zeile 2486Zeile 2490
		if($row['points'] >= 0)
{
$points = '+'.$row['points'];

		if($row['points'] >= 0)
{
$points = '+'.$row['points'];

		}

		}


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


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

Zeile 2495Zeile 2499
	{
eval("\$warning_list = \"".$templates->get("modcp_warninglogs_nologs")."\";");
}

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

	
$plugins->run_hooks("modcp_warninglogs_end");


$plugins->run_hooks("modcp_warninglogs_end");


eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";");
output_page($warninglogs);


eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";");
output_page($warninglogs);

Zeile 2526Zeile 2530
			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 2708Zeile 2712
				$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;
}

				$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;
}

			



			if(!empty($ipaddresses))
{
$query = $db->simple_select("threads", "subject, tid", "tid IN(".implode(',', array_keys($tids)).")");

			if(!empty($ipaddresses))
{
$query = $db->simple_select("threads", "subject, tid", "tid IN(".implode(',', array_keys($tids)).")");

Zeile 2717Zeile 2721
					$ipaddresses[$tids[$thread['tid']]]['threadsubject'] = $thread['subject'];
}
unset($tids);

					$ipaddresses[$tids[$thread['tid']]]['threadsubject'] = $thread['subject'];
}
unset($tids);

				



				$query = $db->simple_select("users", "username, uid", "uid IN(".implode(',', array_keys($uids)).")");
while($user = $db->fetch_array($query))

				$query = $db->simple_select("users", "username, uid", "uid IN(".implode(',', array_keys($uids)).")");
while($user = $db->fetch_array($query))

				{

				{

					$ipaddresses[$uids[$user['uid']]]['username'] = $user['username'];
}
unset($uids);

					$ipaddresses[$uids[$user['uid']]]['username'] = $user['username'];
}
unset($uids);

				



				foreach($ipaddresses as $ipaddress)
{
$ip = $ipaddress['ipaddress'];

				foreach($ipaddresses as $ipaddress)
{
$ip = $ipaddress['ipaddress'];

Zeile 2738Zeile 2742
					eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";");
}
}

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

		}

		}


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


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

		}

		}


if($ipaddressvalue)
{


if($ipaddressvalue)
{

Zeile 2752Zeile 2756
		else
{
$lang->ipsearch_results = $lang->ipsearch;

		else
{
$lang->ipsearch_results = $lang->ipsearch;

		}

if(!strstr($mybb->input['ipaddress'], "*") && !strstr($mybb->input['ipaddress'], ":"))
{

		}

if(!strstr($mybb->input['ipaddress'], "*") && !strstr($mybb->input['ipaddress'], ":"))
{

			$misc_info_link = "<div class=\"float_right\">(<a href=\"modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."\" onclick=\"MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress=".urlencode($mybb->input['ipaddress'])."', 'iplookup', 500, 250); return false;\">{$lang->info_on_ip}</a>)</div>";
}

eval("\$ipsearch_results = \"".$templates->get("modcp_ipsearch_results")."\";");

			$misc_info_link = "<div class=\"float_right\">(<a href=\"modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."\" onclick=\"MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress=".urlencode($mybb->input['ipaddress'])."', 'iplookup', 500, 250); return false;\">{$lang->info_on_ip}</a>)</div>";
}

eval("\$ipsearch_results = \"".$templates->get("modcp_ipsearch_results")."\";");

	}


	}


	// Fetch filter options
if(!$mybb->input['ipaddress'])
{

	// Fetch filter options
if(!$mybb->input['ipaddress'])
{

Zeile 2776Zeile 2780
	{
$usersearchselect = "checked=\"checked\"";
}

	{
$usersearchselect = "checked=\"checked\"";
}

	
$plugins->run_hooks("modcp_ipsearch_end");


$plugins->run_hooks("modcp_ipsearch_end");


eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";");
output_page($ipsearch);


eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";");
output_page($ipsearch);

Zeile 2797Zeile 2801
			$ip_record = @geoip_record_by_name($mybb->input['ipaddress']);
if($ip_record)
{

			$ip_record = @geoip_record_by_name($mybb->input['ipaddress']);
if($ip_record)
{

				$ipaddress_location = htmlspecialchars_uni($ip_record['country_name']);

				$ipaddress_location = htmlspecialchars_uni(utf8_encode($ip_record['country_name']));

				if($ip_record['city'])
{

				if($ip_record['city'])
{

					$ipaddress_location .= $lang->comma.htmlspecialchars_uni($ip_record['city']);

					$ipaddress_location .= $lang->comma.htmlspecialchars_uni(utf8_encode($ip_record['city']));

				}

				}

			}

			}

		}

		}

		



		$ipaddress_host_name = htmlspecialchars_uni(@gethostbyaddr($mybb->input['ipaddress']));

		$ipaddress_host_name = htmlspecialchars_uni(@gethostbyaddr($mybb->input['ipaddress']));

		



		// gethostbyaddr returns the same ip on failure
if($ipaddress_host_name == $mybb->input['ipaddress'])
{
$ipaddress_host_name = $lang->na;
}
}

		// gethostbyaddr returns the same ip on failure
if($ipaddress_host_name == $mybb->input['ipaddress'])
{
$ipaddress_host_name = $lang->na;
}
}

	



	$plugins->run_hooks("modcp_iplookup_end");

	$plugins->run_hooks("modcp_iplookup_end");

	



	eval("\$iplookup = \"".$templates->get('modcp_ipsearch_misc_info')."\";");
output_page($iplookup);
}

	eval("\$iplookup = \"".$templates->get('modcp_ipsearch_misc_info')."\";");
output_page($iplookup);
}

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

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





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

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

	}

	}


$query = $db->simple_select("banned", "COUNT(uid) AS count");
$banned_count = $db->fetch_field($query, "count");


$query = $db->simple_select("banned", "COUNT(uid) AS count");
$banned_count = $db->fetch_field($query, "count");

Zeile 2849Zeile 2853
	}

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

	}

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

	{
$page = 1;

	{
$page = 1;

	}

if($page)

	}

if($page)

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

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

	



	$plugins->run_hooks("modcp_banning_start");

$query = $db->query("

	$plugins->run_hooks("modcp_banning_start");

$query = $db->query("

Zeile 2968Zeile 2972
	{
error_no_permission();
}

	{
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 2989
	$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);

	



	$plugins->run_hooks("modcp_liftban_end");

	$plugins->run_hooks("modcp_liftban_end");





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

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





if($mybb->input['action'] == "do_banuser" && $mybb->request_method == "post")
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

if($mybb->input['action'] == "do_banuser" && $mybb->request_method == "post")
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);





	// Editing an existing ban
if($mybb->input['uid'])
{

	// Editing an existing ban
if($mybb->input['uid'])
{

Zeile 3010Zeile 3014
		if(!$user['uid'])
{
error($lang->error_invalidban);

		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_no_permission();

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

		}

		}

	}
// Creating a new ban
else

	}
// Creating a new ban
else

Zeile 3027Zeile 3031
		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;

Zeile 3039Zeile 3043
	if(!modcp_can_manage_user($user['uid']))
{
$errors[] = $lang->error_cannotbanuser;

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

	}


	}


	// Check for an incoming reason
if(!$mybb->input['banreason'])
{
$errors[] = $lang->error_nobanreason;

	// Check for an incoming reason
if(!$mybb->input['banreason'])
{
$errors[] = $lang->error_nobanreason;

	}


	}


	// Check banned group
$query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".intval($mybb->input['usergroup'])."'");
if(!$db->fetch_field($query, "gid"))

	// Check banned group
$query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".intval($mybb->input['usergroup'])."'");
if(!$db->fetch_field($query, "gid"))

Zeile 3063Zeile 3067
			$errors[] = $lang->error_useralreadybanned;
}
}

			$errors[] = $lang->error_useralreadybanned;
}
}

	



	$plugins->run_hooks("modcp_do_banuser_start");

// Still no errors? Ban the user

	$plugins->run_hooks("modcp_do_banuser_start");

// Still no errors? Ban the user

Zeile 3073Zeile 3077
		if($mybb->input['liftafter'] == '---')
{
$lifted = 0;

		if($mybb->input['liftafter'] == '---')
{
$lifted = 0;

		}
else

		}
else

		{
$lifted = ban_date2timestamp($mybb->input['liftafter'], $user['dateline']);
}

		{
$lifted = ban_date2timestamp($mybb->input['liftafter'], $user['dateline']);
}

Zeile 3084Zeile 3088
			$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,
'bantime' => $db->escape_string($mybb->input['liftafter']),
'lifted' => $db->escape_string($lifted),

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


				'reason' => $db->escape_string($mybb->input['banreason'])
);


Zeile 3108Zeile 3112
				'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($mybb->input['banreason'])
);

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





			$db->insert_query('banned', $insert_array);
}


			$db->insert_query('banned', $insert_array);
}


Zeile 3126Zeile 3130
		if($mybb->input['uid'])
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);

		if($mybb->input['uid'])
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);

		}
else

		}
else

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

		{
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);

		}

		}

		else
{
redirect("modcp.php?action=banning", $lang->redirect_banuser);
}
}
// Otherwise has errors, throw back to ban page

		else
{
redirect("modcp.php?action=banning", $lang->redirect_banuser);
}
}
// Otherwise has errors, throw back to ban page

	else
{

	else
{

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

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





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

	}

	}

	else
{
add_breadcrumb($lang->mcp_nav_editing_ban);
}

	else
{
add_breadcrumb($lang->mcp_nav_editing_ban);
}

	



	$plugins->run_hooks("modcp_banuser_start");

// If incoming user ID, we are editing a ban

	$plugins->run_hooks("modcp_banuser_start");

// If incoming user ID, we are editing a ban

Zeile 3185Zeile 3189
			eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
}
}

			eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
}
}

	



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

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

Zeile 3197Zeile 3201
		else
{
$username = htmlspecialchars_uni($mybb->input['username']);

		else
{
$username = htmlspecialchars_uni($mybb->input['username']);

		}

		}

		eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";");
}


		eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";");
}


Zeile 3225Zeile 3229
		if($time == '---')
{
$liftlist .= ">{$title}</option>\n";

		if($time == '---')
{
$liftlist .= ">{$title}</option>\n";

		}

		}

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

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

	



	$bangroups = '';
$query = $db->simple_select("usergroups", "gid, title", "isbannedgroup=1");
while($item = $db->fetch_array($query))

	$bangroups = '';
$query = $db->simple_select("usergroups", "gid, title", "isbannedgroup=1");
while($item = $db->fetch_array($query))

Zeile 3243Zeile 3247
		}
$bangroups .= "<option value=\"{$item['gid']}\"{$selected}>".htmlspecialchars_uni($item['title'])."</option>\n";
}

		}
$bangroups .= "<option value=\"{$item['gid']}\"{$selected}>".htmlspecialchars_uni($item['title'])."</option>\n";
}

	



	$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>";

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

	$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 3256Zeile 3260
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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

	



	$plugins->run_hooks("modcp_do_modnotes_start");

	$plugins->run_hooks("modcp_do_modnotes_start");

	



	// Update Moderator Notes cache
$update_cache = array(
"modmessage" => $mybb->input['modnotes']
);
$cache->update("modnotes", $update_cache);

	// Update Moderator Notes cache
$update_cache = array(
"modmessage" => $mybb->input['modnotes']
);
$cache->update("modnotes", $update_cache);

	



	$plugins->run_hooks("modcp_do_modnotes_end");

	$plugins->run_hooks("modcp_do_modnotes_end");

	



	redirect("modcp.php", $lang->redirect_modnotes);
}


	redirect("modcp.php", $lang->redirect_modnotes);
}


Zeile 3348Zeile 3352
	$unapproved_threads = $db->fetch_field($query, "unapprovedthreads");

if($unapproved_threads > 0)

	$unapproved_threads = $db->fetch_field($query, "unapprovedthreads");

if($unapproved_threads > 0)

	{

	{

		$query = $db->simple_select("threads", "tid, subject, uid, username, dateline", "visible=0 {$flist}", array('order_by' =>  'dateline', 'order_dir' => 'DESC', 'limit' => 1));
$thread = $db->fetch_array($query);
$thread['date'] = my_date($mybb->settings['dateformat'], $thread['dateline']);

		$query = $db->simple_select("threads", "tid, subject, uid, username, dateline", "visible=0 {$flist}", array('order_by' =>  'dateline', 'order_dir' => 'DESC', 'limit' => 1));
$thread = $db->fetch_array($query);
$thread['date'] = my_date($mybb->settings['dateformat'], $thread['dateline']);

Zeile 3368Zeile 3372
	else
{
$latest_thread = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>";

	else
{
$latest_thread = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>";

	}

	}


$where = '';
if($tflist)


$where = '';
if($tflist)

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

		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?
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
{

Zeile 3507Zeile 3511

$modnotes = $cache->read("modnotes");
$modnotes = htmlspecialchars_uni($modnotes['modmessage']);


$modnotes = $cache->read("modnotes");
$modnotes = htmlspecialchars_uni($modnotes['modmessage']);

	



	$plugins->run_hooks("modcp_end");

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

	$plugins->run_hooks("modcp_end");

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