Vergleich modcp.php - 1.8.9 - 1.8.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'modcp.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'modcp.php');


$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport,modcp_reports_allreports,modcp_modlogs_multipage,modcp_announcements_delete,modcp_announcements_edit,modcp_awaitingmoderation";

$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_selectall,modcp_reports_multipage,modcp_reports_allreport,modcp_reports_allreports,modcp_modlogs_multipage,modcp_announcements_delete,modcp_announcements_edit,modcp_awaitingmoderation";

$templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban,modcp_announcements_announcement_global,modcp_no_announcements_forum,modcp_modqueue_threads_thread,modcp_awaitingthreads,preview";
$templatelist .= ",modcp_banning_nobanned,modcp_modqueue_threads_empty,modcp_modqueue_masscontrols,modcp_modqueue_threads,modcp_modqueue_posts_post,modcp_modqueue_posts_empty,modcp_awaitingposts,modcp_nav_editprofile,modcp_nav_banning";
$templatelist .= ",modcp_nav,modcp_modlogs_noresults,modcp_modlogs_nologs,modcp,modcp_modqueue_posts,modcp_modqueue_attachments_attachment,modcp_modqueue_attachments_empty,modcp_modqueue_attachments,modcp_editprofile_suspensions_info";

$templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban,modcp_announcements_announcement_global,modcp_no_announcements_forum,modcp_modqueue_threads_thread,modcp_awaitingthreads,preview";
$templatelist .= ",modcp_banning_nobanned,modcp_modqueue_threads_empty,modcp_modqueue_masscontrols,modcp_modqueue_threads,modcp_modqueue_posts_post,modcp_modqueue_posts_empty,modcp_awaitingposts,modcp_nav_editprofile,modcp_nav_banning";
$templatelist .= ",modcp_nav,modcp_modlogs_noresults,modcp_modlogs_nologs,modcp,modcp_modqueue_posts,modcp_modqueue_attachments_attachment,modcp_modqueue_attachments_empty,modcp_modqueue_attachments,modcp_editprofile_suspensions_info";

Zeile 58Zeile 58
$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{

$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{

	$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id='{$mybb->user['usergroup']}' AND isgroup = '1')");

	$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id IN ({$mybb->usergroup['all_usergroups']}) AND isgroup = '1')");


$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;
while($forum = $db->fetch_array($query))


$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;
while($forum = $db->fetch_array($query))

Zeile 285Zeile 285
	verify_post_check($mybb->get_input('my_post_key'));

$mybb->input['reports'] = $mybb->get_input('reports', MyBB::INPUT_ARRAY);

	verify_post_check($mybb->get_input('my_post_key'));

$mybb->input['reports'] = $mybb->get_input('reports', MyBB::INPUT_ARRAY);

	if(empty($mybb->input['reports']))

	if(empty($mybb->input['reports']) && empty($mybb->cookies['inlinereports']))

	{
error($lang->error_noselected_reports);
}


	{
error($lang->error_noselected_reports);
}


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






























	$message = $lang->redirect_reportsmarked;

if(isset($mybb->cookies['inlinereports']))
{
if($mybb->cookies['inlinereports'] == '|ALL|') {
$message = $lang->redirect_allreportsmarked;
$sql = "1=1";
if(isset($mybb->cookies['inlinereports_removed']))
{
$inlinereportremovedlist = explode("|", $mybb->cookies['inlinereports_removed']);
$reports = array_map("intval", $inlinereportremovedlist);
$rids = implode("','", $reports);
$sql = "rid NOT IN ('0','{$rids}')";
}
}
else
{
$inlinereportlist = explode("|", $mybb->cookies['inlinereports']);
$reports = array_map("intval", $inlinereportlist);

if(!count($reports))
{
error($lang->error_noselected_reports);
}

$rids = implode("','", $reports);

$sql = "rid IN ('0','{$rids}')";
}
}
else
{

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

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





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

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

	}

$plugins->run_hooks("modcp_do_reports");


	}

$plugins->run_hooks("modcp_do_reports");


	$db->update_query("reportedcontent", array('reportstatus' => 1), "{$sql}{$flist_reports}");
$cache->update_reportedcontent();

	$db->update_query("reportedcontent", array('reportstatus' => 1), "{$sql}{$flist_reports}");
$cache->update_reportedcontent();


$page = $mybb->get_input('page', MyBB::INPUT_INT);

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





my_unsetcookie('inlinereports');
my_unsetcookie('inlinereports_removed');

$page = $mybb->get_input('page', MyBB::INPUT_INT);

redirect("modcp.php?action=reports&page={$page}", $message);
}


