Vergleich modcp.php - 1.8.0 - 1.8.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 21Zeile 21
$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread,modcp_nobanned,modcp_modqueue_thread_link";
$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,modcp_announcements_forum_nomod,modcp_announcements_announcement";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,modcp_editprofile_away,modcp_awaitingattachments,modcp_modqueue_attachment_link,modcp_latestfivemodactions,modcp_nav_banning";

$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread,modcp_nobanned,modcp_modqueue_thread_link";
$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,modcp_announcements_forum_nomod,modcp_announcements_announcement";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,modcp_editprofile_away,modcp_awaitingattachments,modcp_modqueue_attachment_link,modcp_latestfivemodactions,modcp_nav_banning";

$templatelist .= ",postbit_online,postbit_avatar,postbit_find,postbit_pm,postbit_email,postbit_author_user,announcement_edit,announcement_quickdelete,postbit,preview,postmodcp_nav_announcements,modcp_nav_reportcenter,modcp_nav_modlogs";

$templatelist .= ",postbit_groupimage,postbit_userstar,postbit_online,postbit_offline,postbit_away,postbit_avatar,postbit_find,postbit_pm,postbit_email,postbit_www,postbit_author_user,announcement_edit,announcement_quickdelete,postbit,preview,postmodcp_nav_announcements,modcp_nav_reportcenter,modcp_nav_modlogs";

$templatelist .= ",modcp_awaitingmoderation_none,modcp_banning_edit,modcp_banuser_bangroups_group,modcp_banuser_lift,modcp_modlogs_result_announcement,modcp_modlogs_result_forum,modcp_modlogs_result_post,modcp_modlogs_result_thread,modcp_modlogs_user";
$templatelist .= ",modcp_nav_warninglogs,modcp_nav_ipsearch,modcp_nav_users,modcp_announcements_day,modcp_announcements_month_start,modcp_announcements_month_end,modcp_announcements_announcement_expired,modcp_announcements_announcement_active";
$templatelist .= ",modcp_modqueue_link_forum,modcp_modqueue_link_thread,usercp_profile_day,usercp_profile_away,modcp_ipsearch_result_regip,modcp_ipsearch_result_lastip,modcp_ipsearch_result_post,modcp_ipsearch_results_information,usercp_profile_profilefields_text";

$templatelist .= ",modcp_awaitingmoderation_none,modcp_banning_edit,modcp_banuser_bangroups_group,modcp_banuser_lift,modcp_modlogs_result_announcement,modcp_modlogs_result_forum,modcp_modlogs_result_post,modcp_modlogs_result_thread,modcp_modlogs_user";
$templatelist .= ",modcp_nav_warninglogs,modcp_nav_ipsearch,modcp_nav_users,modcp_announcements_day,modcp_announcements_month_start,modcp_announcements_month_end,modcp_announcements_announcement_expired,modcp_announcements_announcement_active";
$templatelist .= ",modcp_modqueue_link_forum,modcp_modqueue_link_thread,usercp_profile_day,usercp_profile_away,modcp_ipsearch_result_regip,modcp_ipsearch_result_lastip,modcp_ipsearch_result_post,modcp_ipsearch_results_information,usercp_profile_profilefields_text";

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


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


$errors = '';


$tflist = $flist = $tflist_queue_threads = $flist_queue_threads = $tflist_queue_posts = $flist_queue_posts = $tflist_queue_attach =
$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();
if($mybb->usergroup['issupermod'] != 1)
{
$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id='{$mybb->user['usergroup']}' AND isgroup = '1')");


// SQL for fetching items only related to forums this user moderates
$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{
$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id='{$mybb->user['usergroup']}' AND isgroup = '1')");


	$flist = $flist_queue_threads = $flist_queue_posts = $flist_queue_attach = $flist_reports = $flist_modlog = null;

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

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

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

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

}
else
{
$flist = $tflist = '';

 
}

// Retrieve a list of unviewable forums
$unviewableforums = get_unviewable_forums();
$inactiveforums = get_inactive_forums();

}

// Retrieve a list of unviewable forums
$unviewableforums = get_unviewable_forums();
$inactiveforums = get_inactive_forums();


if($unviewableforums && !is_super_admin($mybb->user['uid']))
{


$unviewablefids1 = $unviewablefids2 = array();

if($unviewableforums)
{

	$flist .= " AND fid NOT IN ({$unviewableforums})";
$tflist .= " AND t.fid NOT IN ({$unviewableforums})";


	$flist .= " AND fid NOT IN ({$unviewableforums})";
$tflist .= " AND t.fid NOT IN ({$unviewableforums})";


	$unviewablefids = explode(',', $unviewableforums);
foreach($unviewablefids as $key => $fid)
{
$unviewablefids[$key] = (int)$fid;
}
unset($fid);

	$unviewablefids1 = explode(',', $unviewableforums);






}

if($inactiveforums)

}

if($inactiveforums)

Zeile 199Zeile 191
	$flist .= " AND fid NOT IN ({$inactiveforums})";
$tflist .= " AND t.fid NOT IN ({$inactiveforums})";


	$flist .= " AND fid NOT IN ({$inactiveforums})";
$tflist .= " AND t.fid NOT IN ({$inactiveforums})";


	$unviewablefids = explode(',', $inactiveforums);
foreach($unviewablefids as &$fid)
{
$fid = (int)$fid;
}
unset($fid);

	$unviewablefids2 = explode(',', $inactiveforums);






}


}


$unviewableforums = $unviewablefids;

$unviewableforums = array_merge($unviewablefids1, $unviewablefids2);


if(!isset($collapsedimg['modcpforums']))
{


if(!isset($collapsedimg['modcpforums']))
{

Zeile 296Zeile 283
	// 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'));


	$mybb->input['reports'] = $mybb->get_input('reports', 2);

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

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

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

Zeile 316Zeile 303
	$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', 1);

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


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

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


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

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

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

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

		error_no_permission();
}


		error_no_permission();
}


