Vergleich modcp.php - 1.6.12 - 1.6.16

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19
$templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements,modcp_editprofile_select_option,modcp_editprofile_select,modcp_finduser_noresults";
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special,modcp_warninglogs_warning_revoked,modcp_warninglogs_warning,modcp_ipsearch_result";
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields,modcp_ipsearch_noresults,modcp_ipsearch_results,modcp_ipsearch_misc_info";

$templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements,modcp_editprofile_select_option,modcp_editprofile_select,modcp_finduser_noresults";
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special,modcp_warninglogs_warning_revoked,modcp_warninglogs_warning,modcp_ipsearch_result";
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields,modcp_ipsearch_noresults,modcp_ipsearch_results,modcp_ipsearch_misc_info";

$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread";

$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs,modcp_banuser_editusername,modcp_lastattachment,modcp_lastpost,modcp_lastthread,modcp_nobanned";

$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,modcp_announcements_forum_nomod,modcp_announcements_announcement,multipage_prevpage";
$templatelist .= ",multipage_start,multipage_page_current,multipage_page,multipage_end,multipage_nextpage,multipage";


$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,modcp_announcements_forum_nomod,modcp_announcements_announcement,multipage_prevpage";
$templatelist .= ",multipage_start,multipage_page_current,multipage_page,multipage_end,multipage_nextpage,multipage";


Zeile 40Zeile 40
if($mybb->user['uid'] == 0 || $mybb->usergroup['canmodcp'] != 1)
{
error_no_permission();

if($mybb->user['uid'] == 0 || $mybb->usergroup['canmodcp'] != 1)
{
error_no_permission();

 
}

if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{
$mybb->settings['threadsperpage'] = 20;
}

if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)
{
$mybb->settings['postsperpage'] = 20;

}

$errors = '';

}

$errors = '';

Zeile 68Zeile 78
else
{
$flist = $tflist = '';

else
{
$flist = $tflist = '';

}

}


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


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

Zeile 95Zeile 105
add_breadcrumb($lang->nav_modcp, "modcp.php");

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

add_breadcrumb($lang->nav_modcp, "modcp.php");

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

{

{

	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


Zeile 112Zeile 122
		$rids = "'0','{$rids}'";

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

		$rids = "'0','{$rids}'";

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

	}


	}


	$plugins->run_hooks("modcp_do_reports");

$db->update_query("reportedposts", array('reportstatus' => 1), "{$sql}{$flist}");

	$plugins->run_hooks("modcp_do_reports");

$db->update_query("reportedposts", array('reportstatus' => 1), "{$sql}{$flist}");

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

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

	}

	}


// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];


// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];

Zeile 144Zeile 154
	$report_count = $db->fetch_field($query, "count");

$mybb->input['rid'] = intval($mybb->input['rid']);

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

$mybb->input['rid'] = intval($mybb->input['rid']);


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


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

		{
$page = $result / $perpage;
}

		{
$page = $result / $perpage;
}

Zeile 163Zeile 173
	$pages = ceil($pages);

if($mybb->input['page'] == "last")

	$pages = ceil($pages);

if($mybb->input['page'] == "last")

	{

	{

		$page = $pages;

		$page = $pages;

	}

	}


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


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

	{
$page = 1;
}

	{
$page = 1;
}


if($page && $page > 0)
{


if($page && $page > 0)
{

Zeile 198Zeile 208
	$plugins->run_hooks("modcp_reports_start");

$reports = '';

	$plugins->run_hooks("modcp_reports_start");

$reports = '';

	$query = $db->query("
SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."reportedposts r
LEFT JOIN ".TABLE_PREFIX."posts p ON (r.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)

	$query = $db->query("
SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."reportedposts r
LEFT JOIN ".TABLE_PREFIX."posts p ON (r.pid=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)
WHERE r.reportstatus='0'
ORDER BY r.dateline DESC

		LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
WHERE r.reportstatus='0'
ORDER BY r.dateline DESC

Zeile 226Zeile 236

$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);


$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);

 


			$report['posterlink'] = get_profile_link($report['postuid']);

			$report['posterlink'] = get_profile_link($report['postuid']);

 
			if(!$report['postuid'])
{
$report['posterlink'] = $report['postlink'];
$report['postusername'] = $lang->guest;
}


			$report['reporterlink'] = get_profile_link($report['uid']);

			$report['reporterlink'] = get_profile_link($report['uid']);

 
			if($report['uid'] > 0 && !$report['username'])
{
$report['reporterlink'] = $report['postlink'];
$report['username'] = $lang->na_deleted;
}


			$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));

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

			$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));

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

	}

