Vergleich modcp.php - 1.8.8 - 1.8.24

  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 263Zeile 263

if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs))
{


if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs))
{

 
	$expaltext = (in_array("modcpforums", $collapse)) ? "[+]" : "[-]";

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

if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch))
{

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

if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch))
{

 
	$expaltext = (in_array("modcpusers", $collapse)) ? "[+]" : "[-]";

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


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


Zeile 285Zeile 287
	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 357

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

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

	$plugins->run_hooks("modcp_reports_end");

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





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

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

	}

$lang->load('report');


	}

$lang->load('report');


	add_breadcrumb($lang->report_center, "modcp.php?action=reports");
add_breadcrumb($lang->all_reports, "modcp.php?action=allreports");

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

	add_breadcrumb($lang->report_center, "modcp.php?action=reports");
add_breadcrumb($lang->all_reports, "modcp.php?action=allreports");

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

	}


	}


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

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

Zeile 610Zeile 657
	}

if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod'])

	}

if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod'])

	{

	{

		$query = $db->simple_select("reportedcontent", "COUNT(rid) AS count");
$report_count = $db->fetch_field($query, "count");
}

		$query = $db->simple_select("reportedcontent", "COUNT(rid) AS count");
$report_count = $db->fetch_field($query, "count");
}

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

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

		{

		{

			$page = $result / $perpage;
}
else

			$page = $result / $perpage;
}
else

Zeile 653Zeile 700
	}

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

	}
else

	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

Zeile 704Zeile 751
			$trow = alt_trow();

if($report['type'] == 'post')

			$trow = alt_trow();

if($report['type'] == 'post')

			{

			{

				$post = get_post_link($report['id'])."#pid{$report['id']}";
$user = build_profile_link(htmlspecialchars_uni($report['postusername']), $report['postuid']);
$report_data['content'] = $lang->sprintf($lang->report_info_post, $post, $user);

				$post = get_post_link($report['id'])."#pid{$report['id']}";
$user = build_profile_link(htmlspecialchars_uni($report['postusername']), $report['postuid']);
$report_data['content'] = $lang->sprintf($lang->report_info_post, $post, $user);

Zeile 755Zeile 802

$report_data['reports'] = my_number_format($report['reports']);
$report_data['time'] = my_date('relative', $report['dateline']);


$report_data['reports'] = my_number_format($report['reports']);
$report_data['time'] = my_date('relative', $report['dateline']);





			$plugins->run_hooks("modcp_allreports_report");
eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";");
}

			$plugins->run_hooks("modcp_allreports_report");
eval("\$allreports .= \"".$templates->get("modcp_reports_allreport")."\";");
}

Zeile 772Zeile 819
	if($mybb->usergroup['canviewmodlogs'] == 0)
{
error_no_permission();

	if($mybb->usergroup['canviewmodlogs'] == 0)
{
error_no_permission();

	}


	}


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

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

	}

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

	}

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


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


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

	}

$where = '';

	}

$where = '';


// Searching for entries by a particular user
if($mybb->get_input('uid', MyBB::INPUT_INT))


// Searching for entries by a particular user
if($mybb->get_input('uid', MyBB::INPUT_INT))

Zeile 799Zeile 846
	if($mybb->get_input('fid', MyBB::INPUT_INT))
{
$where .= " AND t.fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";

	if($mybb->get_input('fid', MyBB::INPUT_INT))
{
$where .= " AND t.fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";

	}

$mybb->input['sortby'] = $mybb->get_input('sortby');


	}

$mybb->input['sortby'] = $mybb->get_input('sortby');


	// Order?
switch($mybb->input['sortby'])
{

	// Order?
switch($mybb->input['sortby'])
{

Zeile 834Zeile 881
		WHERE 1=1 {$where}{$tflist_modlog}
");
$rescount = $db->fetch_field($query, "count");

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


// Figure out if we need to display multiple pages.
if($mybb->get_input('page') != "last")
{
$page = $mybb->get_input('page', MyBB::INPUT_INT);
}



// Figure out if we need to display multiple pages.
if($mybb->get_input('page') != "last")
{
$page = $mybb->get_input('page', MyBB::INPUT_INT);
}


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

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

Zeile 907Zeile 954
		$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 1000
				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 1025Zeile 1081
}

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

}

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

