Vergleich modcp.php - 1.8.15 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 56Zeile 56
$flist_queue_attach = $wflist_reports = $tflist_reports = $flist_reports = $tflist_modlog = $flist_modlog = $errors = '';
// SQL for fetching items only related to forums this user moderates
$moderated_forums = array();

$flist_queue_attach = $wflist_reports = $tflist_reports = $flist_reports = $tflist_modlog = $flist_modlog = $errors = '';
// SQL for fetching items only related to forums this user moderates
$moderated_forums = array();

 
$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;

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

if($mybb->usergroup['issupermod'] != 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))
{

	while($forum = $db->fetch_array($query))
{

		// For Announcements
if($forum['canmanageannouncements'] == 1)
{
++$numannouncements;
}














		$moderated_forums[] = $forum['fid'];
$children = get_child_list($forum['fid']);
if(is_array($children))
{
$moderated_forums = array_merge($moderated_forums, $children);
}
}
$moderated_forums = array_unique($moderated_forums);

$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;
foreach($moderated_forums as $moderated_forum)
{
// For Announcements
if(is_moderator($moderated_forum, 'canmanageannouncements'))
{
++$numannouncements;
}


		// For the Mod Queues

		// For the Mod Queues

		if($forum['canapproveunapprovethreads'] == 1)

		if(is_moderator($moderated_forum, 'canapproveunapprovethreads'))

		{

		{

			$flist_queue_threads .= ",'{$forum['fid']}'";

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

			$flist_queue_threads .= ",'{$moderated_forum}'";







			++$nummodqueuethreads;
}


			++$nummodqueuethreads;
}


		if($forum['canapproveunapproveposts'] == 1)
{
$flist_queue_posts .= ",'{$forum['fid']}'";

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

if($forum['canapproveunapproveattachs'] == 1)

		if(is_moderator($moderated_forum, 'canapproveunapproveposts'))
{
$flist_queue_posts .= ",'{$moderated_forum}'";
++$nummodqueueposts;
}

if(is_moderator($moderated_forum, 'canapproveunapproveattachs'))







		{

		{

			$flist_queue_attach .= ",'{$forum['fid']}'";

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

			$flist_queue_attach .= ",'{$moderated_forum}'";







			++$nummodqueueattach;
}

// For Reported posts

			++$nummodqueueattach;
}

// For Reported posts

		if($forum['canmanagereportedposts'] == 1)

		if(is_moderator($moderated_forum, 'canmanagereportedposts'))

		{

		{

			$flist_reports .= ",'{$forum['fid']}'";

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

			$flist_reports .= ",'{$moderated_forum}'";







			++$numreportedposts;
}

// For the Mod Log

			++$numreportedposts;
}

// For the Mod Log

		if($forum['canviewmodlog'] == 1)

		if(is_moderator($moderated_forum, 'canviewmodlog'))

		{

		{

			$flist_modlog .= ",'{$forum['fid']}'";

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

			$flist_modlog .= ",'{$moderated_forum}'";







			++$nummodlogs;

			++$nummodlogs;

		}

$flist .= ",'{$forum['fid']}'";

		}







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

		$flist .= ",'{$moderated_forum}'";






	}
if($flist_queue_threads)
{

	}
if($flist_queue_threads)
{

Zeile 247Zeile 221
if($mybb->usergroup['canbanusers'] == 1)
{
eval("\$nav_banning = \"".$templates->get("modcp_nav_banning")."\";");

if($mybb->usergroup['canbanusers'] == 1)
{
eval("\$nav_banning = \"".$templates->get("modcp_nav_banning")."\";");

}


}


if($mybb->usergroup['canviewwarnlogs'] == 1)

if($mybb->usergroup['canviewwarnlogs'] == 1)

{

{

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

if($mybb->usergroup['canuseipsearch'] == 1)

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

if($mybb->usergroup['canuseipsearch'] == 1)

{

{

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

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





$plugins->run_hooks("modcp_nav");

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

$plugins->run_hooks("modcp_nav");

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

 
	$expaltext = (in_array("modcpforums", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

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

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

}

}


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


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

 
	$expaltext = (in_array("modcpusers", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

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


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


Zeile 291Zeile 267
	}

$message = $lang->redirect_reportsmarked;

	}

$message = $lang->redirect_reportsmarked;





	if(isset($mybb->cookies['inlinereports']))
{
if($mybb->cookies['inlinereports'] == '|ALL|') {

	if(isset($mybb->cookies['inlinereports']))
{
if($mybb->cookies['inlinereports'] == '|ALL|') {

Zeile 309Zeile 285
		{
$inlinereportlist = explode("|", $mybb->cookies['inlinereports']);
$reports = array_map("intval", $inlinereportlist);

		{
$inlinereportlist = explode("|", $mybb->cookies['inlinereports']);
$reports = array_map("intval", $inlinereportlist);





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

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





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

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

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

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

		}
}
else

		}
}
else

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

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

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

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

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


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

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


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


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

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

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

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 371Zeile 347
	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'))
{

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

Zeile 390Zeile 366
	$pages = ceil($pages);

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

	$pages = ceil($pages);

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

	{
$page = 1;
}


	{
$page = 1;
}


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

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

	{

	{

		$start = 0;
$page = 1;
}

		$start = 0;
$page = 1;
}

Zeile 414Zeile 390
	$plugins->run_hooks("modcp_reports_start");

// Reports

	$plugins->run_hooks("modcp_reports_start");

// Reports

	$reports = '';



	$reports = $selectall = '';
$inlinecount = 0;


	$query = $db->query("
SELECT r.*, u.username, rr.title
FROM ".TABLE_PREFIX."reportedcontent r

	$query = $db->query("
SELECT r.*, u.username, rr.title
FROM ".TABLE_PREFIX."reportedcontent r

Zeile 530Zeile 508

$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 540Zeile 517
			{
// Assume a post
$report['type'] = 'post';

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

			}

			}


// Report Information
$report_data = array();


// Report Information
$report_data = array();

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

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

		}

		}

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

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

Zeile 908Zeile 885
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}


	}


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

Zeile 1048Zeile 1025
}

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

}

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

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

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

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

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

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

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

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

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


$plugins->run_hooks("modcp_do_delete_announcement");


$plugins->run_hooks("modcp_do_delete_announcement");





	$db->delete_query("announcements", "aid='{$aid}'");
log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted);
$cache->update_forumsdisplay();

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

	$db->delete_query("announcements", "aid='{$aid}'");
log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted);
$cache->update_forumsdisplay();

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

}


}


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

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

Zeile 1086Zeile 1063
	}