$plugins->run_hooks("modcp_reports_end");


	}

$plugins->run_hooks("modcp_reports_end");


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

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

Zeile 253Zeile 276

// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];


// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];

	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);
}


	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);
}


	$query = $db->simple_select("reportedposts", "COUNT(rid) AS count");
$warnings = $db->fetch_field($query, "count");


	$query = $db->simple_select("reportedposts", "COUNT(rid) AS count");
$warnings = $db->fetch_field($query, "count");


Zeile 335Zeile 358
			$report['posterlink'] = get_profile_link($report['postuid']);
$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['postusername'] = build_profile_link($report['postusername'], $report['postuid']);

			$report['posterlink'] = get_profile_link($report['postuid']);
$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['postusername'] = build_profile_link($report['postusername'], $report['postuid']);

 


			$report['reporterlink'] = get_profile_link($report['uid']);

			$report['reporterlink'] = get_profile_link($report['uid']);

 
			if($report['uid'] > 0 && !$report['username'])
{
$report['reporterlink'] = $report['postlink'];
$report['username'] = $lang->na_deleted;
}


$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);


$reportdate = my_date($mybb->settings['dateformat'], $report['dateline']);
$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);

Zeile 417Zeile 446

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


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

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)

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

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

Zeile 428Zeile 457
	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

	if($mybb->input['page'] != "last")
{
$page = intval($mybb->input['page']);

	}

	}


$postcount = intval($rescount);
$pages = $postcount / $perpage;


$postcount = intval($rescount);
$pages = $postcount / $perpage;

Zeile 440Zeile 469
	}

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

	}

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

	{

	{

		$page = 1;
}


		$page = 1;
}


Zeile 452Zeile 481
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}

	}


$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&amp;perpage=$perpage&amp;uid={$mybb->input['uid']}&amp;fid={$mybb->input['fid']}&amp;sortby={$mybb->input['sortby']}&amp;order={$mybb->input['order']}");
if($postcount > $perpage)


$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&amp;perpage=$perpage&amp;uid={$mybb->input['uid']}&amp;fid={$mybb->input['fid']}&amp;sortby={$mybb->input['sortby']}&amp;order={$mybb->input['order']}");
if($postcount > $perpage)

Zeile 460Zeile 489
		eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
}
$query = $db->query("

		eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
}
$query = $db->query("

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)

 
		WHERE 1=1 {$where}{$tflist}

		WHERE 1=1 {$where}{$tflist}

		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");
while($logitem = $db->fetch_array($query))
{
$information = '';
$logitem['action'] = htmlspecialchars_uni($logitem['action']);
$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);

		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");
while($logitem = $db->fetch_array($query))
{
$information = '';
$logitem['action'] = htmlspecialchars_uni($logitem['action']);
$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);

		$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])

		$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])

		{
$information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";
}

		{
$information = "<strong>{$lang->thread}:</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";
}

		if($logitem['fname'])

		if($logitem['fname'])

		{

		{

			$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />";

			$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />";

		}
if($logitem['psubject'])
{
$information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>";
}

// Edited a user?
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])

		}