Zeile 340Zeile 327
	if(!$perpage)
{
$perpage = 20;

	if(!$perpage)
{
$perpage = 20;

	}


	}


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

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

Zeile 363Zeile 350
		unset($fid);
}


		unset($fid);
}


	$page = $mybb->get_input('page', 1);

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


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


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

Zeile 392Zeile 379
	}

$plugins->run_hooks("modcp_reports_start");

	}

$plugins->run_hooks("modcp_reports_start");





	// Reports
$reports = '';
$query = $db->query("

	// Reports
$reports = '';
$query = $db->query("

Zeile 501Zeile 488
				$postcache[$post['pid']] = $post;
}
}

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

 

$plugins->run_hooks('modcp_reports_intermediate');


// 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 590Zeile 579
if($mybb->input['action'] == "allreports")
{
if($mybb->usergroup['canmanagereportedcontent'] == 0)

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

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 608Zeile 597
	$perpage = $mybb->settings['threadsperpage'];
if($mybb->get_input('page') != "last")
{

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

		$page = $mybb->get_input('page', 1);

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

	}

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

	}

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

Zeile 633Zeile 622

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


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

		$mybb->input['rid'] = $mybb->get_input('rid', 1);

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

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

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

Zeile 680Zeile 669
	$plugins->run_hooks("modcp_allreports_start");

$query = $db->query("

	$plugins->run_hooks("modcp_allreports_start");

$query = $db->query("

		SELECT r.*, u.username, p.username AS postusername, up.uid AS postuid, t.subject AS threadsubject, pr.username AS profileusername

		SELECT r.*, u.username, p.username AS postusername, up.uid AS postuid, t.subject AS threadsubject, prrep.username AS repusername, pr.username AS profileusername

		FROM ".TABLE_PREFIX."reportedcontent r
LEFT JOIN ".TABLE_PREFIX."posts p ON (r.id=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
LEFT JOIN ".TABLE_PREFIX."users pr ON (pr.uid=r.id)

		FROM ".TABLE_PREFIX."reportedcontent r
LEFT JOIN ".TABLE_PREFIX."posts p ON (r.id=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
LEFT JOIN ".TABLE_PREFIX."users pr ON (pr.uid=r.id)

 
		LEFT JOIN ".TABLE_PREFIX."users prrep ON (prrep.uid=r.id2)

		{$wflist_reports}
ORDER BY r.dateline DESC
LIMIT {$start}, {$perpage}

		{$wflist_reports}
ORDER BY r.dateline DESC
LIMIT {$start}, {$perpage}

Zeile 720Zeile 710
			}
else if($report['type'] == 'reputation')
{

			}
else if($report['type'] == 'reputation')
{

				$user = build_profile_link($report['profileusername'], $report['id3']);

				$user = build_profile_link($report['repusername'], $report['id2']);

				$reputation_link = "reputation.php?uid={$report['id3']}#rid{$report['id']}";
$report_data['content'] = $lang->sprintf($lang->report_info_reputation, $reputation_link, $user);
}

				$reputation_link = "reputation.php?uid={$report['id3']}#rid{$report['id']}";
$report_data['content'] = $lang->sprintf($lang->report_info_reputation, $reputation_link, $user);
}

Zeile 728Zeile 718
			// Report reason and comment
$report_data['comment'] = $lang->na;
$report_string = "report_reason_{$report['reason']}";

			// Report reason and comment
$report_data['comment'] = $lang->na;
$report_string = "report_reason_{$report['reason']}";





			$report['reporterlink'] = get_profile_link($report['uid']);
if(!$report['username'])
{

			$report['reporterlink'] = get_profile_link($report['uid']);
if(!$report['username'])
{

Zeile 744Zeile 734
			{
$report_data['comment'] = htmlspecialchars_uni($report['reason']);
}

			{
$report_data['comment'] = htmlspecialchars_uni($report['reason']);
}





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

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





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

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

	}


	}


	$plugins->run_hooks("modcp_allreports_end");

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

	$plugins->run_hooks("modcp_allreports_end");

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

Zeile 773Zeile 763

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



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


	$perpage = $mybb->get_input('perpage', 1);

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

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

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

	}

	}


$where = '';

// Searching for entries by a particular user


$where = '';

// Searching for entries by a particular user

	if($mybb->get_input('uid', 1))

	if($mybb->get_input('uid', MyBB::INPUT_INT))

	{

	{

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

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

	}

// Searching for entries in a specific forum

	}

// Searching for entries in a specific forum

	if($mybb->get_input('fid', 1))

	if($mybb->get_input('fid', MyBB::INPUT_INT))

	{

	{

		$where .= " AND t.fid='".$mybb->get_input('fid', 1)."'";

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

	}

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

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

	}

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

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

	{

	{

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

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

Zeile 812Zeile 802
	}
$order = $mybb->get_input('order');
if($order != "asc")

	}
$order = $mybb->get_input('order');
if($order != "asc")

	{

	{

		$order = "desc";
}


		$order = "desc";
}


Zeile 830Zeile 820
	// 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', 1);

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

	}

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

	}

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





	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;

	}

	}


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


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

	}
else
{

	}
else
{

		$start = 0;
$page = 1;
}

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

		$start = 0;
$page = 1;
}

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

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

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

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

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

Zeile 968Zeile 958
		}

$selected = '';

		}

$selected = '';

		if($mybb->get_input('uid', 1) == $user['uid'])

		if($mybb->get_input('uid', MyBB::INPUT_INT) == $user['uid'])

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

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

Zeile 977Zeile 967
		eval("\$user_options .= \"".$templates->get("modcp_modlogs_user")."\";");
}


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


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

	$forum_select = build_forum_jump("", $mybb->get_input('fid', MyBB::INPUT_INT), 1, '', 0, true, '', "fid");


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

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


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

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

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

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