$aid = $mybb->get_input('aid');

	}

$aid = $mybb->get_input('aid');

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


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


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

	}


	}


	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 1112Zeile 1089
	verify_post_check($mybb->get_input('my_post_key'));

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

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

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

	{
error_no_permission();
}

	{
error_no_permission();
}


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


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

Zeile 1132Zeile 1109

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


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

	{

	{

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


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


Zeile 1187Zeile 1164
		$mybb->input['endtime_month'] = '01';
}
else

		$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'] = $mybb->get_input('endtime_month');
if(!in_array($mybb->input['endtime_month'], $months))
{

Zeile 1206Zeile 1183
	}

if($mybb->settings['announcementshtml'] && $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;

	}

	}

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

	if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 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 1253Zeile 1230
				'allowsmilies' => $allowsmilies
);
$aid = $db->insert_query("announcements", $insert_announcement);

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





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

$plugins->run_hooks("modcp_do_new_announcement_end");

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

$plugins->run_hooks("modcp_do_new_announcement_end");

Zeile 1271Zeile 1248
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");





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

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


// Deal with inline errors
if(!empty($errors) || isset($preview))


// Deal with inline errors
if(!empty($errors) || isset($preview))

	{

	{

		if(!empty($errors))

		if(!empty($errors))

		{

		{

			$errors = inline_error($errors);

			$errors = inline_error($errors);

		}
else
{

		}
else
{

			$errors = '';
}


			$errors = '';
}


Zeile 1312Zeile 1289
		$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT);
$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);

		$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT);
$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);

	}

	}

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

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

Zeile 1334Zeile 1311
		$enddateyear = $startdateyear+1;
}


		$enddateyear = $startdateyear+1;
}


	// Generate form elements
$startdateday = $enddateday = '';
for($day = 1; $day <= 31; ++$day)
{
if($startday == $day)
{
$selected = " selected=\"selected\"";
eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
}
else
{
$selected = '';
eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
}

if($endday == $day)
{
$selected = " selected=\"selected\"";
eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
}
else
{
$selected = '';
eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
}
}


	// Generate form elements