if($mybb->input['action'] == "reports")
{
if($mybb->usergroup['canmanagereportedcontent'] == 0)
{
error_no_permission();


if($mybb->input['action'] == "reports")
{
if($mybb->usergroup['canmanagereportedcontent'] == 0)
{
error_no_permission();

	}


	}


	if($numreportedposts == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_view_reported_posts);

	if($numreportedposts == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_view_reported_posts);

Zeile 323Zeile 355

$lang->load('report');
add_breadcrumb($lang->mcp_nav_report_center, "modcp.php?action=reports");


$lang->load('report');
add_breadcrumb($lang->mcp_nav_report_center, "modcp.php?action=reports");





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

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

Zeile 339Zeile 371
	else
{
$query = $db->simple_select('reportedcontent', 'id3', "reportstatus='0' AND (type = 'post' OR type = '')");

	else
{
$query = $db->simple_select('reportedcontent', 'id3', "reportstatus='0' AND (type = 'post' OR type = '')");


$report_count = 0;
while($fid = $db->fetch_field($query, 'id3'))
{
if(is_moderator($fid, "canmanagereportedposts"))
{
++$report_count;
}
}
unset($fid);
}

$page = $mybb->get_input('page', MyBB::INPUT_INT);

$postcount = (int)$report_count;
$pages = $postcount / $perpage;
$pages = ceil($pages);

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



$report_count = 0;
while($fid = $db->fetch_field($query, 'id3'))
{
if(is_moderator($fid, "canmanagereportedposts"))
{
++$report_count;
}
}
unset($fid);
}

$page = $mybb->get_input('page', MyBB::INPUT_INT);

$postcount = (int)$report_count;
$pages = $postcount / $perpage;
$pages = ceil($pages);

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


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

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

Zeile 490Zeile 522
				$postcache[$post['pid']] = $post;
}
}

				$postcache[$post['pid']] = $post;
}
}

 

$lang->page_selected = $lang->sprintf($lang->page_selected, count($reportcache));
$lang->select_all = $lang->sprintf($lang->select_all, (int)$report_count);
$lang->all_selected = $lang->sprintf($lang->all_selected, (int)$report_count);
eval("\$selectall = \"".$templates->get("modcp_reports_selectall")."\";");


$plugins->run_hooks('modcp_reports_intermediate');



$plugins->run_hooks('modcp_reports_intermediate');


 
		$inlinecount = 0;

		// Now that we have all of the information needed, display the reports
foreach($reportcache as $report)
{

		// Now that we have all of the information needed, display the reports
foreach($reportcache as $report)
{

Zeile 566Zeile 604
					$lastreport_user = build_profile_link(htmlspecialchars_uni($usercache[$report['lastreporter']]['username']), $report['lastreporter']);
}
elseif($usercache[$report['lastreporter']] > 0)

					$lastreport_user = build_profile_link(htmlspecialchars_uni($usercache[$report['lastreporter']]['username']), $report['lastreporter']);
}
elseif($usercache[$report['lastreporter']] > 0)

				{
$lastreport_user = $lang->na_deleted;
}

				{
$lastreport_user = htmlspecialchars_uni($lang->na_deleted);
}


$lastreport_date = my_date('relative', $report['lastreport']);
$report_data['lastreporter'] = $lang->sprintf($lang->report_info_lastreporter, $lastreport_date, $lastreport_user);


$lastreport_date = my_date('relative', $report['lastreport']);
$report_data['lastreporter'] = $lang->sprintf($lang->report_info_lastreporter, $lastreport_date, $lastreport_user);

 
			}

$inlinecheck = '';
if(isset($mybb->cookies['inlinereports']) && my_strpos($mybb->cookies['inlinereports'], "|{$report['rid']}|") !== false)
{
$inlinecheck = " checked=\"checked\"";
++$inlinecount;

			}

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

			}

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

		}
}

		}
}


$plugins->run_hooks("modcp_reports_end");



$plugins->run_hooks("modcp_reports_end");


Zeile 620Zeile 665

$report_count = 0;
while($fid = $db->fetch_field($query, 'id3'))