{
if($mybb->usergroup['canmanageannounce'] == 0)
{
error_no_permission();
}


{
if($mybb->usergroup['canmanageannounce'] == 0)
{
error_no_permission();
}


	$aid = $mybb->get_input('aid');
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");


	$aid = $mybb->get_input('aid');
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");


Zeile 1043Zeile 1099
	}

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

	}

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

$plugins->run_hooks("modcp_delete_announcement");

	{
error_no_permission();
}

$plugins->run_hooks("modcp_delete_announcement");


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


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

Zeile 1056Zeile 1112
if($mybb->input['action'] == "do_new_announcement")
{
verify_post_check($mybb->get_input('my_post_key'));

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





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

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

	{

	{

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


		error_no_permission();
}


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

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

	}


	}


	if(!$announcement_fid)
{
$errors[] = $lang->error_missing_forum;

	if(!$announcement_fid)
{
$errors[] = $lang->error_missing_forum;

Zeile 1098Zeile 1154
	{
$startdate[0] = 12+$startdate[0];
if($startdate[0] >= 24)

	{
$startdate[0] = 12+$startdate[0];
if($startdate[0] >= 24)

		{

		{

			$startdate[0] = "00";
}
}

			$startdate[0] = "00";
}
}

Zeile 1119Zeile 1175
		$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;

	}

	}


if($mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2)


if($mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2)

	{

	{

		$enddate = '0';
$mybb->input['endtime_month'] = '01';

		$enddate = '0';
$mybb->input['endtime_month'] = '01';

	}
else
{

	}
else
{

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

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

Zeile 1141Zeile 1197
		}
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, $mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) - $localized_time_offset;
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)

		}
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, $mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) - $localized_time_offset;
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;
}


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


Zeile 1151Zeile 1207
		}
}


		}
}


	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 1168Zeile 1224
		$allowmycode = 0;
}
if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1)

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

	{

	{

		$allowsmilies = 1;
}
else

		$allowsmilies = 1;
}
else

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


Zeile 1261Zeile 1317
	}
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);

		$startday = $endday = gmdate("j", TIME_NOW + $localized_time);

		$startday = $endday = gmdate("j", $localized_time);

		$startmonth = $endmonth = gmdate("m", $localized_time);
$startdateyear = gmdate("Y", $localized_time);

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

		$startmonth = $endmonth = gmdate("m", $localized_time);
$startdateyear = gmdate("Y", $localized_time);

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

			'allowhtml' => 1,

			'allowhtml' => 0,

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

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

Zeile 1325Zeile 1381
	$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 1424
		$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 1437
		$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";

		}

require_once MYBB_ROOT."inc/functions_post.php";

Zeile 1492Zeile 1558
		$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 1589
		}
}


		}
}


	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 1540Zeile 1606
		$allowmycode = 0;
}
if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1)

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

	{

	{

		$allowsmilies = 1;
}
else

		$allowsmilies = 1;
}
else

Zeile 1572Zeile 1638
			);
$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 1732
	}
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 1729Zeile 1795
	$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($announcement['allowmycode'])



















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

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

	}

	}

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

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

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

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

	}
else

	}
else

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

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

Zeile 1760Zeile 1836
	if(($errored && $mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2) || (!$errored && (int)$announcement['enddate'] == 0) || $makeshift_end == true)
{
$end_type_sel['infinite'] = ' checked="checked"';

	if(($errored && $mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2) || (!$errored && (int)$announcement['enddate'] == 0) || $makeshift_end == true)
{
$end_type_sel['infinite'] = ' checked="checked"';

	}

	}

	else
{
$end_type_sel['finite'] = ' checked="checked"';

	else
{
$end_type_sel['finite'] = ' checked="checked"';

Zeile 1778Zeile 1854
			'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 1820Zeile 1896
	$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")."\";");

	output_page($announcements);

	output_page($announcements);

}

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

}

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

Zeile 1828Zeile 1904
	if($mybb->usergroup['canmanageannounce'] == 0)
{
error_no_permission();

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

	}


	}


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

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

	}

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


	}

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


	// Fetch announcements into their proper arrays