// Edited a user or managed announcement?
if(!$logitem['tsubject'] || !$logitem['fname'])





		{
$data = unserialize($logitem['data']);
if($data['uid'])

		{
$data = unserialize($logitem['data']);
if($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'])
{
$information = "<strong>{$lang->announcement}:</strong> <a href=\"".get_announcement_link($data['aid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['subject'])."</a>";
}
}


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

if(!$results)

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

if(!$results)

	{

	{

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


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


Zeile 533Zeile 561
		if($mybb->input['uid'] == $user['uid'])
{
$selected = " selected=\"selected\"";

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

		}

		}

		$user_options .= "<option value=\"{$user['uid']}\"{$selected}>".htmlspecialchars_uni($user['username'])."</option>\n";
}


		$user_options .= "<option value=\"{$user['uid']}\"{$selected}>".htmlspecialchars_uni($user['username'])."</option>\n";
}


Zeile 547Zeile 575
{
verify_post_check($mybb->input['my_post_key']);


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


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

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

$plugins->run_hooks("modcp_do_delete_announcement");


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

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

$plugins->run_hooks("modcp_do_delete_announcement");


	$db->delete_query("announcements", "aid='{$aid}'");

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

	$cache->update_forumsdisplay();

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

}


}


if($mybb->input['action'] == "delete_announcement")
{
$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");

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

if($mybb->input['action'] == "delete_announcement")
{
$aid = intval($mybb->input['aid']);
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");

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

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

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


if(!$announcement['aid'])
{


if(!$announcement['aid'])
{

Zeile 587Zeile 616
	}

$plugins->run_hooks("modcp_delete_announcement");

	}

$plugins->run_hooks("modcp_delete_announcement");





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

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

Zeile 688Zeile 717
			'allowmycode' => $db->escape_string($mybb->input['allowmycode']),
'allowsmilies' => $db->escape_string($mybb->input['allowsmilies']),
);

			'allowmycode' => $db->escape_string($mybb->input['allowmycode']),
'allowsmilies' => $db->escape_string($mybb->input['allowsmilies']),
);



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

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

 

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


$plugins->run_hooks("modcp_do_new_announcement_end");



$plugins->run_hooks("modcp_do_new_announcement_end");


Zeile 907Zeile 937
		if($startdate[0] >= 24)
{
$startdate[0] = "00";

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

		}
}


		}
}


	if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];

	if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];

Zeile 969Zeile 999
		);

$db->update_query("announcements", $update_announcement, "aid='{$aid}'");

		);

$db->update_query("announcements", $update_announcement, "aid='{$aid}'");

 

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


$plugins->run_hooks("modcp_do_edit_announcement_end");

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


$plugins->run_hooks("modcp_do_edit_announcement_end");

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

	}

	}

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

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





if($mybb->input['action'] == "edit_announcement")
{
$announcement_fid = intval($mybb->input['fid']);

if($mybb->input['action'] == "edit_announcement")
{
$announcement_fid = intval($mybb->input['fid']);

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

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





	if(!$announcement['fid'])

	if(!$announcement['fid'])

	{

	{

		error($lang->error_invalid_announcement);
}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))

		error($lang->error_invalid_announcement);
}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 1016Zeile 1048
		if($announcement['startdate'])
{
$makeshift_time = $announcement['startdate'];

		if($announcement['startdate'])
{
$makeshift_time = $announcement['startdate'];

		}


		}


		// No end date? Make it a year from now.
$announcement['enddate'] = $makeshift_time + (60 * 60 * 24 * 366);
}

		// No end date? Make it a year from now.
$announcement['enddate'] = $makeshift_time + (60 * 60 * 24 * 366);
}

Zeile 1231Zeile 1263
	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 1340Zeile 1372