$report_count = 0;
while($fid = $db->fetch_field($query, 'id3'))

		{

		{

			if(is_moderator($fid, "canmanagereportedposts"))
{
++$report_count;

			if(is_moderator($fid, "canmanagereportedposts"))
{
++$report_count;

Zeile 637Zeile 682
		if(($result % $perpage) == 0)
{
$page = $result / $perpage;

		if(($result % $perpage) == 0)
{
$page = $result / $perpage;

		}

		}

		else
{
$page = (int)$result / $perpage + 1;

		else
{
$page = (int)$result / $perpage + 1;

Zeile 842Zeile 887
	}

$postcount = (int)$rescount;

	}

$postcount = (int)$rescount;

	$pages = $postcount / $perpage;

	$pages = $postcount / $perpage;

	$pages = ceil($pages);

if($mybb->get_input('page') == "last")

	$pages = ceil($pages);

if($mybb->get_input('page') == "last")

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

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

	}

	}

	else
{
$start = 0;

	else
{
$start = 0;

Zeile 907Zeile 952
		$logitem['action'] = htmlspecialchars_uni($logitem['action']);
$log_date = my_date('relative', $logitem['dateline']);
$trow = alt_trow();

		$logitem['action'] = htmlspecialchars_uni($logitem['action']);
$log_date = my_date('relative', $logitem['dateline']);
$trow = alt_trow();

		$logitem['username'] = htmlspecialchars_uni($logitem['username']);
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);








		if($logitem['username'])
{
$logitem['username'] = htmlspecialchars_uni($logitem['username']);
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
}
else
{
$username = $logitem['profilelink'] = $logitem['username'] = htmlspecialchars_uni($lang->na_deleted);
}

		$logitem['ipaddress'] = my_inet_ntop($db->unescape_binary($logitem['ipaddress']));

if($logitem['tsubject'])

		$logitem['ipaddress'] = my_inet_ntop($db->unescape_binary($logitem['ipaddress']));

if($logitem['tsubject'])

Zeile 946Zeile 998
				eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";");
}
}

				eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";");
}
}

 

$plugins->run_hooks("modcp_modlogs_result");


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


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

Zeile 1036Zeile 1090

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


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





	if(!$announcement)

	if(!$announcement)

	{

	{

		error($lang->error_invalid_announcement);
}

if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))

		error($lang->error_invalid_announcement);
}

if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 1058Zeile 1112
	verify_post_check($mybb->get_input('my_post_key'));

if($mybb->usergroup['canmanageannounce'] == 0)

	verify_post_check($mybb->get_input('my_post_key'));

if($mybb->usergroup['canmanageannounce'] == 0)

	{
error_no_permission();

	{
error_no_permission();

	}

$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
{
error_no_permission();

	}

$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
{
error_no_permission();

	}


	}


	$errors = array();

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

	$errors = array();

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

	}


	}


	$mybb->input['message'] = $mybb->get_input('message');
if(!trim($mybb->input['message']))
{

	$mybb->input['message'] = $mybb->get_input('message');
if(!trim($mybb->input['message']))
{

Zeile 1083Zeile 1137
	}

if(!$announcement_fid)

	}

if(!$announcement_fid)

	{

	{

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


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


Zeile 1100Zeile 1154
		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];

Zeile 1119Zeile 1173
		$mybb->input['starttime_month'] = '01';
}


		$mybb->input['starttime_month'] = '01';
}


	$localized_time_offset = $mybb->user['timezone']*3600 + $mybb->user['dst']*3600;

	$localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;





	$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) -$localized_time_offset;

	$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) - $localized_time_offset;

	if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false)
{
$errors[] = $lang->error_invalid_start_date;

	if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false)
{
$errors[] = $lang->error_invalid_start_date;

Zeile 1143Zeile 1197
		if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) || $enddate < 0 || $enddate == false)
{
$errors[] = $lang->error_invalid_end_date;

		if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) || $enddate < 0 || $enddate == false)
{
$errors[] = $lang->error_invalid_end_date;

		}

		}


if($enddate <= $startdate)
{


if($enddate <= $startdate)
{

Zeile 1151Zeile 1205
		}
}


		}
}


	if($mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)

	if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)

	{
$allowhtml = 1;
}

	{
$allowhtml = 1;
}

Zeile 1170Zeile 1224
	if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1)
{
$allowsmilies = 1;

	if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1)
{
$allowsmilies = 1;

	}
else

	}
else

	{
$allowsmilies = 0;
}

	{
$allowsmilies = 0;
}

