Vergleich modcp.php - 1.8.10 - 1.8.13

  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 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 491Zeile 523
			}
}


			}
}


		$plugins->run_hooks('modcp_reports_intermediate');




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

$inlinecount = 0;

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

if(!$report['type'])

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

if(!$report['type'])

			{

			{

				// Assume a post
$report['type'] = 'post';
}

				// Assume a post
$report['type'] = 'post';
}

Zeile 531Zeile 569
					$good_user = build_profile_link(htmlspecialchars_uni($usercache[$report['id3']]['username']), $usercache[$report['id3']]['uid']);
$report_data['content'] .= $lang->sprintf($lang->report_info_rep_profile, $good_user);
break;

					$good_user = build_profile_link(htmlspecialchars_uni($usercache[$report['id3']]['username']), $usercache[$report['id3']]['uid']);
$report_data['content'] .= $lang->sprintf($lang->report_info_rep_profile, $good_user);
break;

			}


			}


			// Report reason and comment
if($report['reasonid'] > 0)
{

			// Report reason and comment
if($report['reasonid'] > 0)
{

Zeile 549Zeile 587
				}
}
else

				}
}
else

			{

			{

				$report_data['comment'] = $lang->na;
}


				$report_data['comment'] = $lang->na;
}


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 775Zeile 820
	}

if($nummodlogs == 0 && $mybb->usergroup['issupermod'] != 1)

	}

if($nummodlogs == 0 && $mybb->usergroup['issupermod'] != 1)

	{

	{

		error($lang->you_cannot_view_mod_logs);
}

		error($lang->you_cannot_view_mod_logs);
}





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

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

	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->settings['threadsperpage'];
}





	$where = '';

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

	$where = '';

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

	{

	{

		$where .= " AND l.uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";

		$where .= " AND l.uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";

	}


	}


	// Searching for entries in a specific forum
if($mybb->get_input('fid', MyBB::INPUT_INT))
{
$where .= " AND t.fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";

	// Searching for entries in a specific forum
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');

// Order?

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

// Order?

Zeile 808Zeile 853
	{
case "username":
$sortby = "u.username";

	{
case "username":
$sortby = "u.username";

			break;

			break;

		case "forum":
$sortby = "f.name";
break;

		case "forum":
$sortby = "f.name";
break;

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

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

	}

$plugins->run_hooks("modcp_modlogs_start");


	}

$plugins->run_hooks("modcp_modlogs_start");


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

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

Zeile 842Zeile 887
	}

$postcount = (int)$rescount;

	}

$postcount = (int)$rescount;

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


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


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

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

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

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

	{

	{

		$page = 1;
}


		$page = 1;
}


Zeile 867Zeile 912

$page_url = 'modcp.php?action=modlogs&amp;perpage='.$perpage;
foreach(array('uid', 'fid') as $field)


$page_url = 'modcp.php?action=modlogs&amp;perpage='.$perpage;
foreach(array('uid', 'fid') as $field)

	{

	{

		$mybb->input[$field] = $mybb->get_input($field, MyBB::INPUT_INT);
if(!empty($mybb->input[$field]))
{

		$mybb->input[$field] = $mybb->get_input($field, MyBB::INPUT_INT);
if(!empty($mybb->input[$field]))
{

Zeile 875Zeile 920
		}
}
foreach(array('sortby', 'order') as $field)

		}
}
foreach(array('sortby', 'order') as $field)

	{

	{

		$mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field));
if(!empty($mybb->input[$field]))
{

		$mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field));
if(!empty($mybb->input[$field]))
{

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)
{
error($lang->error_invalid_announcement);

	if(!$announcement)
{
error($lang->error_invalid_announcement);

Zeile 1121Zeile 1175

$localized_time_offset = (float)$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 1131Zeile 1185
	{
$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 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;
}
else
{
$allowhtml = 0;

		$allowhtml = 1;
}
else
{
$allowhtml = 0;

	}

	}

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

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

	{

	{

		$allowmycode = 1;

		$allowmycode = 1;

	}
else
{

	}
else
{

		$allowmycode = 0;

		$allowmycode = 0;

	}

	}

	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 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'] = '01';

	$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'] = '01';

	}

$localized_time_offset = TIME_NOW + (float)$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)

	{

	{

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

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

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

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

	{

	{

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

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

	{

	{

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

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

		}

		}

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

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

		}

		}

		elseif($enddate <= $startdate)
{
$errors[] = $lang->error_end_before_start;
}
}


		elseif($enddate <= $startdate)
{
$errors[] = $lang->error_end_before_start;
}
}


	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

	}
else

	{
$allowhtml = 0;
}

	{
$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 1608Zeile 1672
	if(!$announcement)
{
error($lang->error_invalid_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_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();

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


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

	}

$plugins->run_hooks("modcp_editprofile_end");


	}

$plugins->run_hooks("modcp_editprofile_end");


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

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

Zeile 3208Zeile 3285
	if($mybb->usergroup['caneditprofiles'] == 0)
{
error_no_permission();

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

	}

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

	}

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


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

if(isset($mybb->input['username']))

	$where = '';

if(isset($mybb->input['username']))

Zeile 3242Zeile 3319
			break;
case "postnum":
$sortby = "postnum";

			break;
case "postnum":
$sortby = "postnum";

			break;

			break;

		case "username":
$sortby = "username";
break;
default:
$sortby = "regdate";

		case "username":
$sortby = "username";
break;
default:
$sortby = "regdate";

	}

	}

	$sortbysel = array('lastvisit' => '', 'postnum' => '', 'username' => '', 'regdate' => '');