if($mybb->input['action'] == "modqueue")
{
if($mybb->input['type'] == "threads" || !$mybb->input['type'])

if($mybb->input['action'] == "modqueue")
{
if($mybb->input['type'] == "threads" || !$mybb->input['type'])

	{

	{

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

$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible=0 {$flist}");

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

$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible=0 {$flist}");

Zeile 1379Zeile 1411
		$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");

$query = $db->query("

		$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");

$query = $db->query("

			SELECT t.tid, t.dateline, t.fid, t.subject, p.message AS postmessage, u.username AS username, t.uid

			SELECT t.tid, t.dateline, t.fid, t.subject, t.username AS threadusername, p.message AS postmessage, u.username AS username, t.uid

			FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=t.firstpost)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

			FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=t.firstpost)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

Zeile 1396Zeile 1428
			$forum_name = $forum_cache[$thread['fid']]['name'];
$threaddate = my_date($mybb->settings['dateformat'], $thread['dateline']);
$threadtime = my_date($mybb->settings['timeformat'], $thread['dateline']);

			$forum_name = $forum_cache[$thread['fid']]['name'];
$threaddate = my_date($mybb->settings['dateformat'], $thread['dateline']);
$threadtime = my_date($mybb->settings['timeformat'], $thread['dateline']);

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


















if($thread['username'] == "")
{
if($thread['threadusername'] != "")
{
$profile_link = $thread['threadusername'];
}
else
{
$profile_link = $lang->guest;
}
}
else
{
$profile_link = build_profile_link($thread['username'], $thread['uid']);
}


			$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));
$forum = "<strong>{$lang->meta_forum} <a href=\"{$thread['forumlink']}\">{$forum_name}</a></strong>";
eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");
}

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

			$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage']));
$forum = "<strong>{$lang->meta_forum} <a href=\"{$thread['forumlink']}\">{$forum_name}</a></strong>";
eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");
}

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

		{

		{

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

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

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

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





			$plugins->run_hooks("modcp_modqueue_threads_end");

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

			$plugins->run_hooks("modcp_modqueue_threads_end");

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

Zeile 1423Zeile 1471
	if($mybb->input['type'] == "posts" || (!$mybb->input['type'] && !$threadqueue))
{
$forum_cache = $cache->read("forums");

	if($mybb->input['type'] == "posts" || (!$mybb->input['type'] && !$threadqueue))
{
$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 1440Zeile 1488

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


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

		$pages = ceil($pages);

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

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

		$pages = ceil($pages);

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

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


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


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

		{

		{

			$start = 0;
$page = 1;
}

			$start = 0;
$page = 1;
}

Zeile 1465Zeile 1513
		$multipage = multipage($unapproved_posts, $perpage, $page, "modcp.php?action=modqueue&amp;type=posts");

$query = $db->query("

		$multipage = multipage($unapproved_posts, $perpage, $page, "modcp.php?action=modqueue&amp;type=posts");

$query = $db->query("

			SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline

			SELECT p.pid, p.subject, p.message, p.username AS postusername, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline

			FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

			FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

Zeile 1483Zeile 1531
			$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);

			$forum_name = $forum_cache[$post['fid']]['name'];
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);

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


















if($post['username'] == "")
{
if($post['postusername'] != "")
{
$profile_link = $post['postusername'];
}
else
{
$profile_link = $lang->guest;
}
}
else
{
$profile_link = build_profile_link($post['username'], $post['uid']);
}


			$thread = "<strong>{$lang->meta_thread} <a href=\"{$post['threadlink']}\">{$post['threadsubject']}</a></strong>";
$forum = "<strong>{$lang->meta_forum} <a href=\"{$post['forumlink']}\">{$forum_name}</a></strong><br />";
$post['message'] = nl2br(htmlspecialchars_uni($post['message']));

			$thread = "<strong>{$lang->meta_thread} <a href=\"{$post['threadlink']}\">{$post['threadsubject']}</a></strong>";
$forum = "<strong>{$lang->meta_forum} <a href=\"{$post['forumlink']}\">{$forum_name}</a></strong><br />";
$post['message'] = nl2br(htmlspecialchars_uni($post['message']));

Zeile 1504Zeile 1568
			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$postqueue = \"".$templates->get("modcp_modqueue_posts")."\";");
output_page($postqueue);

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

		}
}


		}
}


	if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue))
{
$query = $db->query("

	if($mybb->input['type'] == "attachments" || (!$mybb->input['type'] && !$postqueue && !$threadqueue))
{
$query = $db->query("

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

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

		error($lang->invalid_user);

		error($lang->error_nomember);

	}

// Check if the current user has permission to edit this user

	}

// Check if the current user has permission to edit this user

Zeile 1668Zeile 1732
	if($mybb->input['remove_avatar'])
{
$updated_user['avatarurl'] = '';

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

	}

	}


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

Zeile 1774Zeile 1838
						{
$extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length;
}

						{
$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
if($extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])

			}
}

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

		{

		{

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


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


Zeile 1812Zeile 1876

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


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

	{
error($lang->invalid_user);
}


	{
error($lang->error_nomember);
}


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

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

	}


	}


	if($user['website'] == "" || $user['website'] == "http://")

	if($user['website'] == "" || $user['website'] == "http://")

	{

	{

		$user['website'] = "http://";
}

if($user['icq'] != "0")

		$user['website'] = "http://";
}