Zeile 1184Zeile 1238
		{
$preview = array();
$mybb->input['action'] = 'new_announcement';

		{
$preview = array();
$mybb->input['action'] = 'new_announcement';

		}
else
{

		}
else
{

			$insert_announcement = array(
'fid' => $announcement_fid,
'uid' => $mybb->user['uid'],

			$insert_announcement = array(
'fid' => $announcement_fid,
'uid' => $mybb->user['uid'],

Zeile 1200Zeile 1254
			);
$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);

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


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

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

Zeile 1217Zeile 1271
if($mybb->input['action'] == "new_announcement")
{
if($mybb->usergroup['canmanageannounce'] == 0)

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

	{
error_no_permission();
}


	{
error_no_permission();
}


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


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


Zeile 1237Zeile 1291
		if(!empty($errors))
{
$errors = inline_error($errors);

		if(!empty($errors))
{
$errors = inline_error($errors);

		}
else
{

		}
else
{

			$errors = '';
}


			$errors = '';
}


Zeile 1261Zeile 1315
	}
else
{

	}
else
{

		$localized_time = TIME_NOW + $mybb->user['timezone']*3600 + $mybb->user['dst']*3600;

		$localized_time = TIME_NOW + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;


$starttime_time = gmdate($mybb->settings['timeformat'], $localized_time);
$endtime_time = gmdate($mybb->settings['timeformat'], $localized_time);


$starttime_time = gmdate($mybb->settings['timeformat'], $localized_time);
$endtime_time = gmdate($mybb->settings['timeformat'], $localized_time);

Zeile 1272Zeile 1326
		$announcement = array(
'subject' => '',
'message' => '',

		$announcement = array(
'subject' => '',
'message' => '',

			'allowhtml' => 1,

			'allowhtml' => 0,

			'allowmycode' => 1,
'allowsmilies' => 1
);

			'allowmycode' => 1,
'allowsmilies' => 1
);

Zeile 1325Zeile 1379
	$message = htmlspecialchars_uni($announcement['message']);

$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');

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

$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');

	if($announcement['allowhtml'])
{
$html_sel['yes'] = ' checked="checked"';
}
else
{
$html_sel['no'] = ' checked="checked"';
}













if($mybb->settings['announcementshtml'])
{
if($announcement['allowhtml'])
{
$html_sel['yes'] = ' checked="checked"';
}
else
{
$html_sel['no'] = ' checked="checked"';
}

eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";");
}
else
{
$allow_html = '';
}


	if($announcement['allowmycode'])
{
$mycode_sel['yes'] = ' checked="checked"';

	if($announcement['allowmycode'])
{
$mycode_sel['yes'] = ' checked="checked"';

	}
else
{

	}
else
{

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


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


Zeile 1358Zeile 1422
		$end_type_sel['infinite'] = ' checked="checked"';
}
else

		$end_type_sel['infinite'] = ' checked="checked"';
}
else

	{

	{

		$end_type_sel['finite'] = ' checked="checked"';
}


		$end_type_sel['finite'] = ' checked="checked"';
}


Zeile 1371Zeile 1435
		$announcementarray = array(
'aid' => 0,
'fid' => $announcement_fid,

		$announcementarray = array(
'aid' => 0,
'fid' => $announcement_fid,

			'uid' => $mybb->user['uid'],
'subject' => $mybb->input['title'],
'message' => $mybb->input['message'],
'allowhtml' => $mybb->get_input('allowhtml', MyBB::INPUT_INT),
'allowmycode' => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT),
'dateline' => TIME_NOW,
'userusername' => $mybb->user['username'],
);

$array = $mybb->user;
foreach($array as $key => $element)
{
$announcementarray[$key] = $element;
}

// Gather usergroup data from the cache
// Field => Array Key
$data_key = array(
'title' => 'grouptitle',
'usertitle' => 'groupusertitle',
'stars' => 'groupstars',
'starimage' => 'groupstarimage',
'image' => 'groupimage',
'namestyle' => 'namestyle',
'usereputationsystem' => 'usereputationsystem'
);

foreach($data_key as $field => $key)
{
$announcementarray[$key] = $groupscache[$announcementarray['usergroup']][$field];
}


			'uid' => $mybb->user['uid'],
'subject' => $mybb->input['title'],
'message' => $mybb->input['message'],
'allowhtml' => $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT),
'allowmycode' => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT),
'dateline' => TIME_NOW,
'userusername' => $mybb->user['username'],
);

$array = $mybb->user;
foreach($array as $key => $element)
{
$announcementarray[$key] = $element;
}

// Gather usergroup data from the cache
// Field => Array Key
$data_key = array(
'title' => 'grouptitle',
'usertitle' => 'groupusertitle',
'stars' => 'groupstars',
'starimage' => 'groupstarimage',
'image' => 'groupimage',
'namestyle' => 'namestyle',
'usereputationsystem' => 'usereputationsystem'
);

foreach($data_key as $field => $key)
{
$announcementarray[$key] = $groupscache[$announcementarray['usergroup']][$field];
}


		require_once MYBB_ROOT."inc/functions_post.php";
$postbit = build_postbit($announcementarray, 3);
eval("\$preview = \"".$templates->get("previewpost")."\";");
}
else

		require_once MYBB_ROOT."inc/functions_post.php";
$postbit = build_postbit($announcementarray, 3);
eval("\$preview = \"".$templates->get("previewpost")."\";");
}
else

	{

	{

		$preview = '';

		$preview = '';

	}

$plugins->run_hooks("modcp_new_announcement");


	}

$plugins->run_hooks("modcp_new_announcement");


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

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

Zeile 1424Zeile 1488
	verify_post_check($mybb->get_input('my_post_key'));