if(!$announcement)

Zeile 1052Zeile 1042
		error_no_permission();
}


		error_no_permission();
}


	$announcement_fid = $mybb->get_input('fid', 1);
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();
}

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


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


	$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, (int)$mybb->input['starttime_month'], $mybb->get_input('starttime_day', 1), $mybb->get_input('starttime_year', 1));
if(!checkdate((int)$mybb->input['starttime_month'], (int)$mybb->input['starttime_day'], (int)$mybb->input['starttime_year']) || $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));
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;
}


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


	if($mybb->get_input('endtime_type', 1) == 2)

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

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

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

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

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

		}
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, (int)$mybb->input['endtime_month'], $mybb->get_input('endtime_day', 1), $mybb->get_input('endtime_year', 1));
if(!checkdate((int)$mybb->input['endtime_month'], (int)$mybb->input['endtime_day'], (int)$mybb->input['endtime_year']) || $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));
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;

		}


		}


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

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

		}

		}

	}


	}


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

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

	{
$allowhtml = 1;
}

	{
$allowhtml = 1;
}

Zeile 1147Zeile 1137
	{
$allowhtml = 0;
}

	{
$allowhtml = 0;
}

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

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

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

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

	}
if($mybb->get_input('allowsmilies', 1) == 1)
{

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

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

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

	}

	}


$plugins->run_hooks("modcp_do_new_announcement_start");



$plugins->run_hooks("modcp_do_new_announcement_start");


Zeile 1194Zeile 1184

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


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

		}
}
else

		}
}
else

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

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

Zeile 1210Zeile 1200
	}

add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=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', 1);

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

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

	{
error_no_permission();
}

	{
error_no_permission();
}

Zeile 1229Zeile 1219
		else
{
$errors = '';

		else
{
$errors = '';

		}


		}


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

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

Zeile 1240Zeile 1230

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


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

		$startday = $mybb->get_input('starttime_day', 1);

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

		$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']);
$endmonth = $mybb->input['endtime_month'];
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);

		$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']);
$endmonth = $mybb->input['endtime_month'];
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);

		$endday = $mybb->get_input('endtime_day', 1);

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

		$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
}
else

		$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
}
else

	{

	{

		// Note: dates are in GMT timezone
$starttime_time = gmdate("g:i a", TIME_NOW);
$endtime_time = gmdate("g:i a", TIME_NOW);

		// Note: dates are in GMT timezone
$starttime_time = gmdate("g:i a", TIME_NOW);
$endtime_time = gmdate("g:i a", TIME_NOW);

Zeile 1265Zeile 1255
			);

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

	}

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

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

Zeile 1361Zeile 1351
			'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' => (int)$mybb->input['allowhtml'],
'allowmycode' => (int)$mybb->input['allowmycode'],
'allowsmilies' => (int)$mybb->input['allowsmilies'],

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

			'dateline' => TIME_NOW,
'userusername' => $mybb->user['username'],
);

Zeile 1392Zeile 1382
		}

require_once MYBB_ROOT."inc/functions_post.php";

		}

require_once MYBB_ROOT."inc/functions_post.php";

		$postbit = build_postbit($announcementarray, 1);

		$postbit = build_postbit($announcementarray, 3);

		eval("\$preview = \"".$templates->get("previewpost")."\";");
}
else

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


// Get the announcement


// Get the announcement

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

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

	$query = $db->simple_select("announcements", "*", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

// Check that it exists
if(!$announcement)

	$query = $db->simple_select("announcements", "*", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

// Check that it exists
if(!$announcement)

	{

	{

		error($lang->error_invalid_announcement);
}

// Mod has permissions to edit this announcement

		error($lang->error_invalid_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 1443Zeile 1433

$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 1479Zeile 1469
		$mybb->input['starttime_month'] = '01';
}


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


	$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, (int)$mybb->input['starttime_month'], $mybb->get_input('starttime_day', 1), $mybb->get_input('starttime_year', 1));
if(!checkdate((int)$mybb->input['starttime_month'], (int)$mybb->input['starttime_day'], (int)$mybb->input['starttime_year']) || $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));
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;
}


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


	if($mybb->get_input('endtime_type', 1) == "2")

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

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

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

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

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

		}
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, (int)$mybb->input['endtime_month'], $mybb->get_input('endtime_day', 1), $mybb->get_input('endtime_year', 1));
if(!checkdate((int)$mybb->input['endtime_month'], (int)$mybb->input['endtime_day'], (int)$mybb->input['endtime_year']) || $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));
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', 1) == 1)

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

	{
$allowhtml = 1;
}

	{
$allowhtml = 1;
}

Zeile 1516Zeile 1506
	{
$allowhtml = 0;
}

	{
$allowhtml = 0;
}

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

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

	{
$allowmycode = 1;
}

	{
$allowmycode = 1;
}

Zeile 1524Zeile 1514
	{
$allowmycode = 0;
}

	{
$allowmycode = 0;
}

	if($mybb->get_input('allowsmilies', 1) == 1)

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

	{
$allowsmilies = 1;
}

	{
$allowsmilies = 1;
}

Zeile 1578Zeile 1568
		error_no_permission();
}


		error_no_permission();
}


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

	$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 1640Zeile 1630

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


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

		$startday = $mybb->get_input('starttime_day', 1);

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

		$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']);
$endmonth = $mybb->input['endtime_month'];
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);

		$starttime_time = htmlspecialchars_uni($mybb->input['starttime_time']);
$endmonth = $mybb->input['endtime_month'];
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);

		$endday = $mybb->get_input('endtime_day', 1);

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

		$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);

$errored = true;

		$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);

$errored = true;

Zeile 1740Zeile 1730
	}

$end_type_sel = array('infinite' => '', 'finite' => '');

	}