if($user['icq'] != "0")

	{

	{

		$user['icq'] = intval($user['icq']);

		$user['icq'] = intval($user['icq']);

	}

	}

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

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

	}

	}


if(!$errors)
{
$mybb->input = array_merge($user, $mybb->input);
list($mybb->input['birthday_day'], $mybb->input['birthday_month'], $mybb->input['birthday_year']) = explode("-", $user['birthday']);


if(!$errors)
{
$mybb->input = array_merge($user, $mybb->input);
list($mybb->input['birthday_day'], $mybb->input['birthday_month'], $mybb->input['birthday_year']) = explode("-", $user['birthday']);

	}

	}

	else
{
$errors = inline_error($errors);

	else
{
$errors = inline_error($errors);

Zeile 1860Zeile 1924

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


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





	if(!empty($display_group['usertitle']))
{
$defaulttitle = $display_group['usertitle'];
}
else

	if(!empty($display_group['usertitle']))
{
$defaulttitle = $display_group['usertitle'];
}
else

	{

	{

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


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


Zeile 1880Zeile 1944
	}

if(empty($user['usertitle']))

	}

if(empty($user['usertitle']))

	{
$lang->current_custom_usertitle = '';
}

	{
$lang->current_custom_usertitle = '';
}


$bdaysel = '';
for($i = 1; $i <= 31; ++$i)


$bdaysel = '';
for($i = 1; $i <= 31; ++$i)

Zeile 1890Zeile 1954
		if($mybb->input['birthday_day'] == $i)
{
$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		if($mybb->input['birthday_day'] == $i)
{
$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		}
else

		}
else

		{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
}

		{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
}

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

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

		}

		}

		else

		else

		{

		{

			$userfield = $user_fields[$field];
}
if($type == "multiselect")

			$userfield = $user_fields[$field];
}
if($type == "multiselect")

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

		{
if($errors)
{
$useropts = $userfield;
}
else
{
$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);
$val = str_replace("\n", "\\n", $val);


			{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);


					$sel = "";

					$sel = "";

					if($val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

					if($val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

				}
if(!$profilefield['length'])

				}
if(!$profilefield['length'])

				{
$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";

				{
$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";

			}
}

			}
}

		elseif($type == "select")
{
$expoptions = explode("\n", $options);

		elseif($type == "select")
{
$expoptions = explode("\n", $options);

Zeile 1987Zeile 2051
			}
}
elseif($type == "radio")

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

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

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

			{
foreach($expoptions as $key => $val)
{
$checked = "";
if($val == $userfield)

			{
foreach($expoptions as $key => $val)
{
$checked = "";
if($val == $userfield)

					{
$checked = " checked=\"checked\"";

					{
$checked = " checked=\"checked\"";

					}
$code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />";
}
}
}
elseif($type == "checkbox")

					}
$code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />";
}
}
}
elseif($type == "checkbox")

		{

		{

			if($errors)
{
$useropts = $userfield;

			if($errors)
{
$useropts = $userfield;

Zeile 2043Zeile 2107
			$value = htmlspecialchars_uni($userfield);
$maxlength = "";
if($profilefield['maxlength'] > 0)

			$value = htmlspecialchars_uni($userfield);
$maxlength = "";
if($profilefield['maxlength'] > 0)

			{

			{

				$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";
}
if($profilefield['required'] == 1)

				$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";
}
if($profilefield['required'] == 1)

		{

		{

			eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
else

			eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
else

Zeile 2068Zeile 2132
	if($customfields)
{
eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");

	if($customfields)
{
eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");

	}

	}


$lang->edit_profile = $lang->sprintf($lang->edit_profile, $user['username']);
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);


$lang->edit_profile = $lang->sprintf($lang->edit_profile, $user['username']);
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);

Zeile 2080Zeile 2144
	{
$checked = 1;
$checked_item = "checked=\"checked\"";

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

	}
else

	}
else

	{
$checked = 0;
}

// Do we mark the moderate posts box?
if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))

	{
$checked = 0;
}

// Do we mark the moderate posts box?
if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))

	{

	{

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

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

	}

	}

	else
{
$modpost_check = 0;

	else
{
$modpost_check = 0;

	}


	}


	// Do we mark the suspend posts box?