$startdateday = $enddateday = '';
for($day = 1; $day <= 31; ++$day)
{
if($startday == $day)
{
$selected = " selected=\"selected\"";
eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
}
else
{
$selected = '';
eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
}

if($endday == $day)
{
$selected = " selected=\"selected\"";
eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
}
else
{
$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 1504Zeile 1481
	}

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



$errors = array();


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

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

	}


	}


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

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

Zeile 1554Zeile 1531
	if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = '01';

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

	}

	}


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



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


Zeile 1573Zeile 1550
	{
$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))

		{

		{

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

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

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

		}
elseif($enddate <= $startdate)
{

		}
elseif($enddate <= $startdate)
{

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

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

Zeile 1598Zeile 1575
	if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1)
{
$allowmycode = 1;

	if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 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;
}





	$plugins->run_hooks("modcp_do_edit_announcement_start");

// Proceed to update if no errors
if(!$errors)

	$plugins->run_hooks("modcp_do_edit_announcement_start");

// Proceed to update if no errors
if(!$errors)

	{

	{

		if(isset($mybb->input['preview']))
{
$preview = array();

		if(isset($mybb->input['preview']))
{
$preview = array();

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

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

	}

	}

	else

	else

	{

	{

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

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

	}

	}

}

}





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

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

	{
error_no_permission();
}

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

	{
error_no_permission();
}

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


add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&amp;aid={$aid}");


add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
add_breadcrumb($lang->edit_announcement, "modcp.php?action=edit_announcements&amp;aid={$aid}");

Zeile 1806Zeile 1783
		}

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

		}

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

	}
else
{

	}
else
{

		$allow_html = '';

		$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 1824Zeile 1801
	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 1834Zeile 1811
	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 1843Zeile 1820
	// MyCode editor
$codebuttons = build_mycode_inserter();
$smilieinserter = build_clickable_smilies();

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





	if(isset($preview))
{
$announcementarray = array(

	if(isset($preview))
{
$announcementarray = array(

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

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


require_once MYBB_ROOT."inc/functions_post.php";
$postbit = build_postbit($announcementarray, 3);

Zeile 1933Zeile 1910
			foreach($global_announcements as $aid => $announcement)
{
$trow = alt_trow();

			foreach($global_announcements as $aid => $announcement)
{
$trow = alt_trow();

				if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))

				if((isset($announcement['startdate']) && $announcement['startdate'] > TIME_NOW) || (isset($announcement['enddate']) && $announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))

				{
eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";");
}

				{
eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";");
}

Zeile 2303Zeile 2280
			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid

			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
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

			ORDER BY p.dateline DESC, p.pid DESC

			LIMIT {$start}, {$perpage}
");
$posts = '';

			LIMIT {$start}, {$perpage}
");
$posts = '';

Zeile 2503Zeile 2480
if($mybb->input['action'] == "do_editprofile")
{
// Verify incoming POST request

if($mybb->input['action'] == "do_editprofile")
{
// Verify incoming POST request

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

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


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


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

Zeile 2585Zeile 2562
		"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'),

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

Zeile 2616Zeile 2591

// 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 2665Zeile 2640
		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']]))
{

Zeile 2688Zeile 2663
					$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']]);





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

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

						if($suspend_length == "-1")

						if($suspend_length == "-1")

						{
// Permanent ban on action

						{
// Permanent ban on action

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

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

						}
elseif($suspend_length && $suspend_length != "-1")
{

						}
elseif($suspend_length && $suspend_length != "-1")
{

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

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

						}

						}

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

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

						}
}
}
}
}


						}
}
}
}
}


		// Those with javascript turned off will be able to select both - cheeky!
// Check to make sure we're not moderating AND suspending posting

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

		if(isset($extra_user_updates) && !empty($extra_user_updates['moderateposts']) && !empty($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";
}

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

Zeile 2757Zeile 2731
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)
{
error($lang->error_nomember);


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

	}


	}


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

 
	}

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

	}

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

Zeile 2805Zeile 2795
	}

// 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']))
{
$defaulttitle = htmlspecialchars_uni($display_group['usertitle']);

	// Custom user title
if(!empty($userperms['usertitle']))
{
$defaulttitle = htmlspecialchars_uni($userperms['usertitle']);









	}
else
{
// Go for post count title if a group default isn't set
$usertitles = $cache->read('usertitles');

	}
else
{
// Go for post count title if a group default isn't set
$usertitles = $cache->read('usertitles');





		foreach($usertitles as $title)
{
if($title['posts'] <= $user['postnum'])
{

		foreach($usertitles as $title)
{
if($title['posts'] <= $user['postnum'])
{

				$defaulttitle = $title['title'];

				$defaulttitle = htmlspecialchars_uni($title['title']);

				break;

				break;

			}

			}

		}
}


		}
}