$end_type_sel = array('infinite' => '', 'finite' => '');

	if(($errored && $mybb->get_input('endtime_type', 1) == 2) || (!$errored && (int)$announcement['enddate'] == 0) || $makeshift_end == true)

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

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

Zeile 1761Zeile 1751
			'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' => (int)$mybb->input['allowhtml'],
'allowmycode' => (int)$mybb->input['allowmycode'],
'allowsmilies' => (int)$mybb->input['allowsmilies'],

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

			'dateline' => TIME_NOW,
'userusername' => $mybb->user['username'],
);

Zeile 1845Zeile 1835
				if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
{
eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";");

				if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
{
eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";");

				}
else

				}
else

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

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





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

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

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

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

			}
}

			}
}

		else
{
// No global announcements
eval("\$announcements_global = \"".$templates->get("modcp_no_announcements_global")."\";");
}
eval("\$announcements_global = \"".$templates->get("modcp_announcements_global")."\";");

		else
{
// No global announcements
eval("\$announcements_global = \"".$templates->get("modcp_no_announcements_global")."\";");
}
eval("\$announcements_global = \"".$templates->get("modcp_announcements_global")."\";");

	}


	}


	$announcements_forum = '';
fetch_forum_announcements();

	$announcements_forum = '';
fetch_forum_announcements();





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

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

	}

$plugins->run_hooks("modcp_announcements");

	}

$plugins->run_hooks("modcp_announcements");


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


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

Zeile 1893Zeile 1883

$plugins->run_hooks("modcp_do_modqueue_start");



$plugins->run_hooks("modcp_do_modqueue_start");


	$mybb->input['threads'] = $mybb->get_input('threads', 2);
$mybb->input['posts'] = $mybb->get_input('posts', 2);
$mybb->input['attachments'] = $mybb->get_input('attachments', 2);

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

	if(!empty($mybb->input['threads']))
{
$threads = array_map("intval", array_keys($mybb->input['threads']));

	if(!empty($mybb->input['threads']))
{
$threads = array_map("intval", array_keys($mybb->input['threads']));

Zeile 1916Zeile 1906
			else if($action == "delete")
{
$threads_to_delete[] = $thread['tid'];

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

			}
}

			}
}

		if(!empty($threads_to_approve))
{
$moderation->approve_threads($threads_to_approve);

		if(!empty($threads_to_approve))
{
$moderation->approve_threads($threads_to_approve);

Zeile 2056Zeile 2046
		// 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', 1);

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

		}

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

		}

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

Zeile 2118Zeile 2108
			else
{
$profile_link = build_profile_link($thread['username'], $thread['uid']);

			else
{
$profile_link = build_profile_link($thread['username'], $thread['uid']);

			}


			}


			$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));
eval("\$forum = \"".$templates->get("modcp_modqueue_link_forum")."\";");
eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");

			$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));
eval("\$forum = \"".$templates->get("modcp_modqueue_link_forum")."\";");
eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");

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

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





			$plugins->run_hooks("modcp_modqueue_threads_end");

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

			$plugins->run_hooks("modcp_modqueue_threads_end");

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

			}

			}


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


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

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

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

		}

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


		}

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


		$query = $db->query("
SELECT COUNT(pid) AS unapprovedposts
FROM ".TABLE_PREFIX."posts p

		$query = $db->query("
SELECT COUNT(pid) AS unapprovedposts
FROM ".TABLE_PREFIX."posts p

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

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





		// 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', 1);
}

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

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

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










		}


		}


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










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

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

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

		{
$page = 1;
}

		{
$page = 1;
}

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

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

		}
else

		}
else

		{
$start = 0;
$page = 1;

		{
$start = 0;
$page = 1;

Zeile 2229Zeile 2219
				if($post['postusername'] != "")
{
$profile_link = $post['postusername'];

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

				}

				}

				else
{
$profile_link = $lang->guest;

				else
{
$profile_link = $lang->guest;

Zeile 2254Zeile 2244
		if($posts)
{
add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&amp;type=posts");

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





			$plugins->run_hooks("modcp_modqueue_posts_end");

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

			$plugins->run_hooks("modcp_modqueue_posts_end");

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

Zeile 2299Zeile 2289
		// 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', 1);

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

		}

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

		}

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

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

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

		}
}


		}
}


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

$plugins->run_hooks("modcp_modqueue_end");

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

$plugins->run_hooks("modcp_modqueue_end");





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

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

Zeile 2427Zeile 2417

$plugins->run_hooks("modcp_do_editprofile_start");



$plugins->run_hooks("modcp_do_editprofile_start");


	if($mybb->get_input('away', 1) == 1 && $mybb->settings['allowaway'] != 0)

	if($mybb->get_input('away', MyBB::INPUT_INT) == 1 && $mybb->settings['allowaway'] != 0)

	{
$awaydate = TIME_NOW;
if(!empty($mybb->input['awayday']))
{
// If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year

	{
$awaydate = TIME_NOW;
if(!empty($mybb->input['awayday']))
{
// If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year

			if(!$mybb->get_input('awaymonth', 1))

			if(!$mybb->get_input('awaymonth', MyBB::INPUT_INT))

			{
$mybb->input['awaymonth'] = my_date('n', $awaydate);
}

			{
$mybb->input['awaymonth'] = my_date('n', $awaydate);
}

			if(!$mybb->get_input('awayyear', 1))

			if(!$mybb->get_input('awayyear', MyBB::INPUT_INT))

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

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

Zeile 2455Zeile 2445
			}

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

			}

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

		}
else
{

		}
else
{

			$returndate = "";
}
$away = array(

			$returndate = "";
}
$away = array(

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

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





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

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

		"profile_fields" => $mybb->get_input('profile_fields', 2),

		"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY),

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

Zeile 2498Zeile 2488
	);

$updated_user['birthday'] = array(

	);

$updated_user['birthday'] = array(

		"day" => $mybb->get_input('birthday_day', 1),
"month" => $mybb->get_input('birthday_month', 1),
"year" => $mybb->get_input('birthday_year', 1)

		"day" => $mybb->get_input('birthday_day', MyBB::INPUT_INT),
"month" => $mybb->get_input('birthday_month', MyBB::INPUT_INT),
"year" => $mybb->get_input('birthday_year', MyBB::INPUT_INT)

	);

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

	);

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