if($user['suspendposting'] || ($mybb->input['suspendposting'] && !empty($errors)))
{

	// Do we mark the suspend posts box?
if($user['suspendposting'] || ($mybb->input['suspendposting'] && !empty($errors)))
{

Zeile 2204Zeile 2268
			case "suspendposting":
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";");
break;

			case "suspendposting":
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")."\";");





	$plugins->run_hooks("modcp_editprofile_end");

	$plugins->run_hooks("modcp_editprofile_end");





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

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

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

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

	}

	}

	$where = '';

	$where = '';





	if($mybb->input['username'])
{
$where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->input['username']))."%'";

	if($mybb->input['username'])
{
$where = " AND LOWER(username) LIKE '%".my_strtolower($db->escape_string_like($mybb->input['username']))."%'";

	}


	}


	// Sort order & direction
switch($mybb->input['sortby'])
{

	// Sort order & direction
switch($mybb->input['sortby'])
{

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

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

	}


	}


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

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





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

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

	{
$page = intval($mybb->input['page']);
}


	{
$page = intval($mybb->input['page']);
}


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


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


Zeile 2476Zeile 2540
		if($row['expires'] > 0)
{
$expire_date = my_date($mybb->settings['dateformat'], $row['expires']).' '.my_date($mybb->settings['timeformat'], $row['expires']);

		if($row['expires'] > 0)
{
$expire_date = my_date($mybb->settings['dateformat'], $row['expires']).' '.my_date($mybb->settings['timeformat'], $row['expires']);

		}

		}

		else
{
$expire_date = $lang->never;

		else
{
$expire_date = $lang->never;

Zeile 2488Zeile 2552
		}
$title = htmlspecialchars_uni($title);
if($row['points'] >= 0)

		}
$title = htmlspecialchars_uni($title);
if($row['points'] >= 0)

		{

		{

			$points = '+'.$row['points'];
}

			$points = '+'.$row['points'];
}





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

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

	}


	}


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

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

Zeile 2513Zeile 2577
	if($mybb->input['ipaddress'])
{
if(!is_array($groupscache))

	if($mybb->input['ipaddress'])
{
if(!is_array($groupscache))

		{

		{

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


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


Zeile 2526Zeile 2590
			if(strpos($mybb->input['ipaddress'], ":") !== false)
{
$post_ip_sql = "ipaddress LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";

			if(strpos($mybb->input['ipaddress'], ":") !== false)
{
$post_ip_sql = "ipaddress LIKE '".$db->escape_string(str_replace("*", "%", $mybb->input['ipaddress']))."'";

			}
else
{
$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);


			}
else
{
$ip_range = fetch_longipv4_range($mybb->input['ipaddress']);


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

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

Zeile 2551Zeile 2615
				$query = $db->query("
SELECT COUNT(pid) AS count
FROM ".TABLE_PREFIX."posts

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

					WHERE {$post_ip_sql}

					WHERE {$post_ip_sql} AND visible >= 0

				");

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

				");

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

Zeile 2638Zeile 2702
		{
$start = 0;
$page = 1;

		{
$start = 0;
$page = 1;

		}

		}


$page_url = "modcp.php?action=ipsearch&amp;perpage={$perpage}";
foreach(array('ipaddress', 'search_users', 'search_posts') as $input)


$page_url = "modcp.php?action=ipsearch&amp;perpage={$perpage}";
foreach(array('ipaddress', 'search_users', 'search_posts') as $input)

Zeile 2702Zeile 2766
			$query = $db->query("
SELECT username AS postusername, uid, subject, pid, tid, ipaddress
FROM ".TABLE_PREFIX."posts

			$query = $db->query("
SELECT username AS postusername, uid, subject, pid, tid, ipaddress
FROM ".TABLE_PREFIX."posts

				WHERE {$post_ip_sql}

				WHERE {$post_ip_sql} AND visible >= 0

				ORDER BY dateline DESC
LIMIT {$post_start}, {$post_limit}
");

				ORDER BY dateline DESC
LIMIT {$post_start}, {$post_limit}
");

Zeile 2745Zeile 2809
		}

if(!$results)

		}

if(!$results)

		{

		{

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


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


Zeile 2850Zeile 2914
	if($mybb->input['page'] == "last")
{
$page = $pages;

	if($mybb->input['page'] == "last")
{
$page = $pages;

	}


	}


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

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

	{
$page = 1;
}


	{
$page = 1;
}


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

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

Zeile 2870Zeile 2934

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


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

	{

	{

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


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


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

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

		}
else

		}
else

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

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

Zeile 2923Zeile 2987
			$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining < 3600)

			$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining < 3600)

			{

			{

				$timeremaining = "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>";
}
else if($remaining < 86400)
{
$timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";

				$timeremaining = "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>";
}
else if($remaining < 86400)
{
$timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";

			}

			}

			else if($remaining < 604800)
{
$timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>";

			else if($remaining < 604800)
{
$timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>";

Zeile 2941Zeile 3005
		}

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

		}

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

	}


	}


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

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

Zeile 2955Zeile 3019
}

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

}

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

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


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


	$query = $db->simple_select("banned", "*", "uid='".intval($mybb->input['uid'])."'");
$ban = $db->fetch_array($query);

if(!$ban['uid'])
{
error($lang->error_invalidban);

	$query = $db->simple_select("banned", "*", "uid='".intval($mybb->input['uid'])."'");
$ban = $db->fetch_array($query);

if(!$ban['uid'])
{
error($lang->error_invalidban);

	}


	}


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

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





	$plugins->run_hooks("modcp_liftban_start");

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

	$plugins->run_hooks("modcp_liftban_start");

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

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

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





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

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

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

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

		$user = $db->fetch_array($query);
if(!$user['uid'])

		$user = $db->fetch_array($query);
if(!$user['uid'])

		{
error($lang->error_invalidban);
}

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

		{
error($lang->error_invalidban);
}

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

		{

		{

			error_no_permission();
}
}

			error_no_permission();
}
}