Zeile 2858Zeile 2840
		}

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

		}

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

	}

	}


$bdaymonthsel = array();
foreach(range(1, 12) as $month)


$bdaymonthsel = array();
foreach(range(1, 12) as $month)

Zeile 2871Zeile 2853
	{
$awaycheck = array('', '');
if($errors)

	{
$awaycheck = array('', '');
if($errors)

		{
if($user['away'] == 1)
{
$awaycheck[1] = "checked=\"checked\"";
}

		{
if($user['away'] == 1)
{
$awaycheck[1] = "checked=\"checked\"";
}

			else
{
$awaycheck[0] = "checked=\"checked\"";

			else
{
$awaycheck[0] = "checked=\"checked\"";

Zeile 2899Zeile 2881
			{
$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";

			{
$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";

			}

			}

			$returndate = explode("-", $user['returndate']);
}
$returndatesel = $selected = '';

			$returndate = explode("-", $user['returndate']);
}
$returndatesel = $selected = '';

Zeile 2915Zeile 2897
			}

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

			}

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

		}

		}


$returndatemonthsel = array();
foreach(range(1, 12) as $month)


$returndatemonthsel = array();
foreach(range(1, 12) as $month)

Zeile 2923Zeile 2905
			$returndatemonthsel[$month] = '';
}
if(isset($returndate[1]))

			$returndatemonthsel[$month] = '';
}
if(isset($returndate[1]))

		{

		{

			$returndatemonthsel[$returndate[1]] = " selected=\"selected\"";

			$returndatemonthsel[$returndate[1]] = " selected=\"selected\"";

		}

		}


if(!isset($returndate[2]))
{
$returndate[2] = '';
}


if(!isset($returndate[2]))
{
$returndate[2] = '';
}





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

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

	}


	}


	$plugins->run_hooks("modcp_editprofile_start");

// Fetch profile fields

	$plugins->run_hooks("modcp_editprofile_start");

// Fetch profile fields

 
	$user_fields = array();

	$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");

	$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");

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




	if($db->num_rows($query) > 0)
{
$user_fields = $db->fetch_array($query);
}


$requiredfields = '';
$customfields = '';


$requiredfields = '';
$customfields = '';

Zeile 2970Zeile 2956
					$userfield = $mybb->input['profile_fields'][$field];
}
}

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

			else

			elseif(isset($user_fields[$field]))

			{
$userfield = $user_fields[$field];
}

			{
$userfield = $user_fields[$field];
}

Zeile 2987Zeile 2973
				if(is_array($useropts))
{
foreach($useropts as $key => $val)

				if(is_array($useropts))
{
foreach($useropts as $key => $val)

					{

					{

						$seloptions[$val] = $val;

						$seloptions[$val] = $val;

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

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

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

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

Zeile 3004Zeile 2990
						{
$sel = " selected=\"selected\"";
}

						{
$sel = " selected=\"selected\"";
}





						eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
}
if(!$profilefield['length'])

						eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
}
if(!$profilefield['length'])

Zeile 3016Zeile 3002
				}
}
elseif($type == "select")

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

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

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

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

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

Zeile 3028Zeile 3014
						if($val == $userfield)
{
$sel = " selected=\"selected\"";

						if($val == $userfield)
{
$sel = " selected=\"selected\"";

						}

						}


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


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

Zeile 3041Zeile 3027
				}
}
elseif($type == "radio")

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

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

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

						$checked = "";
if($val == $userfield)
{

						$checked = "";
if($val == $userfield)
{

Zeile 3054Zeile 3040
						}

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

						}

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

					}
}

					}
}

			}
elseif($type == "checkbox")
{

			}
elseif($type == "checkbox")
{

Zeile 3064Zeile 3050
					$useropts = $userfield;
}
else

					$useropts = $userfield;
}
else

				{

				{

					$useropts = explode("\n", $userfield);
}
if(is_array($useropts))

					$useropts = explode("\n", $userfield);
}
if(is_array($useropts))