if($mybb->usergroup['canmanageannounce'] == 0)

	verify_post_check($mybb->get_input('my_post_key'));

if($mybb->usergroup['canmanageannounce'] == 0)

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 1440Zeile 1504
	}

// Mod has permissions to edit this announcement

	}

// Mod has permissions to edit this announcement

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


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


	$errors = array();

// Basic error checking

	$errors = array();

// Basic error checking

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

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

	}


	}


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

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

Zeile 1482Zeile 1546
		if($enddate[0] >= 24)
{
$enddate[0] = "00";

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

		}
}


		}
}


	$mybb->input['starttime_month'] = $mybb->get_input('starttime_month');
$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'] = $mybb->get_input('starttime_month');
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))

Zeile 1492Zeile 1556
		$mybb->input['starttime_month'] = '01';
}


		$mybb->input['starttime_month'] = '01';
}


	$localized_time_offset = TIME_NOW + $mybb->user['timezone']*3600 + $mybb->user['dst']*3600;

	$localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;


$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) - $localized_time_offset;
if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false)


$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) - $localized_time_offset;
if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false)

Zeile 1523Zeile 1587
		}
}


		}
}


	if($mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)

	if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)

	{
$allowhtml = 1;

	{
$allowhtml = 1;

	}

	}

	else
{
$allowhtml = 0;

	else
{
$allowhtml = 0;

Zeile 1572Zeile 1636
			);
$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);

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


$plugins->run_hooks("modcp_do_edit_announcement_end");



$plugins->run_hooks("modcp_do_edit_announcement_end");


Zeile 1666Zeile 1730
	}
else
{

	}
else
{

		$localized_time_startdate = $announcement['startdate'] + $mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
$localized_time_enddate = $announcement['enddate'] + $mybb->user['timezone']*3600 + $mybb->user['dst']*3600;

		$localized_time_startdate = $announcement['startdate'] + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
$localized_time_enddate = $announcement['enddate'] + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;


$starttime_time = gmdate($mybb->settings['timeformat'], $localized_time_startdate);
$endtime_time = gmdate($mybb->settings['timeformat'], $localized_time_enddate);


$starttime_time = gmdate($mybb->settings['timeformat'], $localized_time_startdate);
$endtime_time = gmdate($mybb->settings['timeformat'], $localized_time_enddate);

Zeile 1689Zeile 1753
	for($day = 1; $day <= 31; ++$day)
{
if($startday == $day)

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

		{
$selected = " selected=\"selected\"";
eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
}
else
{
$selected = '';

		{
$selected = " selected=\"selected\"";






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

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

		}

if($endday == $day)






		}
else
{
$selected = '';
eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
}

if($endday == $day)

		{
$selected = " selected=\"selected\"";

		{
$selected = " selected=\"selected\"";

			eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
}
else

			eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
}
else

		{
$selected = '';
eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");

		{
$selected = '';
eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");

		}
}

		}
}


$startmonthsel = $endmonthsel = array();
foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month)


$startmonthsel = $endmonthsel = array();
foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month)

Zeile 1719Zeile 1783
	}
$startmonthsel[$startmonth] = "selected=\"selected\"";
$endmonthsel[$endmonth] = "selected=\"selected\"";

	}
$startmonthsel[$startmonth] = "selected=\"selected\"";
$endmonthsel[$endmonth] = "selected=\"selected\"";





	$startdatemonth = $enddatemonth = '';

eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";");
eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");

	$startdatemonth = $enddatemonth = '';

eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";");
eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");





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

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





	$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');

	$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');

	if($announcement['allowhtml'])



if($mybb->settings['announcementshtml'])

	{

	{

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










		if($announcement['allowhtml'])
{
$html_sel['yes'] = ' checked="checked"';
}
else
{
$html_sel['no'] = ' checked="checked"';
}

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

	}
else
{

	}
else
{

		$html_sel['no'] = ' checked="checked"';

		$allow_html = '';

	}

if($announcement['allowmycode'])

	}

if($announcement['allowmycode'])

Zeile 1778Zeile 1852
			'uid' => $mybb->user['uid'],
'subject' => $mybb->input['title'],
'message' => $mybb->input['message'],

			'uid' => $mybb->user['uid'],
'subject' => $mybb->input['title'],
'message' => $mybb->input['message'],

			'allowhtml' => $mybb->get_input('allowhtml', MyBB::INPUT_INT),

			'allowhtml' => $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT),

			'allowmycode' => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT),
'dateline' => TIME_NOW,

			'allowmycode' => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT),
'dateline' => TIME_NOW,