$query = $db->simple_select("announcements", "aid, fid, subject, enddate");
$announcements = $global_announcements = array();

	// Fetch announcements into their proper arrays
$query = $db->simple_select("announcements", "aid, fid, subject, enddate");
$announcements = $global_announcements = array();

Zeile 1887Zeile 1963
	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");

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

	$plugins->run_hooks("modcp_announcements");

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

Zeile 1920Zeile 1996
		// Fetch threads
$query = $db->simple_select("threads", "tid", "tid IN (".implode(",", $threads)."){$flist_queue_threads}");
while($thread = $db->fetch_array($query))

		// Fetch threads
$query = $db->simple_select("threads", "tid", "tid IN (".implode(",", $threads)."){$flist_queue_threads}");
while($thread = $db->fetch_array($query))

		{

		{

			if(!isset($mybb->input['threads'][$thread['tid']]))
{
continue;

			if(!isset($mybb->input['threads'][$thread['tid']]))
{
continue;

Zeile 1954Zeile 2030
					$moderation->delete_thread($tid);
}
log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);

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

			}
}


			}
}


		$plugins->run_hooks("modcp_do_modqueue_end");

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

		$plugins->run_hooks("modcp_do_modqueue_end");

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

Zeile 2078Zeile 2154

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


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

		$pages = ceil($pages);

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

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

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

		$pages = ceil($pages);

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

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

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

		else
{
$start = 0;

		else
{
$start = 0;

Zeile 2145Zeile 2221
		}

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

		}

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

		{

		{

			eval("\$threads = \"".$templates->get("modcp_modqueue_threads_empty")."\";");
}

			eval("\$threads = \"".$templates->get("modcp_modqueue_threads_empty")."\";");
}





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

$plugins->run_hooks("modcp_modqueue_threads_end");

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

$plugins->run_hooks("modcp_modqueue_threads_end");


if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
{
$navsep = " | ";
eval("\$post_link = \"".$templates->get("modcp_modqueue_post_link")."\";");
}

if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1))
{


if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
{
$navsep = " | ";
eval("\$post_link = \"".$templates->get("modcp_modqueue_post_link")."\";");
}

if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1))
{

				$navsep = " | ";
eval("\$attachment_link = \"".$templates->get("modcp_modqueue_attachment_link")."\";");
}

				$navsep = " | ";
eval("\$attachment_link = \"".$templates->get("modcp_modqueue_attachment_link")."\";");
}

Zeile 2179Zeile 2255
		if($nummodqueueposts == 0 && $mybb->usergroup['issupermod'] != 1)
{
error($lang->you_cannot_moderate_posts);

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

		}

		}


$forum_cache = $cache->read("forums");



$forum_cache = $cache->read("forums");


Zeile 2195Zeile 2271
		if($mybb->get_input('page') != "last")
{
$page = $mybb->get_input('page', MyBB::INPUT_INT);

		if($mybb->get_input('page') != "last")
{
$page = $mybb->get_input('page', MyBB::INPUT_INT);

		}


		}


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

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

Zeile 2204Zeile 2280
		if($mybb->get_input('page') == "last")
{
$page = $pages;

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

		}


		}


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

if($page)

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

if($page)

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

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

		}
else
{

		}
else
{

Zeile 2230Zeile 2306
			LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid
ORDER BY p.dateline DESC

			LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid
ORDER BY p.dateline DESC

			LIMIT {$start}, {$perpage}

			LIMIT {$start}, {$perpage}

		");
$posts = '';
while($post = $db->fetch_array($query))

		");
$posts = '';
while($post = $db->fetch_array($query))

Zeile 2247Zeile 2323
			if($post['username'] == "")
{
if($post['postusername'] != "")

			if($post['username'] == "")
{
if($post['postusername'] != "")

				{

				{

					$post['postusername'] = htmlspecialchars_uni($post['postusername']);
$profile_link = $post['postusername'];
}

					$post['postusername'] = htmlspecialchars_uni($post['postusername']);
$profile_link = $post['postusername'];
}

Zeile 2280Zeile 2356
			$plugins->run_hooks("modcp_modqueue_posts_end");

if($nummodqueuethreads > 0 || $mybb->usergroup['issupermod'] == 1)

			$plugins->run_hooks("modcp_modqueue_posts_end");

if($nummodqueuethreads > 0 || $mybb->usergroup['issupermod'] == 1)

			{
$navsep = " | ";

			{
$navsep = " | ";

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

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

			}

			}


if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1))
{
$navsep = " | ";
eval("\$attachment_link = \"".$templates->get("modcp_modqueue_attachment_link")."\";");
}


if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1))
{
$navsep = " | ";
eval("\$attachment_link = \"".$templates->get("modcp_modqueue_attachment_link")."\";");
}





			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 2298Zeile 2374
	}