Zeile 2526Zeile 2516
	{
$errors = $userhandler->get_friendly_errors();
$mybb->input['action'] = "editprofile";

	{
$errors = $userhandler->get_friendly_errors();
$mybb->input['action'] = "editprofile";

	}
else
{

	}
else
{

		// Are we removing an avatar from this user?
if(!empty($mybb->input['remove_avatar']))
{

		// Are we removing an avatar from this user?
if(!empty($mybb->input['remove_avatar']))
{

Zeile 2568Zeile 2558
		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'], 1);

			$mybb->input[$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 2660Zeile 2650
if($mybb->input['action'] == "editprofile")
{
if($mybb->usergroup['caneditprofiles'] == 0)

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

	{
error_no_permission();
}

	{
error_no_permission();
}


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



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


	$user = get_user($mybb->get_input('uid', 1));

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

	if(!$user)
{
error($lang->error_nomember);

	if(!$user)
{
error($lang->error_nomember);

Zeile 2724Zeile 2714

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


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

		$defaulttitle = $display_group['usertitle'];

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

	}
else
{

	}
else
{

Zeile 2741Zeile 2731
	}

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

	}

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

	



	if(empty($user['usertitle']))
{
$lang->current_custom_usertitle = '';

	if(empty($user['usertitle']))
{
$lang->current_custom_usertitle = '';

Zeile 2785Zeile 2775
			$returndate = array();
$returndate[0] = $mybb->get_input('awayday');
$returndate[1] = $mybb->get_input('awaymonth');

			$returndate = array();
$returndate[0] = $mybb->get_input('awayday');
$returndate[1] = $mybb->get_input('awaymonth');

			$returndate[2] = $mybb->get_input('awayyear', 1);

			$returndate[2] = $mybb->get_input('awayyear', MyBB::INPUT_INT);

			$user['awayreason'] = htmlspecialchars_uni($mybb->get_input('awayreason'));
}
else

			$user['awayreason'] = htmlspecialchars_uni($mybb->get_input('awayreason'));
}
else

Zeile 2845Zeile 2835

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


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

	$mybb->input['profile_fields'] = $mybb->get_input('profile_fields', 2);

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


$pfcache = $cache->read('profilefields');



$pfcache = $cache->read('profilefields');


Zeile 2853Zeile 2843
	{
foreach($pfcache as $profilefield)
{

	{
foreach($pfcache as $profilefield)
{

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

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

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

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

			$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);
$thing = explode("\n", $profilefield['type'], "2");
$type = $thing[0];
if(isset($thing[1]))
{
$options = $thing[1];

			$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);
$thing = explode("\n", $profilefield['type'], "2");
$type = $thing[0];
if(isset($thing[1]))
{
$options = $thing[1];

			}
else
{
$options = '';

 
			}
$field = "fid{$profilefield['fid']}";

			}
$field = "fid{$profilefield['fid']}";

			$select = '';

 
			if($errors)
{
if(isset($mybb->input['profile_fields'][$field]))
{
$userfield = $mybb->input['profile_fields'][$field];

			if($errors)
{
if(isset($mybb->input['profile_fields'][$field]))
{
$userfield = $mybb->input['profile_fields'][$field];

				}
else
{
$userfield = '';
}

				}





			}
else

			}
else

			{

			{

				$userfield = $user_fields[$field];
}

				$userfield = $user_fields[$field];
}

			$code = '';

 
			if($type == "multiselect")
{
if($errors)

			if($type == "multiselect")
{
if($errors)

				{

				{

					$useropts = $userfield;

					$useropts = $userfield;

				}

				}

				else

				else

				{

				{

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

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

				{

				{

					foreach($useropts as $key => $val)
{
$seloptions[$val] = $val;

					foreach($useropts as $key => $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 2910Zeile 2892

$sel = "";
if($val == $seloptions[$val])


$sel = "";
if($val == $seloptions[$val])

						{

						{

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

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

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

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

					}

					}

					if(!$profilefield['length'])
{
$profilefield['length'] = 3;

					if(!$profilefield['length'])
{
$profilefield['length'] = 3;

					}

					}


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


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

Zeile 2944Zeile 2926
					if(!$profilefield['length'])
{
$profilefield['length'] = 1;

					if(!$profilefield['length'])
{
$profilefield['length'] = 1;

					}

					}


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


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

Zeile 2963Zeile 2945
						}

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

						}

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

					}
}

					}
}

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

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

				{

				{

					$useropts = $userfield;
}
else

					$useropts = $userfield;
}
else

Zeile 2984Zeile 2966
					}
}
$expoptions = explode("\n", $options);

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

				if(is_array($expoptions))

				if(is_array($expoptions))

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

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

Zeile 3024Zeile 3006
				eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
$altbg = alt_trow();

				eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
$altbg = alt_trow();

			$code = "";
$select = "";
$val = "";
$options = "";
$expoptions = "";
$useropts = "";
$seloptions = "";

 
		}
}
if($customfields)

		}
}
if($customfields)

Zeile 3044Zeile 3019
	$codebuttons = build_mycode_inserter("signature");

// Do we mark the suspend signature box?

	$codebuttons = build_mycode_inserter("signature");

// Do we mark the suspend signature box?

	if($user['suspendsignature'] || ($mybb->get_input('suspendsignature', 1) && !empty($errors)))

	if($user['suspendsignature'] || ($mybb->get_input('suspendsignature', MyBB::INPUT_INT) && !empty($errors)))

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

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

Zeile 3056Zeile 3031
	}

// Do we mark the moderate posts box?

	}

// Do we mark the moderate posts box?

	if($user['moderateposts'] || ($mybb->get_input('moderateposting', 1) && !empty($errors)))

	if($user['moderateposts'] || ($mybb->get_input('moderateposting', MyBB::INPUT_INT) && !empty($errors)))

	{
$modpost_check = 1;
$modpost_checked = "checked=\"checked\"";

	{
$modpost_check = 1;
$modpost_checked = "checked=\"checked\"";

Zeile 3068Zeile 3043
	}

// Do we mark the suspend posts box?

	}

// Do we mark the suspend posts box?

	if($user['suspendposting'] || ($mybb->get_input('suspendposting', 1) && !empty($errors)))

	if($user['suspendposting'] || ($mybb->get_input('suspendposting', MyBB::INPUT_INT) && !empty($errors)))

	{
$suspost_check = 1;
$suspost_checked = "checked=\"checked\"";

	{
$suspost_check = 1;
$suspost_checked = "checked=\"checked\"";

	}
else

	}
else

	{
$suspost_check = 0;
$suspost_checked = '';

	{
$suspost_check = 0;
$suspost_checked = '';

Zeile 3115Zeile 3090
	$action_options = $modpost_options = $suspost_options = '';
foreach($moderator_options as $option)
{

	$action_options = $modpost_options = $suspost_options = '';
foreach($moderator_options as $option)
{

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

		$mybb->input[$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 3201Zeile 3176

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', 1);

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

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

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

Zeile 3210Zeile 3185

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


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

		$where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->get_input('username')))."%'";











		switch($db->type)
{
case 'mysql':
case 'mysqli':
$field = 'username';
break;
default:
$field = 'LOWER(username)';
break;
}
$where = " AND {$field} LIKE '%".my_strtolower($db->escape_string_like($mybb->get_input('username')))."%'";

	}

// Sort order & direction

	}

// Sort order & direction

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

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

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

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

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

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

Zeile 3310Zeile 3295
			$lastdate = my_date('relative', $user['lastvisit']);
}


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


		$usergroup = $usergroups_cache[$user['usergroup']]['title'];

		$usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);

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


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


Zeile 3337Zeile 3322

// Filter options
$where_sql = '';


// Filter options
$where_sql = '';

	$mybb->input['filter'] = $mybb->get_input('filter', 2);
$mybb->input['search'] = $mybb->get_input('search', 2);

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

	if(!empty($mybb->input['filter']['username']))
{
$search_user = get_user_by_username($mybb->input['filter']['username']);

	if(!empty($mybb->input['filter']['username']))
{
$search_user = get_user_by_username($mybb->input['filter']['username']);

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

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

	$page = $mybb->get_input('page', 1);

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

	if($page <= 0)
{
$page = 1;

	if($page <= 0)
{
$page = 1;

Zeile 3607Zeile 3592

if($user_ip_sql)
{


if($user_ip_sql)
{

				$query = $db->query("
SELECT COUNT(uid) AS count
FROM ".TABLE_PREFIX."users
WHERE {$user_ip_sql}
");


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






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

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

			}
}


			}
}


		$total_results = $post_results+$user_results;

if(!$total_results)
{
$total_results = 1;

		$total_results = $post_results+$user_results;

if(!$total_results)
{
$total_results = 1;

		}


		}


		// Now we have the result counts, paginate

		// Now we have the result counts, paginate

		$perpage = $mybb->get_input('perpage', 1);

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

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

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

		}


		}


		// 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', 1);

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

		}

$pages = $total_results / $perpage;

		}