Zeile 2877Zeile 2951
	{
foreach($pfcache as $profilefield)
{

	{
foreach($pfcache as $profilefield)
{

			$userfield = $code = $select = $val = $options = $expoptions = $useropts = $seloptions = '';


			$userfield = $code = $select = $val = $options = $expoptions = $useropts = '';
$seloptions = array();

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

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

Zeile 3059Zeile 3134
	{
$checked = 1;
$checked_item = "checked=\"checked\"";

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

	}

	}

	else
{
$checked = 0;

	else
{
$checked = 0;

Zeile 3191Zeile 3266
	}

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

	}

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

 

$user['usernotes'] = htmlspecialchars_uni($user['usernotes']);


if(!isset($newtitle))
{


if(!isset($newtitle))
{

Zeile 3293Zeile 3370
	$page_url = 'modcp.php?action=finduser';
foreach(array('username', 'sortby', 'order') as $field)
{

	$page_url = 'modcp.php?action=finduser';
foreach(array('username', 'sortby', 'order') as $field)
{

		$mybb->input[$field] = urlencode($mybb->get_input($field));

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

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

Zeile 3467Zeile 3543
		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');

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

Zeile 3495Zeile 3571
		}
}
$multipage = multipage($total_warnings, $per_page, $page, $url);

		}
}
$multipage = multipage($total_warnings, $per_page, $page, $url);





	// The actual query
$sql = "
SELECT

	// The actual query
$sql = "
SELECT

Zeile 3525Zeile 3601
		$row['mod_username'] = htmlspecialchars_uni($row['mod_username']);
$mod_username = format_name($row['mod_username'], $row['mod_usergroup'], $row['mod_displaygroup']);
$mod_username_link = build_profile_link($mod_username, $row['mod_uid']);

		$row['mod_username'] = htmlspecialchars_uni($row['mod_username']);
$mod_username = format_name($row['mod_username'], $row['mod_usergroup'], $row['mod_displaygroup']);
$mod_username_link = build_profile_link($mod_username, $row['mod_uid']);

		$issued_date = my_date($mybb->settings['dateformat'], $row['dateline']).' '.my_date($mybb->settings['timeformat'], $row['dateline']);

		$issued_date = my_date('normal', $row['dateline']);

		$revoked_text = '';
if($row['daterevoked'] > 0)
{

		$revoked_text = '';
if($row['daterevoked'] > 0)
{

Zeile 3534Zeile 3610
		}
if($row['expires'] > 0)
{

		}
if($row['expires'] > 0)
{

			$expire_date = my_date('relative', $row['expires'], '', 2);

			$expire_date = nice_time($row['expires']-TIME_NOW);

		}
else
{
$expire_date = $lang->never;

		}
else
{
$expire_date = $lang->never;

		}

		}

		$title = $row['title'];
if(empty($row['title']))
{

		$title = $row['title'];
if(empty($row['title']))
{

Zeile 3573Zeile 3649
	}

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

	}

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





	$mybb->input['ipaddress'] = $mybb->get_input('ipaddress');
if($mybb->input['ipaddress'])
{

	$mybb->input['ipaddress'] = $mybb->get_input('ipaddress');
if($mybb->input['ipaddress'])
{

Zeile 3608Zeile 3684
			if($post_ip_sql)
{
$where_sql = '';

			if($post_ip_sql)
{
$where_sql = '';


$unviewable_forums = get_unviewable_forums(true);



$unviewable_forums = get_unviewable_forums(true);


				if($unviewable_forums)

				if($unviewable_forums)

				{

				{

					$where_sql .= " AND p.fid NOT IN ({$unviewable_forums})";
}

if($inactiveforums)
{
$where_sql .= " AND p.fid NOT IN ({$inactiveforums})";

					$where_sql .= " AND p.fid NOT IN ({$unviewable_forums})";
}

if($inactiveforums)
{
$where_sql .= " AND p.fid NOT IN ({$inactiveforums})";

				}

				}


// Check group permissions if we can't view threads not started by us
$onlyusfids = array();


// Check group permissions if we can't view threads not started by us
$onlyusfids = array();

Zeile 3635Zeile 3711
				if(!empty($onlyusfids))
{
$where_sql .= " AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";

				if(!empty($onlyusfids))
{
$where_sql .= " AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";

				}


				}


				// Moderators can view unapproved/deleted posts
if($mybb->usergroup['issupermod'] != 1)
{

				// Moderators can view unapproved/deleted posts
if($mybb->usergroup['issupermod'] != 1)
{

Zeile 3645Zeile 3721
					$visible_sql = " AND (p.visible = 1 AND t.visible = 1)";
$query = $db->simple_select("moderators", "fid, canviewunapprove, canviewdeleted", "(id='{$mybb->user['uid']}' AND isgroup='0') OR (id='{$mybb->user['usergroup']}' AND isgroup='1')");
while($moderator = $db->fetch_array($query))

					$visible_sql = " AND (p.visible = 1 AND t.visible = 1)";
$query = $db->simple_select("moderators", "fid, canviewunapprove, canviewdeleted", "(id='{$mybb->user['uid']}' AND isgroup='0') OR (id='{$mybb->user['usergroup']}' AND isgroup='1')");
while($moderator = $db->fetch_array($query))

					{

					{

						if($moderator['canviewunapprove'] == 1)
{
$unapprove_forums[] = $moderator['fid'];

						if($moderator['canviewunapprove'] == 1)
{
$unapprove_forums[] = $moderator['fid'];

Zeile 3679Zeile 3755
					WHERE {$post_ip_sql}{$where_sql}{$visible_sql}
");
$post_results = $db->fetch_field($query, "count");

					WHERE {$post_ip_sql}{$where_sql}{$visible_sql}
");
$post_results = $db->fetch_field($query, "count");

			}

			}

		}

// Searching user IP addresses

		}

// Searching user IP addresses

Zeile 3688Zeile 3764
			if($ip_range)
{
if(!is_array($ip_range))

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

				{

				{

					$user_ip_sql = "regip=".$db->escape_binary($ip_range)." OR lastip=".$db->escape_binary($ip_range);

					$user_ip_sql = "regip=".$db->escape_binary($ip_range)." OR lastip=".$db->escape_binary($ip_range);

				}

				}

				else
{
$user_ip_sql = "regip BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1])." OR lastip BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1]);
}

				else
{
$user_ip_sql = "regip BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1])." OR lastip BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1]);
}

			}

$plugins->run_hooks("modcp_ipsearch_users_start");


			}

$plugins->run_hooks("modcp_ipsearch_users_start");


			if($user_ip_sql)
{
$query = $db->simple_select('users', 'COUNT(uid) AS count', $user_ip_sql);

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

			if($user_ip_sql)
{
$query = $db->simple_select('users', 'COUNT(uid) AS count', $user_ip_sql);

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

		}

		}


$total_results = $post_results+$user_results;



$total_results = $post_results+$user_results;


Zeile 3723Zeile 3799

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


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

		{

		{

			$page = $mybb->get_input('page', MyBB::INPUT_INT);
}

			$page = $mybb->get_input('page', MyBB::INPUT_INT);
}





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

if($mybb->get_input('page') == "last")

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

if($mybb->get_input('page') == "last")

		{

		{

			$page = $pages;
}


			$page = $pages;
}


Zeile 3748Zeile 3824
		{
$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 3756Zeile 3832
			if(!empty($mybb->input[$input]))
{
$page_url .= "&amp;{$input}=".urlencode($mybb->input[$input]);

			if(!empty($mybb->input[$input]))
{
$page_url .= "&amp;{$input}=".urlencode($mybb->input[$input]);

			}

			}

		}
$multipage = multipage($total_results, $perpage, $page, $page_url);


		}
$multipage = multipage($total_results, $perpage, $page, $page_url);


Zeile 3798Zeile 3874
					$ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));
}
if($ip)

					$ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));
}
if($ip)

				{

				{

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

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

				}

				}

				if($result)
{
--$post_limit;
}

				if($result)
{
--$post_limit;
}

			}
}

			}
}

		$post_start = 0;