if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue && $mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1)))

	}

if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue && $mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1)))

	{

	{

		if($mybb->settings['enableattachments'] == 0)
{
error($lang->attachments_disabled);

		if($mybb->settings['enableattachments'] == 0)
{
error($lang->attachments_disabled);

Zeile 2432Zeile 2508
	verify_post_check($mybb->input['my_post_key']);

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

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

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

	{
error_no_permission();
}


	{
error_no_permission();
}


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

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

Zeile 2444Zeile 2520

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


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

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 2461Zeile 2537
				$mybb->input['awaymonth'] = my_date('n', $awaydate);
}
if(!$mybb->get_input('awayyear', MyBB::INPUT_INT))

				$mybb->input['awaymonth'] = my_date('n', $awaydate);
}
if(!$mybb->get_input('awayyear', MyBB::INPUT_INT))

			{

			{

				$mybb->input['awayyear'] = my_date('Y', $awaydate);
}


				$mybb->input['awayyear'] = my_date('Y', $awaydate);
}


Zeile 2478Zeile 2554
			}

$returndate = "{$return_day}-{$return_month}-{$return_year}";

			}

$returndate = "{$return_day}-{$return_month}-{$return_year}";

		}

		}

		else
{
$returndate = "";

		else
{
$returndate = "";

Zeile 2503Zeile 2579
	// Set up user handler.
require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler('update');

	// Set up user handler.
require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler('update');





	// Set the data for the new user.
$updated_user = array(
"uid" => $user['uid'],

	// Set the data for the new user.
$updated_user = array(
"uid" => $user['uid'],

Zeile 2511Zeile 2587
		"profile_fields_editable" => true,
"website" => $mybb->get_input('website'),
"icq" => $mybb->get_input('icq'),

		"profile_fields_editable" => true,
"website" => $mybb->get_input('website'),
"icq" => $mybb->get_input('icq'),

		"aim" => $mybb->get_input('aim'),
"yahoo" => $mybb->get_input('yahoo'),

 
		"skype" => $mybb->get_input('skype'),
"google" => $mybb->get_input('google'),
"signature" => $mybb->get_input('signature'),
"usernotes" => $mybb->get_input('usernotes'),
"away" => $away

		"skype" => $mybb->get_input('skype'),
"google" => $mybb->get_input('google'),
"signature" => $mybb->get_input('signature'),
"usernotes" => $mybb->get_input('usernotes'),
"away" => $away

	);

	);


$updated_user['birthday'] = array(
"day" => $mybb->get_input('birthday_day', MyBB::INPUT_INT),
"month" => $mybb->get_input('birthday_month', MyBB::INPUT_INT),
"year" => $mybb->get_input('birthday_year', MyBB::INPUT_INT)
);


$updated_user['birthday'] = array(
"day" => $mybb->get_input('birthday_day', MyBB::INPUT_INT),
"month" => $mybb->get_input('birthday_month', MyBB::INPUT_INT),
"year" => $mybb->get_input('birthday_year', MyBB::INPUT_INT)
);





	if(!empty($mybb->input['usertitle']))
{
$updated_user['usertitle'] = $mybb->get_input('usertitle');

	if(!empty($mybb->input['usertitle']))
{
$updated_user['usertitle'] = $mybb->get_input('usertitle');

	}

	}

	else if(!empty($mybb->input['reverttitle']))
{
$updated_user['usertitle'] = '';

	else if(!empty($mybb->input['reverttitle']))
{
$updated_user['usertitle'] = '';

	}


	}


	if(!empty($mybb->input['remove_avatar']))
{
$updated_user['avatarurl'] = '';

	if(!empty($mybb->input['remove_avatar']))
{
$updated_user['avatarurl'] = '';

Zeile 2542Zeile 2616

// Set the data of the user in the datahandler.
$userhandler->set_data($updated_user);


// Set the data of the user in the datahandler.
$userhandler->set_data($updated_user);

	$errors = '';

	$errors = array();


// Validate the user and get any errors that might have occurred.
if(!$userhandler->validate_user())


// Validate the user and get any errors that might have occurred.
if(!$userhandler->validate_user())

Zeile 2591Zeile 2665
		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

			$mybb->input[$option['time']] = $mybb->get_input($option['time'], MyBB::INPUT_INT);

			${$option['time']} = $mybb->get_input($option['time'], MyBB::INPUT_INT);

			$mybb->input[$option['period']] = $mybb->get_input($option['period']);
if(empty($mybb->input[$option['action']]))

			$mybb->input[$option['period']] = $mybb->get_input($option['period']);
if(empty($mybb->input[$option['action']]))

			{

			{

				if($user[$option['update_field']] == 1)
{
// We're revoking the suspension

				if($user[$option['update_field']] == 1)
{
// We're revoking the suspension

Zeile 2614Zeile 2688
					$string = $option['action']."_error";
$errors[] = $lang->$string;
}

					$string = $option['action']."_error";
$errors[] = $lang->$string;
}


if(!is_array($errors))

				else


				{
$suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);


				{
$suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);


Zeile 2653Zeile 2726
		// Those with javascript turned off will be able to select both - cheeky!
// Check to make sure we're not moderating AND suspending posting
if(isset($extra_user_updates) && $extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])

		// Those with javascript turned off will be able to select both - cheeky!
// Check to make sure we're not moderating AND suspending posting
if(isset($extra_user_updates) && $extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])

		{

		{

			$errors[] = $lang->suspendmoderate_error;

			$errors[] = $lang->suspendmoderate_error;

		}

if(is_array($errors))
{

		}

if(is_array($errors) && !empty($errors))
{

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

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

Zeile 2683Zeile 2756
if($mybb->input['action'] == "editprofile")
{
if($mybb->usergroup['caneditprofiles'] == 0)

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

	{
error_no_permission();
}

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

	{
error_no_permission();
}

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


$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));
if(!$user)


$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));
if(!$user)

	{

	{

		error($lang->error_nomember);

		error($lang->error_nomember);

	}


	}


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


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


	if(!my_validate_url($user['website']))

















	$userperms = user_permissions($user['uid']);

// Set display group
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

$display_group = usergroup_displaygroup($user['displaygroup']);
if(is_array($display_group))
{
$userperms = array_merge($userperms, $display_group);
}

if(!my_validate_url($user['website']))

	{
$user['website'] = '';

	{
$user['website'] = '';

	}


	}


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

if(!$errors)

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

if(!$errors)

	{

	{

		$mybb->input = array_merge($user, $mybb->input);
$birthday = explode('-', $user['birthday']);
if(!isset($birthday[1]))

		$mybb->input = array_merge($user, $mybb->input);
$birthday = explode('-', $user['birthday']);
if(!isset($birthday[1]))

Zeile 2728Zeile 2817
	else
{
$errors = inline_error($errors);

	else
{
$errors = inline_error($errors);

	}

	}


// Sanitize all input


// Sanitize all input

	foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'skype', 'google', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)
{

	foreach(array('usertitle', 'website', 'icq', 'skype', 'google', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)
{

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


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


	// Custom user title, check to see if we have a default group title
if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

$displaygroupfields = array('usertitle');
$display_group = usergroup_displaygroup($user['displaygroup']);

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

	// Custom user title
if(!empty($userperms['usertitle']))









	{

	{

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

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

	}
else
{

	}
else
{

Zeile 2877Zeile 2958
	{
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 3124Zeile 3206

$suspendsignature_info = $moderateposts_info = $suspendposting_info = '';
$action_options = $modpost_options = $suspost_options = '';


$suspendsignature_info = $moderateposts_info = $suspendposting_info = '';
$action_options = $modpost_options = $suspost_options = '';

 
	$modopts = array();

	foreach($moderator_options as $option)
{

	foreach($moderator_options as $option)
{

		$mybb->input[$option['time']] = $mybb->get_input($option['time'], MyBB::INPUT_INT);

		${$option['time']} = $mybb->get_input($option['time'], MyBB::INPUT_INT);

		// 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 3191Zeile 3274
	}

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))
{
$newtitle = '';
}


if(!isset($newtitle))
{
$newtitle = '';
}

 

$birthday_year = $mybb->input['birthday_year'];
$user_website = $mybb->input['website'];
$user_icq = $mybb->input['icq'];
$user_skype = $mybb->input['skype'];
$user_google = $mybb->input['google'];


$plugins->run_hooks("modcp_editprofile_end");



$plugins->run_hooks("modcp_editprofile_end");


Zeile 3293Zeile 3384
	$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];

		}

		}

	}

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

	}

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

Zeile 3310Zeile 3400
	$query = $db->simple_select("users", "*", "1=1 {$where}", array("order_by" => $sortby, "order_dir" => $order, "limit" => $perpage, "limit_start" => $start));
$users = '';
while($user = $db->fetch_array($query))

	$query = $db->simple_select("users", "*", "1=1 {$where}", array("order_by" => $sortby, "order_dir" => $order, "limit" => $perpage, "limit_start" => $start));
$users = '';
while($user = $db->fetch_array($query))

	{

	{

		$alt_row = alt_trow();
$user['username'] = htmlspecialchars_uni($user['username']);
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

		$alt_row = alt_trow();
$user['username'] = htmlspecialchars_uni($user['username']);
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

Zeile 3343Zeile 3433
	}

$plugins->run_hooks("modcp_finduser_end");

	}

$plugins->run_hooks("modcp_finduser_end");





$username = htmlspecialchars_uni($mybb->get_input('username'));

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

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

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

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

{

{

	if($mybb->usergroup['canviewwarnlogs'] == 0)
{
error_no_permission();

	if($mybb->usergroup['canviewwarnlogs'] == 0)
{
error_no_permission();

Zeile 3454Zeile 3545
	{
$order = "desc";
$ordersel['desc'] = ' selected="selected"';

	{
$order = "desc";
$ordersel['desc'] = ' selected="selected"';

	}

	}

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

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

	}

	}


$plugins->run_hooks("modcp_warninglogs_start");



$plugins->run_hooks("modcp_warninglogs_start");


Zeile 3475Zeile 3566
	$total_warnings = $db->fetch_field($query, 'count');
$page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page <= 0)

	$total_warnings = $db->fetch_field($query, 'count');
$page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page <= 0)

	{
$page = 1;

	{
$page = 1;

	}
$per_page = 20;
if(isset($mybb->input['filter']['per_page']) && (int)$mybb->input['filter']['per_page'] > 0)

	}
$per_page = 20;
if(isset($mybb->input['filter']['per_page']) && (int)$mybb->input['filter']['per_page'] > 0)

	{

	{

		$per_page = (int)$mybb->input['filter']['per_page'];

		$per_page = (int)$mybb->input['filter']['per_page'];

	}

	}

	$start = ($page-1) * $per_page;

	$start = ($page-1) * $per_page;

 
	$pages = ceil($total_warnings / $per_page);
if($page > $pages)
{
$start = 0;
$page = 1;
}

	// Build the base URL for pagination links
$url = 'modcp.php?action=warninglogs';
if(is_array($mybb->input['filter']) && count($mybb->input['filter']))

	// Build the base URL for pagination links
$url = 'modcp.php?action=warninglogs';
if(is_array($mybb->input['filter']) && count($mybb->input['filter']))

Zeile 3525Zeile 3622
		$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 3631
		}
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
{

		}
else
{

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

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

	}

$plugins->run_hooks("modcp_warninglogs_end");






	}

$plugins->run_hooks("modcp_warninglogs_end");

$filter_username = $mybb->input['filter']['username'];
$filter_modusername = $mybb->input['filter']['mod_username'];
$filter_reason = $mybb->input['filter']['reason'];


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

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

Zeile 3573Zeile 3674
	}

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 3612Zeile 3713
				$unviewable_forums = get_unviewable_forums(true);

if($unviewable_forums)

				$unviewable_forums = get_unviewable_forums(true);

if($unviewable_forums)

				{

				{

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


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


Zeile 3629Zeile 3730
					if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;

					if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;

					}

					}

				}