$sortbysel[$mybb->get_input('sortby')] = " selected=\"selected\"";
$order = $mybb->get_input('order');

	$sortbysel = array('lastvisit' => '', 'postnum' => '', 'username' => '', 'regdate' => '');
$sortbysel[$mybb->get_input('sortby')] = " selected=\"selected\"";
$order = $mybb->get_input('order');

Zeile 3261Zeile 3338

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


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





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

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

	}


	}


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

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

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

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

	}

	}


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


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

Zeile 3294Zeile 3371
	foreach(array('username', 'sortby', 'order') as $field)
{
if(!empty($mybb->input[$field]))

	foreach(array('username', 'sortby', 'order') as $field)
{
if(!empty($mybb->input[$field]))

		{

		{

			$page_url .= "&amp;{$field}=".$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);


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

$plugins->run_hooks("modcp_finduser_start");

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

$plugins->run_hooks("modcp_finduser_start");

Zeile 3319Zeile 3396
		if($user['invisible'] == 1 && $mybb->usergroup['canviewwolinvis'] != 1 && $user['uid'] != $mybb->user['uid'])
{
$lastdate = $lang->lastvisit_never;

		if($user['invisible'] == 1 && $mybb->usergroup['canviewwolinvis'] != 1 && $user['uid'] != $mybb->user['uid'])
{
$lastdate = $lang->lastvisit_never;





			if($user['lastvisit'])
{
// We have had at least some active time, hide it instead
$lastdate = $lang->lastvisit_hidden;
}

			if($user['lastvisit'])
{
// We have had at least some active time, hide it instead
$lastdate = $lang->lastvisit_hidden;
}

		}

		}

		else
{
$lastdate = my_date('relative', $user['lastvisit']);

		else
{
$lastdate = my_date('relative', $user['lastvisit']);

Zeile 3345Zeile 3422

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


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

}


}


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

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

	}


	}


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

// Filter options

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

// Filter options

Zeile 3366Zeile 3443

$mybb->input['filter']['uid'] = (int)$search_user['uid'];
$mybb->input['filter']['username'] = htmlspecialchars_uni($mybb->input['filter']['username']);


$mybb->input['filter']['uid'] = (int)$search_user['uid'];
$mybb->input['filter']['username'] = htmlspecialchars_uni($mybb->input['filter']['username']);

	}

	}

	else

	else

	{

	{

		$mybb->input['filter']['username'] = '';
}
if(!empty($mybb->input['filter']['uid']))

		$mybb->input['filter']['username'] = '';
}
if(!empty($mybb->input['filter']['uid']))

	{

	{

		$search['uid'] = (int)$mybb->input['filter']['uid'];
$where_sql .= " AND w.uid='{$search['uid']}'";
if(!isset($mybb->input['search']['username']))

		$search['uid'] = (int)$mybb->input['filter']['uid'];
$where_sql .= " AND w.uid='{$search['uid']}'";
if(!isset($mybb->input['search']['username']))

Zeile 3391Zeile 3468

$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid'];
$mybb->input['filter']['mod_username'] = htmlspecialchars_uni($mybb->input['filter']['mod_username']);


$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid'];
$mybb->input['filter']['mod_username'] = htmlspecialchars_uni($mybb->input['filter']['mod_username']);

	}

	}

	else

	else

	{

	{

		$mybb->input['filter']['mod_username'] = '';
}
if(!empty($mybb->input['filter']['mod_uid']))

		$mybb->input['filter']['mod_username'] = '';
}
if(!empty($mybb->input['filter']['mod_uid']))

	{

	{

		$search['mod_uid'] = (int)$mybb->input['filter']['mod_uid'];
$where_sql .= " AND w.issuedby='{$search['mod_uid']}'";
if(!isset($mybb->input['search']['mod_username']))

		$search['mod_uid'] = (int)$mybb->input['filter']['mod_uid'];
$where_sql .= " AND w.issuedby='{$search['mod_uid']}'";
if(!isset($mybb->input['search']['mod_username']))

Zeile 3524Zeile 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 3533Zeile 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
{

		}
else
{

Zeile 3607Zeile 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 3634Zeile 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 3644Zeile 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 3678Zeile 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 3687Zeile 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 3722Zeile 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 3747Zeile 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 3755Zeile 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 3797Zeile 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 3814Zeile 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 3833Zeile 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 3841Zeile 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 3850Zeile 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 3876Zeile 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 4156Zeile 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 4226Zeile 4303
	// 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 4640Zeile 4716
		if(!empty($awaitingattachments) || !empty($awaitingposts) || !empty($awaitingthreads))
{
eval("\$awaitingmoderation = \"".$templates->get("modcp_awaitingmoderation")."\";");

		if(!empty($awaitingattachments) || !empty($awaitingposts) || !empty($awaitingthreads))
{
eval("\$awaitingmoderation = \"".$templates->get("modcp_awaitingmoderation")."\";");

		}

		}

	}

$latestfivemodactions = '';

	}

$latestfivemodactions = '';

Zeile 4683Zeile 4759
				eval("\$information .= \"".$templates->get("modcp_modlogs_result_thread")."\";");
}
if($logitem['fname'])

				eval("\$information .= \"".$templates->get("modcp_modlogs_result_thread")."\";");
}
if($logitem['fname'])

			{

			{

				$logitem['forum'] = get_forum_link($logitem['fid']);
eval("\$information .= \"".$templates->get("modcp_modlogs_result_forum")."\";");
}

				$logitem['forum'] = get_forum_link($logitem['fid']);
eval("\$information .= \"".$templates->get("modcp_modlogs_result_forum")."\";");
}

Zeile 4709Zeile 4785
					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")."\";");
}