$pages = $total_results / $perpage;

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

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

		}


		}


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

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

Zeile 3664Zeile 3645
		foreach(array('ipaddress', 'search_users', 'search_posts') as $input)
{
if(!empty($mybb->input[$input]))

		foreach(array('ipaddress', 'search_users', 'search_posts') as $input)
{
if(!empty($mybb->input[$input]))

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

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

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

$post_limit = $perpage;
$results = '';
if(isset($mybb->input['search_users']) && $user_results && $start <= $user_results)
{

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

$post_limit = $perpage;
$results = '';
if(isset($mybb->input['search_users']) && $user_results && $start <= $user_results)
{

			$query = $db->query("
SELECT username, uid, regip, lastip
FROM ".TABLE_PREFIX."users
WHERE {$user_ip_sql}
ORDER BY regdate DESC
LIMIT {$start}, {$perpage}
");

			$query = $db->simple_select('users', 'username, uid, regip, lastip', $user_ip_sql,
array('order_by' => 'regdate', 'order_dir' => 'DESC', 'limit_start' => $start, 'limit' => $perpage));






			while($ipaddress = $db->fetch_array($query))
{
$result = false;

			while($ipaddress = $db->fetch_array($query))
{
$result = false;

Zeile 3688Zeile 3665
				$trow = alt_trow();
$ip = false;
if(is_array($ip_range))

				$trow = alt_trow();
$ip = false;
if(is_array($ip_range))

				{
if(strcmp($ip_range[0], $ipaddress['regip']) >= 0 && strcmp($ip_range[1], $ipaddress['regip']) <= 0)

				{
if(strcmp($ip_range[0], $ipaddress['regip']) <= 0 && strcmp($ip_range[1], $ipaddress['regip']) >= 0)

					{
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_regip")."\";");
$ip = my_inet_ntop($db->unescape_binary($ipaddress['regip']));
}

					{
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_regip")."\";");
$ip = my_inet_ntop($db->unescape_binary($ipaddress['regip']));
}

					elseif(strcmp($ip_range[0], $ipaddress['lastip']) >= 0 && strcmp($ip_range[1], $ipaddress['lastip']) <= 0)

					elseif(strcmp($ip_range[0], $ipaddress['lastip']) <= 0 && strcmp($ip_range[1], $ipaddress['lastip']) >= 0)

					{
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_lastip")."\";");
$ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));

					{
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_lastip")."\";");
$ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));

Zeile 3728Zeile 3705
			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();

			$query = $db->query("
SELECT username AS postusername, uid, subject, pid, tid, ipaddress
FROM ".TABLE_PREFIX."posts
WHERE {$post_ip_sql} AND visible >= -1
ORDER BY dateline DESC
LIMIT {$post_start}, {$post_limit}
");

			
$query = $db->simple_select('posts', 'username AS postusername, uid, subject, pid, tid, ipaddress', "$post_ip_sql AND visible >= -1",
array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit_start' => $post_start, 'limit' => $post_limit));





			while($ipaddress = $db->fetch_array($query))
{
$tids[$ipaddress['tid']] = $ipaddress['pid'];
$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;

			while($ipaddress = $db->fetch_array($query))
{
$tids[$ipaddress['tid']] = $ipaddress['pid'];
$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;

			}

			}


if(!empty($ipaddresses))
{


if(!empty($ipaddresses))
{

Zeile 3758Zeile 3732

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


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

				{

				{

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

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

Zeile 3784Zeile 3758
		}

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

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

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

	{
$page = $mybb->get_input('page', 1);
}


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


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


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


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

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

			$banned['reason'] = my_wordwrap($banned['reason']);

 
		}
else
{

		}
else
{

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

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

	}


	}


	$plugins->run_hooks("modcp_banning");

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

	$plugins->run_hooks("modcp_banning");

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

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

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

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

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

	{

	{

		error_no_permission();
}

		error_no_permission();
}


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


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

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

if(!$ban)

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

if(!$ban)

	{

	{

		error($lang->error_invalidban);
}


		error($lang->error_invalidban);
}


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

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





	$plugins->run_hooks("modcp_liftban_end");

	$plugins->run_hooks("modcp_liftban_end");





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

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

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

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

{
// Verify incoming POST request
verify_post_check($mybb->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 4064Zeile 4037
	}

// Editing an existing ban

	}

// Editing an existing ban

	if($mybb->get_input('uid', 1))

	if($mybb->get_input('uid', MyBB::INPUT_INT))

	{
// Get the users info from their uid
$query = $db->query("

	{
// Get the users info from their uid
$query = $db->query("

Zeile 4074Zeile 4047
			WHERE b.uid='{$mybb->input['uid']}'
");
$user = $db->fetch_array($query);

			WHERE b.uid='{$mybb->input['uid']}'
");
$user = $db->fetch_array($query);





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

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

Zeile 4083Zeile 4056

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


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

		{

		{

			error_no_permission();
}
}

			error_no_permission();
}
}

Zeile 4107Zeile 4080
	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 4123Zeile 4096

// Check banned group
$usergroups_cache = $cache->read('usergroups');


// Check banned group
$usergroups_cache = $cache->read('usergroups');

	$usergroup = $usergroups_cache[$mybb->get_input('usergroup', 1)];
$query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".$mybb->get_input('usergroup', 1)."'");

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


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


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

	{

	{

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


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


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

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

		{

		{

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

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

Zeile 4158Zeile 4131
				$user['dateline'] = 0;
}
$lifted = ban_date2timestamp($mybb->get_input('liftafter'), $user['dateline']);

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

		}

$banreason = my_substr($mybb->get_input('banreason'), 0, 255);


		}

$banreason = my_substr($mybb->get_input('banreason'), 0, 255);


		if($existing_ban)
{
$update_array = array(

		if($existing_ban)
{
$update_array = array(

				'gid' => $mybb->get_input('usergroup', 1),
'admin' => (int)$user['uid'],
'dateline' => TIME_NOW,
'bantime' => $db->escape_string($mybb->get_input('liftafter')),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($banreason)
);

				'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
'dateline' => TIME_NOW,
'bantime' => $db->escape_string($mybb->get_input('liftafter')),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($banreason)
);



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


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

Zeile 4179Zeile 4151
		{
$insert_array = array(
'uid' => $user['uid'],

		{
$insert_array = array(
'uid' => $user['uid'],

				'gid' => $mybb->get_input('usergroup', 1),

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

				'oldgroup' => (int)$user['usergroup'],
'oldadditionalgroups' => (string)$user['additionalgroups'],
'olddisplaygroup' => (int)$user['displaygroup'],

				'oldgroup' => (int)$user['usergroup'],
'oldadditionalgroups' => (string)$user['additionalgroups'],
'olddisplaygroup' => (int)$user['displaygroup'],

Zeile 4189Zeile 4161
				'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($banreason)
);

				'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($banreason)
);





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

// Move the user to the banned group
$update_array = array(

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

// Move the user to the banned group
$update_array = array(

			'usergroup' => $mybb->get_input('usergroup', 1),

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

			'displaygroup' => 0,
'additionalgroups' => '',

			'displaygroup' => 0,
'additionalgroups' => '',

		);

		);

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

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





		$cache->update_banned();

// Log edit or add ban
if($existing_ban)
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);

		$cache->update_banned();

// Log edit or add ban
if($existing_ban)
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);

		}

		}

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

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

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

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

	}

$mybb->input['uid'] = $mybb->get_input('uid', 1);
if($mybb->input['uid'])

	}

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

	{
add_breadcrumb($lang->mcp_nav_ban_user);
}

	{
add_breadcrumb($lang->mcp_nav_ban_user);
}

Zeile 4266Zeile 4238
		");
$banned = $db->fetch_array($query);
if($banned['username'])

		");
$banned = $db->fetch_array($query);
if($banned['username'])

		{

		{

			$username = htmlspecialchars_uni($banned['username']);
$banreason = htmlspecialchars_uni($banned['reason']);
$uid = $mybb->input['uid'];

			$username = htmlspecialchars_uni($banned['username']);
$banreason = htmlspecialchars_uni($banned['reason']);
$uid = $mybb->input['uid'];

Zeile 4274Zeile 4246
			$lang->ban_user = $lang->edit_ban; // Swap over lang variables
eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
}

			$lang->ban_user = $lang->edit_ban; // Swap over lang variables
eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");
}

 
	}

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

	}

// New ban!
if(!$banuser_username)

	}

// New ban!
if(!$banuser_username)

	{

	{

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

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

Zeile 4289Zeile 4267
			$username = htmlspecialchars_uni($mybb->get_input('username'));
}
eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";");

			$username = htmlspecialchars_uni($mybb->get_input('username'));
}
eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";");

	}


	}


	// Coming back to this page from an error?