Zeile 3031Zeile 3095
		if(!$user['uid'])
{
$errors[] = $lang->invalid_username;

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

		}
}


		}
}


	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 3065Zeile 3129
		if($db->fetch_field($query, "uid"))
{
$errors[] = $lang->error_useralreadybanned;

		if($db->fetch_field($query, "uid"))
{
$errors[] = $lang->error_useralreadybanned;

		}
}

$plugins->run_hooks("modcp_do_banuser_start");


		}
}

$plugins->run_hooks("modcp_do_banuser_start");


	// Still no errors? Ban the user
if(!$errors)
{

	// Still no errors? Ban the user
if(!$errors)
{

Zeile 3088Zeile 3152
			$username_select = $db->simple_select('users', 'username', "uid='" . (int)$mybb->input['uid'] . "'");
$user['username'] = $db->fetch_field($username_select, 'username');
$update_array = array(

			$username_select = $db->simple_select('users', 'username', "uid='" . (int)$mybb->input['uid'] . "'");
$user['username'] = $db->fetch_field($username_select, 'username');
$update_array = array(

				'gid' => intval($mybb->input['usergroup']),
'admin' => intval($mybb->user['uid']),
'dateline' => TIME_NOW,

				'gid' => intval($mybb->input['usergroup']),
'admin' => intval($mybb->user['uid']),
'dateline' => TIME_NOW,

				'bantime' => $db->escape_string($mybb->input['liftafter']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($mybb->input['banreason'])

				'bantime' => $db->escape_string($mybb->input['liftafter']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($mybb->input['banreason'])

Zeile 3123Zeile 3187
			'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($mybb->input['uid'])
{
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);

		$cache->update_banned();

// Log edit or add ban
if($mybb->input['uid'])
{
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);

		}

$plugins->run_hooks("modcp_do_banuser_end");


		}

$plugins->run_hooks("modcp_do_banuser_end");


		if($mybb->input['uid'])
{
redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);

		if($mybb->input['uid'])
{
redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);

Zeile 3157Zeile 3221
if($mybb->input['action'] == "banuser")
{
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");

if($mybb->input['action'] == "banuser")
{
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");





	if($mybb->input['uid'])
{
add_breadcrumb($lang->mcp_nav_ban_user);

	if($mybb->input['uid'])
{
add_breadcrumb($lang->mcp_nav_ban_user);

Zeile 3177Zeile 3241
			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);
if($banned['username'])
{

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

Zeile 3187Zeile 3251
			$user = get_user($banned['uid']);
$lang->ban_user = $lang->edit_ban; // Swap over lang variables
eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");

			$user = get_user($banned['uid']);
$lang->ban_user = $lang->edit_ban; // Swap over lang variables
eval("\$banuser_username = \"".$templates->get("modcp_banuser_editusername")."\";");

		}
}


		}
}


	// New ban!
if(!$banuser_username)
{

	// New ban!
if(!$banuser_username)
{

Zeile 3222Zeile 3286
	{
$liftlist .= "<option value=\"{$time}\"";
if($banned['bantime'] == $time)

	{
$liftlist .= "<option value=\"{$time}\"";
if($banned['bantime'] == $time)

		{

		{

			$liftlist .= " selected=\"selected\"";

			$liftlist .= " selected=\"selected\"";

		}

		}

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

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

		{

		{

			$liftlist .= ">{$title}</option>\n";

			$liftlist .= ">{$title}</option>\n";

		}
else
{

		}
else
{

			$liftlist .= ">{$title} ({$thatime})</option>\n";
}
}

			$liftlist .= ">{$title} ({$thatime})</option>\n";
}
}

Zeile 3251Zeile 3315
	$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";

$plugins->run_hooks("modcp_banuser_end");

	$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";

$plugins->run_hooks("modcp_banuser_end");





	eval("\$banuser = \"".$templates->get("modcp_banuser")."\";");
output_page($banuser);
}

	eval("\$banuser = \"".$templates->get("modcp_banuser")."\";");
output_page($banuser);
}

Zeile 3284Zeile 3348
		WHERE a.visible='0' {$tflist}
");
$unapproved_attachments = $db->fetch_field($query, "unapprovedattachments");

		WHERE a.visible='0' {$tflist}
");
$unapproved_attachments = $db->fetch_field($query, "unapprovedattachments");





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

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

Zeile 3381Zeile 3445
	}

$query = $db->query("

	}

$query = $db->query("

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject

		SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)

		LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)

 
		{$where}
ORDER BY l.dateline DESC
LIMIT 5

		{$where}
ORDER BY l.dateline DESC
LIMIT 5

Zeile 3403Zeile 3466
		$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])
{

		$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
if($logitem['tsubject'])
{

			$information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";

			$information = "<strong>{$lang->thread}:</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";

		}
if($logitem['fname'])
{
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['fname'])."</a><br />";

		}