if($total_results > $user_results && $post_limit)
{

		$post_start = 0;
if($total_results > $user_results && $post_limit)
{

Zeile 3815Zeile 3891
			if($post_start < 0)
{
$post_start = 0;

			if($post_start < 0)
{
$post_start = 0;

			}
}

			}
}

		if(isset($mybb->input['search_posts']) && $post_results && (!isset($mybb->input['search_users']) || (isset($mybb->input['search_users']) && $post_limit > 0)))
{
$ipaddresses = $tids = $uids = array();

		if(isset($mybb->input['search_posts']) && $post_results && (!isset($mybb->input['search_users']) || (isset($mybb->input['search_users']) && $post_limit > 0)))
{
$ipaddresses = $tids = $uids = array();

Zeile 3834Zeile 3910
				$tids[$ipaddress['tid']] = $ipaddress['pid'];
$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;

				$tids[$ipaddress['tid']] = $ipaddress['pid'];
$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;

			}

			}


if(!empty($ipaddresses))
{


if(!empty($ipaddresses))
{

Zeile 3842Zeile 3918
				while($thread = $db->fetch_array($query))
{
$ipaddresses[$tids[$thread['tid']]]['threadsubject'] = $thread['subject'];

				while($thread = $db->fetch_array($query))
{
$ipaddresses[$tids[$thread['tid']]]['threadsubject'] = $thread['subject'];

				}

				}

				unset($tids);

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

				unset($tids);

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

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

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





				foreach($ipaddresses as $ipaddress)
{
$ip = my_inet_ntop($db->unescape_binary($ipaddress['ipaddress']));

				foreach($ipaddresses as $ipaddress)
{
$ip = my_inet_ntop($db->unescape_binary($ipaddress['ipaddress']));

Zeile 3877Zeile 3953
		}

if(!$results)

		}

if(!$results)

		{

		{

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

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

		}

		}


if($ipaddressvalue)
{
$lang->ipsearch_results = $lang->sprintf($lang->ipsearch_results, $ipaddressvalue);


if($ipaddressvalue)
{
$lang->ipsearch_results = $lang->sprintf($lang->ipsearch_results, $ipaddressvalue);

		}
else

		}
else

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

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

Zeile 4157Zeile 4233
}

if($mybb->input['action'] == "do_banuser" && $mybb->request_method == "post")

}