if(!empty($onlyusfids))

				}

if(!empty($onlyusfids))

Zeile 3645Zeile 3746
					$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 3780
					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 3815Zeile 3916
			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)))
{

		}
if(isset($mybb->input['search_posts']) && $post_results && (!isset($mybb->input['search_users']) || (isset($mybb->input['search_users']) && $post_limit > 0)))
{

Zeile 3948Zeile 4049
				{
$ipaddress_location .= $lang->comma.htmlspecialchars_uni(utf8_encode($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', 1, 0)."\";");
echo($iplookup);


eval("\$iplookup = \"".$templates->get('modcp_ipsearch_misc_info', 1, 0)."\";");
echo($iplookup);

Zeile 3977Zeile 4078
	add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");

if(!$mybb->settings['threadsperpage'])

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

if(!$mybb->settings['threadsperpage'])

	{

	{

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


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


Zeile 3994Zeile 4095
	$postcount = (int)$banned_count;
$pages = $postcount / $perpage;
$pages = ceil($pages);

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





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

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

	{

	{

		$page = $pages;
}

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

		$page = $pages;
}

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

	{
$page = 1;

	{
$page = 1;

	}

if($page)

	}

if($page)

Zeile 4019Zeile 4120
	$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=banning");

$plugins->run_hooks("modcp_banning_start");

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

$plugins->run_hooks("modcp_banning_start");





	$query = $db->query("
SELECT b.*, a.username AS adminuser, u.username
FROM ".TABLE_PREFIX."banned b

	$query = $db->query("
SELECT b.*, a.username AS adminuser, u.username
FROM ".TABLE_PREFIX."banned b

Zeile 4035Zeile 4136
	{
$banned['username'] = htmlspecialchars_uni($banned['username']);
$profile_link = build_profile_link($banned['username'], $banned['uid']);

	{
$banned['username'] = htmlspecialchars_uni($banned['username']);
$profile_link = build_profile_link($banned['username'], $banned['uid']);





		// Only show the edit & lift links if current user created ban, or is super mod/admin
$edit_link = '';
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
{
eval("\$edit_link = \"".$templates->get("modcp_banning_edit")."\";");

		// Only show the edit & lift links if current user created ban, or is super mod/admin
$edit_link = '';
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
{
eval("\$edit_link = \"".$templates->get("modcp_banning_edit")."\";");

		}

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


		}

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


		$trow = alt_trow();

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

		$trow = alt_trow();

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

		}
else
{

		}
else
{

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


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


Zeile 4087Zeile 4188
			else if($remaining < 604800)
{
$banned_class = "low_banned";

			else if($remaining < 604800)
{
$banned_class = "low_banned";

			}

			}

			else
{
$banned_class = "normal_banned";

			else
{
$banned_class = "normal_banned";

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

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

	}

$plugins->run_hooks("modcp_banning");

	}

$plugins->run_hooks("modcp_banning");


eval("\$bannedpage = \"".$templates->get("modcp_banning")."\";");
output_page($bannedpage);
}

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


eval("\$bannedpage = \"".$templates->get("modcp_banning")."\";");
output_page($bannedpage);
}

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

{
// 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)
{
error_no_permission();
}

$query = $db->simple_select("banned", "*", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'");

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

$query = $db->simple_select("banned", "*", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'");

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

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


if(!$ban)
{


if(!$ban)
{

Zeile 4138Zeile 4239

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


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





	$updated_group = array(
'usergroup' => $ban['oldgroup'],
'additionalgroups' => $ban['oldadditionalgroups'],

	$updated_group = array(
'usergroup' => $ban['oldgroup'],
'additionalgroups' => $ban['oldadditionalgroups'],

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


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


	$cache->update_banned();

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


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


Zeile 4157Zeile 4257
}

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

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

Zeile 4186Zeile 4286

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

		{

		{

			error_no_permission();
}
}

			error_no_permission();
}
}

 

$errors = array();


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


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

Zeile 4227Zeile 4329
	// 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']))

	{

	{

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


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


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

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


$cache->update_banned();

 

// Log edit or add ban
if($existing_ban)


// Log edit or add ban
if($existing_ban)

Zeile 4650Zeile 4749
		$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 4809
					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")."\";");
}