if($errors)
{

	// Coming back to this page from an error?
if($errors)
{

Zeile 4298Zeile 4276
		$banned = array(
"bantime" => $mybb->get_input('liftafter'),
"reason" => $mybb->get_input('reason'),

		$banned = array(
"bantime" => $mybb->get_input('liftafter'),
"reason" => $mybb->get_input('reason'),

			"gid" => $mybb->get_input('gid', 1)

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

		);
$banreason = htmlspecialchars_uni($mybb->get_input('banreason'));
}

		);
$banreason = htmlspecialchars_uni($mybb->get_input('banreason'));
}

Zeile 4309Zeile 4287
	{
$selected = '';
if(isset($banned['bantime']) && $banned['bantime'] == $time)

	{
$selected = '';
if(isset($banned['bantime']) && $banned['bantime'] == $time)

		{

		{

			$selected = " selected=\"selected\"";
}

			$selected = " selected=\"selected\"";
}





		$thattime = '';

		$thattime = '';

		if($time != '---' && !isset($banned['dateline']))

		if($time != '---')

		{

		{

			$thatime = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time, $banned['dateline']));







			$dateline = TIME_NOW;
if(isset($banned['dateline']))
{
$dateline = $banned['dateline'];
}

$thatime = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time, $dateline));

			$thattime = " ({$thatime})";
}


			$thattime = " ({$thatime})";
}