if($mybb->input['action'] == "do_banuser" && $mybb->request_method == "post")

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

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


if($mybb->usergroup['canbanusers'] == 0)
{


if($mybb->usergroup['canbanusers'] == 0)
{

Zeile 4182Zeile 4258
		if($user['uid'])
{
$existing_ban = true;

		if($user['uid'])
{
$existing_ban = true;

		}

		}


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


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

Zeile 4190Zeile 4266
			error_no_permission();
}
}

			error_no_permission();
}
}

 

$errors = array();


// Creating a new ban
if(!$existing_ban)


// Creating a new ban
if(!$existing_ban)

Zeile 4227Zeile 4305
	// Check banned group
$usergroups_cache = $cache->read('usergroups');
$usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)];

	// Check banned group
$usergroups_cache = $cache->read('usergroups');
$usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)];

	$query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".$mybb->get_input('usergroup', MyBB::INPUT_INT)."'");

 

if(empty($usergroup['gid']) || empty($usergroup['isbannedgroup']))
{


if(empty($usergroup['gid']) || empty($usergroup['isbannedgroup']))
{

Zeile 4433Zeile 4510

$thatime = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time, $dateline));
$thattime = " ({$thatime})";


$thatime = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time, $dateline));
$thattime = " ({$thatime})";

		}


		}


		eval("\$liftlist .= \"".$templates->get("modcp_banuser_liftlist")."\";");
}

		eval("\$liftlist .= \"".$templates->get("modcp_banuser_liftlist")."\";");
}





	$bangroup_option = $bangroups = '';
$numgroups = $banned_group = 0;
$groupscache = $cache->read("usergroups");

foreach($groupscache as $key => $group)

	$bangroup_option = $bangroups = '';
$numgroups = $banned_group = 0;
$groupscache = $cache->read("usergroups");

foreach($groupscache as $key => $group)

	{

	{

		if($group['isbannedgroup'])
{
$selected = "";

		if($group['isbannedgroup'])
{
$selected = "";

Zeile 4460Zeile 4537
	}

if($numgroups == 0)

	}

if($numgroups == 0)

	{

	{

		error($lang->no_banned_group);
}
elseif($numgroups > 1)

		error($lang->no_banned_group);
}
elseif($numgroups > 1)

Zeile 4495Zeile 4572
	verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("modcp_do_modnotes_start");

	verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("modcp_do_modnotes_start");





	// Update Moderator Notes cache
$update_cache = array(
"modmessage" => $mybb->get_input('modnotes')

	// Update Moderator Notes cache
$update_cache = array(
"modmessage" => $mybb->get_input('modnotes')

Zeile 4503Zeile 4580
	$cache->update("modnotes", $update_cache);

$plugins->run_hooks("modcp_do_modnotes_end");

	$cache->update("modnotes", $update_cache);

$plugins->run_hooks("modcp_do_modnotes_end");





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


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


Zeile 4518Zeile 4595
			if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
{
$bgcolor = "trow1";

			if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
{
$bgcolor = "trow1";

			}
else
{

			}
else
{

				$bgcolor = "trow2";
}


				$bgcolor = "trow2";
}


Zeile 4571Zeile 4648
				WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
");
$unapproved_posts = $db->fetch_field($query, "unapprovedposts");

				WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
");
$unapproved_posts = $db->fetch_field($query, "unapprovedposts");





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

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

Zeile 4650Zeile 4727
		$where = '';
if($tflist_modlog)
{

		$where = '';
if($tflist_modlog)
{

			$where = "WHERE (t.fid <> 0 {$tflist_modlog}) OR (!l.fid)";

			$where = "WHERE (t.fid <> 0 {$tflist_modlog}) OR (l.fid <> 0)";

		}

$query = $db->query("

		}

$query = $db->query("

Zeile 4710Zeile 4787
					eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";");
}
}

					eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";");
}
}

 

$plugins->run_hooks("modcp_modlogs_result");


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


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