if($logitem['fname'])
{
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['fname'])."</a><br />";

		}
if($logitem['psubject'])
{
$information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>";

 
		}


		}


		// Edited a user?
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])

		// Edited a user or managed announcement?
if(!$logitem['tsubject'] || !$logitem['fname'])

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

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

		}





			if($data['aid'])
{
$information = "<strong>{$lang->announcement}:</strong> <a href=\"".get_announcement_link($data['aid'])."\" target=\"_blank\">".htmlspecialchars_uni($data['subject'])."</a>";
}
}


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


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

Zeile 3452Zeile 3515
		if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
{
$edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&amp;uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&amp;uid={$banned['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>";

		if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
{
$edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&amp;uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&amp;uid={$banned['uid']}&amp;my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>";

		}


		}


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

$trow = alt_trow();

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

$trow = alt_trow();

Zeile 3480Zeile 3543
			$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining <= 0)

			$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining <= 0)

			{

			{

				$timeremaining = "<span style=\"color: red;\">({$lang->ban_ending_imminently})</span>";
}
else if($remaining < 3600)

				$timeremaining = "<span style=\"color: red;\">({$lang->ban_ending_imminently})</span>";
}
else if($remaining < 3600)

Zeile 3500Zeile 3563
				$timeremaining = "({$timeremaining} {$lang->ban_remaining})";
}
}

				$timeremaining = "({$timeremaining} {$lang->ban_remaining})";
}
}





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

if(!$bannedusers)
{

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

if(!$bannedusers)
{

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

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

	}

$modnotes = $cache->read("modnotes");

	}

$modnotes = $cache->read("modnotes");