Zeile 4324Zeile 4308
	}

$bangroup_option = $bangroups = '';

	}

$bangroup_option = $bangroups = '';

	$numgroups = 0;

	$numgroups = $banned_group = 0;

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

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

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

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

Zeile 4339Zeile 4323

$group['title'] = htmlspecialchars_uni($group['title']);
eval("\$bangroup_option .= \"".$templates->get("modcp_banuser_bangroups_group")."\";");


$group['title'] = htmlspecialchars_uni($group['title']);
eval("\$bangroup_option .= \"".$templates->get("modcp_banuser_bangroups_group")."\";");

 
			$banned_group = $group['gid'];

			++$numgroups;
}
}


			++$numgroups;
}
}


	if($numgroups > 1)





	if($numgroups == 0)
{
error($lang->no_banned_group);
}
elseif($numgroups > 1)

	{
eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups")."\";");
}

	{
eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups")."\";");
}

Zeile 4352Zeile 4341
		eval("\$bangroups = \"".$templates->get("modcp_banuser_bangroups_hidden")."\";");
}


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


	if(!empty($user['uid']))

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

	{
eval("\$lift_link = \"".$templates->get("modcp_banuser_lift")."\";");

	{
eval("\$lift_link = \"".$templates->get("modcp_banuser_lift")."\";");

		$uid = $user['uid'];

		$uid = $banned['uid'];

	}
else
{

	}
else
{

Zeile 4541Zeile 4530
			ORDER BY l.dateline DESC
LIMIT 5
");

			ORDER BY l.dateline DESC
LIMIT 5
");





		$modlogresults = '';
while($logitem = $db->fetch_array($query))
{

		$modlogresults = '';
while($logitem = $db->fetch_array($query))
{

Zeile 4558Zeile 4547
				$logitem['tsubject'] = htmlspecialchars_uni($logitem['tsubject']);
$logitem['thread'] = get_thread_link($logitem['tid']);
eval("\$information .= \"".$templates->get("modcp_modlogs_result_thread")."\";");

				$logitem['tsubject'] = htmlspecialchars_uni($logitem['tsubject']);
$logitem['thread'] = get_thread_link($logitem['tid']);
eval("\$information .= \"".$templates->get("modcp_modlogs_result_thread")."\";");

			}

			}

			if($logitem['fname'])
{
$logitem['forum'] = get_forum_link($logitem['fid']);

			if($logitem['fname'])
{
$logitem['forum'] = get_forum_link($logitem['fid']);

Zeile 4599Zeile 4588
	}

$query = $db->query("

	}

$query = $db->query("

		SELECT b.*, a.username AS adminuser, u.username, (b.lifted-".TIME_NOW.") AS remaining

		SELECT b.*, a.username AS adminuser, u.username

		FROM ".TABLE_PREFIX."banned b
LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users a ON (b.admin=a.uid)
WHERE b.bantime != '---' AND b.bantime != 'perm'

		FROM ".TABLE_PREFIX."banned b
LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users a ON (b.admin=a.uid)
WHERE b.bantime != '---' AND b.bantime != 'perm'

		ORDER BY remaining ASC

		ORDER BY lifted ASC

		LIMIT 5
");

		LIMIT 5
");

 

$banned_cache = array();
while($banned = $db->fetch_array($query))
{
$banned['remaining'] = $banned['lifted']-TIME_NOW;
$banned_cache[$banned['remaining'].$banned['uid']] = $banned;

unset($banned);
}


// Get the banned users
$bannedusers = '';


// Get the banned users
$bannedusers = '';

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

	foreach($banned_cache as $banned)

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


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


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

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

			$banned['reason'] = my_wordwrap($banned['reason']);

 
		}
else
{

		}
else
{