Zeile 3090Zeile 3076
				}
}
elseif($type == "textarea")

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

			{

			{

				$value = htmlspecialchars_uni($userfield);
eval("\$code = \"".$templates->get("usercp_profile_profilefields_textarea")."\";");
}

				$value = htmlspecialchars_uni($userfield);
eval("\$code = \"".$templates->get("usercp_profile_profilefields_textarea")."\";");
}

Zeile 3199Zeile 3185

$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 3241Zeile 3228
			if($mybb->get_input($string) == $key)
{
$selected = "selected=\"selected\"";

			if($mybb->get_input($string) == $key)
{
$selected = "selected=\"selected\"";

			}

			}

			else
{
$selected = '';
}

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

			else
{
$selected = '';
}

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

		}


		}


		$select_name = $option['select_option']."_period";
switch($option['option'])
{

		$select_name = $option['select_option']."_period";
switch($option['option'])
{

Zeile 3263Zeile 3250
				eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";");
break;
}

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

	}

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

	}

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


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



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


Zeile 3273Zeile 3260
	{
$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 3420Zeile 3413

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

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

Zeile 3465Zeile 3459
	if(!empty($mybb->input['filter']['mod_username']))
{
$mod_user = get_user_by_username($mybb->input['filter']['mod_username']);

	if(!empty($mybb->input['filter']['mod_username']))
{
$mod_user = get_user_by_username($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']);
}

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

Zeile 3482Zeile 3476
			$mod_user = get_user($mybb->input['search']['uid']);
$mybb->input['search']['mod_username'] = htmlspecialchars_uni($mod_user['username']);
}

			$mod_user = get_user($mybb->input['search']['uid']);
$mybb->input['search']['mod_username'] = htmlspecialchars_uni($mod_user['username']);
}

	}
else
{

	}
else
{

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

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

Zeile 3492Zeile 3486
		$search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']);
$where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')";
$mybb->input['filter']['reason'] = htmlspecialchars_uni($mybb->input['filter']['reason']);

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

	}
else

	}
else

	{
$mybb->input['filter']['reason'] = '';
}

	{
$mybb->input['filter']['reason'] = '';
}

Zeile 3521Zeile 3515
			$sortbysel['dateline'] = ' selected="selected"';
}
if(!isset($mybb->input['filter']['order']))

			$sortbysel['dateline'] = ' selected="selected"';
}
if(!isset($mybb->input['filter']['order']))

	{

	{

		$mybb->input['filter']['order'] = '';
}
$order = $mybb->input['filter']['order'];

		$mybb->input['filter']['order'] = '';
}
$order = $mybb->input['filter']['order'];

Zeile 3530Zeile 3524
	{
$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");

// Pagination stuff

	$plugins->run_hooks("modcp_warninglogs_start");

// Pagination stuff

	$sql = "

	$sql = "

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

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

Zeile 3551Zeile 3545
	$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)

Zeile 3560Zeile 3554
		$per_page = (int)$mybb->input['filter']['per_page'];
}
$start = ($page-1) * $per_page;

		$per_page = (int)$mybb->input['filter']['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 3636Zeile 3636
	}

$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 3649Zeile 3653
	}

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

	}

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





$ipsearch_results = $ipaddressvalue = '';

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

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

Zeile 3688Zeile 3693
				$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 3705Zeile 3710
					if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;

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

					}
}


					}
}


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

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

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

						}

						}


if($moderator['canviewdeleted'] == 1)
{


if($moderator['canviewdeleted'] == 1)
{

Zeile 3734Zeile 3739
					}

if(!empty($unapprove_forums))

					}

if(!empty($unapprove_forums))

					{

					{

						$visible_sql .= " OR (p.visible = 0 AND p.fid IN(".implode(',', $unapprove_forums).")) OR (t.visible = 0 AND t.fid IN(".implode(',', $unapprove_forums)."))";
}
if(!empty($deleted_forums))

						$visible_sql .= " OR (p.visible = 0 AND p.fid IN(".implode(',', $unapprove_forums).")) OR (t.visible = 0 AND t.fid IN(".implode(',', $unapprove_forums)."))";
}
if(!empty($deleted_forums))

Zeile 3762Zeile 3767
		if(isset($mybb->input['search_users']))
{
if($ip_range)

		if(isset($mybb->input['search_users']))
{
if($ip_range)

			{

			{

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

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

Zeile 3902Zeile 3907
				FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid)
WHERE {$post_ip_sql}{$where_sql}{$visible_sql}

				FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid)
WHERE {$post_ip_sql}{$where_sql}{$visible_sql}

				ORDER BY p.dateline desc

				ORDER BY p.dateline DESC, p.pid DESC

				LIMIT {$post_start}, {$post_limit}
");
while($ipaddress = $db->fetch_array($query))

				LIMIT {$post_start}, {$post_limit}
");
while($ipaddress = $db->fetch_array($query))

Zeile 4217Zeile 4222

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


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

		'additionalgroups' => $ban['oldadditionalgroups'],

		'additionalgroups' => $db->escape_string($ban['oldadditionalgroups']),

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


		'displaygroup' => $ban['olddisplaygroup']
);
$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 4243Zeile 4247
	}

// Editing an existing ban

	}

// Editing an existing ban

 
	$existing_ban = false;

	if($mybb->get_input('uid', MyBB::INPUT_INT))
{
// Get the users info from their uid

	if($mybb->get_input('uid', MyBB::INPUT_INT))
{
// Get the users info from their uid

Zeile 4254Zeile 4259
		");
$user = $db->fetch_array($query);


		");
$user = $db->fetch_array($query);


		$existing_ban = false;

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

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

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

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

	}


	}


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

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

Zeile 4314Zeile 4318
	// If this is a new ban, we check the user isn't already part of a banned group
if(!$existing_ban && $user['uid'])
{

	// If this is a new ban, we check the user isn't already part of a banned group
if(!$existing_ban && $user['uid'])
{

		$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'");
if($db->fetch_field($query, "uid"))

		$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'", array('limit' => 1));
if($db->num_rows($query) > 0)

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

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

Zeile 4360Zeile 4364
				'uid' => $user['uid'],
'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
'oldgroup' => (int)$user['usergroup'],

				'uid' => $user['uid'],
'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
'oldgroup' => (int)$user['usergroup'],

				'oldadditionalgroups' => (string)$user['additionalgroups'],

				'oldadditionalgroups' => $db->escape_string($user['additionalgroups']),

				'olddisplaygroup' => (int)$user['displaygroup'],
'admin' => (int)$mybb->user['uid'],
'dateline' => TIME_NOW,

				'olddisplaygroup' => (int)$user['displaygroup'],
'admin' => (int)$mybb->user['uid'],
'dateline' => TIME_NOW,

Zeile 4379Zeile 4383
			'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 4404Zeile 4406
		}
}
// Otherwise has errors, throw back to ban page

		}
}
// Otherwise has errors, throw back to ban page

	else

	else

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

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

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

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

		");

		");

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

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

		if($banned['username'])

		if(!empty($banned['username']))

		{
$username = $banned['username'] = htmlspecialchars_uni($banned['username']);
$banreason = htmlspecialchars_uni($banned['reason']);

		{
$username = $banned['username'] = htmlspecialchars_uni($banned['username']);
$banreason = htmlspecialchars_uni($banned['reason']);

Zeile 4456Zeile 4458
	}

// Permission to edit this ban?

	}

// Permission to edit this ban?

	if($banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)

	if(!empty($banned) && $banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)

	{
error_no_permission();
}

	{
error_no_permission();
}

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

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

			{

			{

				$bgcolor = "trow1";
}
else

				$bgcolor = "trow1";
}
else

Zeile 4656Zeile 4658
					FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid

					FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid

					ORDER BY p.dateline DESC

					ORDER BY p.dateline DESC, p.pid DESC

					LIMIT 1
");
$post = $db->fetch_array($query);

					LIMIT 1
");
$post = $db->fetch_array($query);

Zeile 4776Zeile 4778
			if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
{
$data = my_unserialize($logitem['data']);

			if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
{
$data = my_unserialize($logitem['data']);

				if($data['uid'])

				if(isset($data['uid']))

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

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

				if($data['aid'])

				if(isset($data['aid']))

				{
$data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject']));
$data['announcement'] = get_announcement_link($data['aid']);

				{
$data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject']));
$data['announcement'] = get_announcement_link($data['aid']);

Zeile 4895Zeile 4897
		eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";");
}


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


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





	$modnotes = '';
$modnotes_cache = $cache->read("modnotes");
if($modnotes_cache !== false)
{
$modnotes = htmlspecialchars_uni($modnotes_cache['modmessage']);
}


$plugins->run_hooks("modcp_end");



$plugins->run_hooks("modcp_end");