Vergleich modcp.php - 1.4.0 - 1.4.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: modcp.php 4038 2008-07-25 08:50:26Z dennis $

 * $Id: modcp.php 4530 2009-11-22 22:02:58Z RyanGordon $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

 
define('THIS_SCRIPT', 'modcp.php');


$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport";
$templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban";


$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport";
$templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban";

Zeile 19Zeile 20
$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special";
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields";
$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs";

$templatelist .= ",codebuttons,smilieinsert,modcp_announcements_new,modcp_modqueue_empty,forumjump_bit,forumjump_special";
$templatelist .= ",modcp_modlogs,modcp_finduser_user,modcp_finduser,usercp_profile_customfield,usercp_profile_profilefields";
$templatelist .= ",modcp_editprofile,modcp_ipsearch,modcp_banuser_addusername,modcp_banuser,modcp_warninglogs_nologs";

$templatelist .= ",modcp_warninglogs";

$templatelist .= ",modcp_warninglogs,modcp_modlogs_result";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_user.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_user.php";

Zeile 49Zeile 50
	while($forum = $db->fetch_array($query))
{
$flist .= ",'{$forum['fid']}'";

	while($forum = $db->fetch_array($query))
{
$flist .= ",'{$forum['fid']}'";

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

		$moderated_forums[] = $forum['fid'];
}
if($flist)

		$moderated_forums[] = $forum['fid'];
}
if($flist)

Zeile 80Zeile 87
		error($lang->error_noselected_reports);
}


		error($lang->error_noselected_reports);
}


	array_walk($mybb->input['reports'], "intval");

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

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


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


Zeile 112Zeile 119

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



$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)
{
$page = $result / $perpage;
}
else
{
$page = intval($result / $perpage) + 1;
}
}
$postcount = intval($report_count)+1;
$pages = $postcount / $perpage;
$pages = ceil($pages);



	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;
}
else
{
$page = intval($result / $perpage) + 1;
}
}
$postcount = intval($report_count);
$pages = $postcount / $perpage;
$pages = ceil($pages);




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


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

Zeile 135Zeile 144
	}

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

	}

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

	{
$page = 1;

	{
$page = 1;

	}

if($page && $page > 0)

	}

if($page && $page > 0)

Zeile 154Zeile 163
	if($postcount > $perpage)
{
eval("\$reportspages = \"".$templates->get("modcp_reports_multipage")."\";");

	if($postcount > $perpage)
{
eval("\$reportspages = \"".$templates->get("modcp_reports_multipage")."\";");

	}

$query = $db->simple_select("forums", "fid, name");
while($forum = $db->fetch_array($query))
{
$forums[$forum['fid']] = $forum['name'];
}

$reports = '';
$query = $db->query("
SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject

	}

$query = $db->simple_select("forums", "fid, name");
while($forum = $db->fetch_array($query))
{
$forums[$forum['fid']] = $forum['name'];
}

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

		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)

Zeile 189Zeile 198
		$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");

		$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
eval("\$reports .= \"".$templates->get("modcp_reports_report")."\";");

	}

	}

	if(!$reports)
{
eval("\$reports = \"".$templates->get("modcp_reports_noreports")."\";");
}

	if(!$reports)
{
eval("\$reports = \"".$templates->get("modcp_reports_noreports")."\";");
}





	$plugins->run_hooks("modcp_reports");

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

	$plugins->run_hooks("modcp_reports");

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

Zeile 202Zeile 211
}

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

}

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

{
add_breadcrumb($lang->mcp_nav_all_reported_posts, "modcp.php?action=allreports");


{
add_breadcrumb($lang->mcp_nav_all_reported_posts, "modcp.php?action=allreports");


	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'];
if($mybb->input['page'] != "last")

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

Zeile 219Zeile 228

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





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

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

Zeile 234Zeile 243
			$page = intval($result / $perpage) + 1;
}
}

			$page = intval($result / $perpage) + 1;
}
}

	$postcount = intval($warnings)+1;

	$postcount = intval($warnings);

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


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


Zeile 244Zeile 253
	}

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

	}

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

	{
$page = 1;

	{
$page = 1;

	}

if($page)

	}

if($page)

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

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

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

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

	if(!$perpage)

	if(!$perpage || $perpage <= 0)

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

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

Zeile 365Zeile 374
			break;
default:
$sortby = "l.dateline";

			break;
default:
$sortby = "l.dateline";

	}
$order = $mybb->input['order'];
if($order != "asc")
{
$order = "desc";
}

$query = $db->query("

	}
$order = $mybb->input['order'];
if($order != "asc")
{
$order = "desc";
}

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

		SELECT COUNT(l.dateline) AS count
FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)

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

		WHERE 1=1 {$where}
");
$rescount = $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")
{

Zeile 392Zeile 401
	$pages = ceil($pages);

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

	$pages = ceil($pages);

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

	{

	{

		$page = $pages;
}


		$page = $pages;
}


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

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

	}

	}

	else
{
$start = 0;
$page = 1;
}


	else
{
$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;orderby=$mybb->input['sortby']&amp;order={$mybb->input['order']}");

	$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)
{
eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");

	if($postcount > $perpage)
{
eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");

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

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


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


Zeile 481Zeile 490
		$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";
}


	$forum_select = build_forum_jump("", $mybb->input['fid'], 1, '', 0, '', "fid");

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


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


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

Zeile 518Zeile 527
	if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);

	if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);

	}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
{
error_no_permission();
}


	}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))
{
error_no_permission();
}


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

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

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

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

		{

		{

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

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

Zeile 599Zeile 608
		{
$mybb->input['endtime_month'] = 1;
}

		{
$mybb->input['endtime_month'] = 1;
}

		$enddate = gmmktime($enddatehour, intval($mybb->input['endtime_time']), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));

		$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));

		if($enddate < 0 || $enddate == false)
{
$errors[] = $lang->error_invalid_end_date;

		if($enddate < 0 || $enddate == false)
{
$errors[] = $lang->error_invalid_end_date;

Zeile 641Zeile 650
	$announcement_fid = intval($mybb->input['fid']);

if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))

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

if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 649Zeile 658
	if(is_array($errors))
{
$errors = inline_error($errors);

	if(is_array($errors))
{
$errors = inline_error($errors);



		

		// Set $announcement to input stuff

		// Set $announcement to input stuff

		$title = $mybb->input['title'];
$message = $mybb->input['message'];
$startmonth = intval($mybb->input['starttime_month']);
















		$announcement['subject'] = $mybb->input['title'];
$announcement['message'] = $mybb->input['message'];
$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

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

$startmonth = $mybb->input['starttime_month'];

		$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);
$starttime_time = htmlspecialchars($mybb->input['starttime_time']);

		$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);
$starttime_time = htmlspecialchars($mybb->input['starttime_time']);

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

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

		$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = intval($mybb->input['endtime_day']);
$endtime_time = htmlspecialchars($mybb->input['endtime_time']);

		$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = intval($mybb->input['endtime_day']);
$endtime_time = htmlspecialchars($mybb->input['endtime_time']);

	}

	}

	else
{

	else
{

		// Note: dates are not in user's timezone

		// Note: dates are in GMT timezone

		$starttime_time = gmdate("g:i a", TIME_NOW);
$endtime_time = gmdate("g:i a", TIME_NOW);
$startday = $endday = gmdate("j", TIME_NOW);

		$starttime_time = gmdate("g:i a", TIME_NOW);
$endtime_time = gmdate("g:i a", TIME_NOW);
$startday = $endday = gmdate("j", TIME_NOW);

Zeile 672Zeile 696
		$startdateyear = gmdate("Y", TIME_NOW);

$enddateyear = $startdateyear+1;

		$startdateyear = gmdate("Y", TIME_NOW);

$enddateyear = $startdateyear+1;

	}

// Generate form elements
for($i = 1; $i <= 31; ++$i)
{
if($startday == $i)
{
$startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else
{
$startdateday .= "<option value=\"$i\">$i</option>\n";
}

if($endday == $i)
{
$enddateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else
{
$enddateday .= "<option value=\"$i\">$i</option>\n";
}
}

$startmonthsel = $endmonthsel = array();
$startmonthsel[$startmonth] = "selected=\"selected\"";
$endmonthsel[$endmonth] = "selected=\"selected\"";

$startdatemonth .= "<option value=\"01\" {$startmonthsel['01']}>{$lang->january}</option>\n";

	}

// Generate form elements
for($i = 1; $i <= 31; ++$i)
{
if($startday == $i)
{
$startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else
{
$startdateday .= "<option value=\"$i\">$i</option>\n";
}

if($endday == $i)
{
$enddateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else
{
$enddateday .= "<option value=\"$i\">$i</option>\n";
}
}

$startmonthsel = $endmonthsel = array();
$startmonthsel[$startmonth] = "selected=\"selected\"";
$endmonthsel[$endmonth] = "selected=\"selected\"";

$startdatemonth .= "<option value=\"01\" {$startmonthsel['01']}>{$lang->january}</option>\n";

	$enddatemonth .= "<option value=\"01\" {$endmonthsel['01']}>{$lang->january}</option>\n";
$startdatemonth .= "<option value=\"02\" {$startmonthsel['02']}>{$lang->february}</option>\n";
$enddatemonth .= "<option value=\"02\" {$endmonthsel['02']}>{$lang->february}</option>\n";

	$enddatemonth .= "<option value=\"01\" {$endmonthsel['01']}>{$lang->january}</option>\n";
$startdatemonth .= "<option value=\"02\" {$startmonthsel['02']}>{$lang->february}</option>\n";
$enddatemonth .= "<option value=\"02\" {$endmonthsel['02']}>{$lang->february}</option>\n";

Zeile 774Zeile 798
}

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

}

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

{

{

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

// Get the announcement

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

// Get the announcement

Zeile 786Zeile 810
	if(!$announcement['aid'])
{
error($lang->error_invalid_announcement);

	if(!$announcement['aid'])
{
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'])))


// Mod has permissions to edit this announcement
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'])))

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

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

	}

	}


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


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

Zeile 808Zeile 832
	if(!trim($mybb->input['fid']))
{
$errors[] = $lang->error_missing_forum;

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

	}
























	}

$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);
$enddate = @explode(":", $enddate[0]);

if(stristr($mybb->input['starttime_time'], "pm"))
{
$startdate[0] = 12+$startdate[0];
if($startdate[0] >= 24)
{
$startdate[0] = "00";
}
}

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


$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;


$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;

	}

	}


$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));
if($startdate < 0 || $startdate == false)


$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));
if($startdate < 0 || $startdate == false)

Zeile 823Zeile 870
	}

if($mybb->input['endtime_type'] == "2")

	}

if($mybb->input['endtime_type'] == "2")

	{

	{

		$enddate = '0';
}
else

		$enddate = '0';
}
else

Zeile 832Zeile 879
		{
$mybb->input['endtime_month'] = 1;
}

		{
$mybb->input['endtime_month'] = 1;
}

		$enddate = gmmktime($enddatehour, intval($mybb->input['endtime_time']), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));

		$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));

		if($enddate < 0 || $enddate == false)
{
$errors[] = $lang->error_invalid_end_date;

		if($enddate < 0 || $enddate == false)
{
$errors[] = $lang->error_invalid_end_date;

Zeile 873Zeile 920

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





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

if(!$announcement['fid'])

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

if(!$announcement['fid'])

	{

	{

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

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

Zeile 898Zeile 945
		$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

		$announcement['allowhtml'] = $mybb->input['allowhtml'];
$announcement['allowmycode'] = $mybb->input['allowmycode'];
$announcement['allowsmilies'] = $mybb->input['allowsmilies'];

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













		
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

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

$startmonth = $mybb->input['starttime_month'];

		$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);
$starttime_time = htmlspecialchars($mybb->input['starttime_time']);

		$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);
$starttime_time = htmlspecialchars($mybb->input['starttime_time']);

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

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

		$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = intval($mybb->input['endtime_day']);
$endtime_time = htmlspecialchars($mybb->input['endtime_time']);

		$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']);
$endday = intval($mybb->input['endtime_day']);
$endtime_time = htmlspecialchars($mybb->input['endtime_time']);

Zeile 911Zeile 970
	}
else
{

	}
else
{

		// Note: dates are in user's timezone
$starttime_time = my_date('g:i a', $announcement['startdate']);
$endtime_time = my_date('g:i a', $announcement['enddate']);

		// Note: dates are in GMT timezone
$starttime_time = gmdate('g:i a', $announcement['startdate']);
$endtime_time = gmdate('g:i a', $announcement['enddate']);





		$startday = my_date('j', $announcement['startdate']);
$endday = my_date('j', $announcement['enddate']);

		$startday = gmdate('j', $announcement['startdate']);
$endday = gmdate('j', $announcement['enddate']);





		$startmonth = my_date('m', $announcement['startdate']);
$endmonth = my_date('m', $announcement['enddate']);

		$startmonth = gmdate('m', $announcement['startdate']);
$endmonth = gmdate('m', $announcement['enddate']);





		$startdateyear = my_date('Y', $announcement['startdate']);
$enddateyear = my_date('Y', $announcement['enddate']);

		$startdateyear = gmdate('Y', $announcement['startdate']);
$enddateyear = gmdate('Y', $announcement['enddate']);


$errored = false;
}


$errored = false;
}

Zeile 1116Zeile 1175
		{
$moderation->approve_threads($threads_to_approve);
}

		{
$moderation->approve_threads($threads_to_approve);
}

 
		log_moderator_action(array('tids' => $threads_to_approve), $lang->multi_approve_threads);

		redirect("modcp.php?action=modqueue", $lang->redirect_threadsmoderated);
}
else if(is_array($mybb->input['posts']))

		redirect("modcp.php?action=modqueue", $lang->redirect_threadsmoderated);
}
else if(is_array($mybb->input['posts']))

Zeile 1138Zeile 1198
		{
$moderation->approve_posts($posts_to_approve);
}

		{
$moderation->approve_posts($posts_to_approve);
}

 
		log_moderator_action(array('pids' => $posts_to_approve), $lang->multi_approve_posts);

		redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated);
}
else if(is_array($mybb->input['attachments']))
{

		redirect("modcp.php?action=modqueue&type=posts", $lang->redirect_postsmoderated);
}
else if(is_array($mybb->input['attachments']))
{

		$query = $db->simple_select("attachments", "aid, pid", "aid IN (".implode(",", array_map("intval", array_keys($mybb->input['attachments'])))."){$flist}");







		$query = $db->query("
SELECT a.pid, a.aid
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE aid IN (".implode(",", array_map("intval", array_keys($mybb->input['attachments'])))."){$tflist}
");

		while($attachment = $db->fetch_array($query))
{
$action = $mybb->input['attachments'][$attachment['aid']];
if($action == "approve")

		while($attachment = $db->fetch_array($query))
{
$action = $mybb->input['attachments'][$attachment['aid']];
if($action == "approve")

			{

			{

				$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");
}
else if($action == "delete")

				$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");
}
else if($action == "delete")

Zeile 1162Zeile 1229
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");

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


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


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





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

		}

		}


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


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

		$pages = ceil($pages);

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

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

if($page)

		$pages = ceil($pages);

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

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

if($page)

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

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

Zeile 1198Zeile 1265
			$page = 1;
}


			$page = 1;
}


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

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


$query = $db->query("
SELECT t.tid, t.dateline, t.fid, t.subject, p.message AS postmessage, u.username AS username, t.uid


$query = $db->query("
SELECT t.tid, t.dateline, t.fid, t.subject, p.message AS postmessage, u.username AS username, t.uid

Zeile 1259Zeile 1326

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

		$pages = ceil($pages);

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


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


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

Zeile 1281Zeile 1348
			$page = 1;
}


			$page = 1;
}


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

		$multipage = multipage($pages, $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


$query = $db->query("
SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, u.username, p.uid, t.fid, p.dateline

Zeile 1315Zeile 1382
		}

if($posts)

		}

if($posts)

		{

		{

			add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&amp;type=posts");
eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$postqueue = \"".$templates->get("modcp_modqueue_posts")."\";");
output_page($postqueue);
}
}

			add_breadcrumb($lang->mcp_nav_modqueue_posts, "modcp.php?action=modqueue&amp;type=posts");
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 1341Zeile 1408
		}

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

		}

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

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

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

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

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

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

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

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

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

		}
else
{

		}
else
{

Zeile 1364Zeile 1431
			$page = 1;
}


			$page = 1;
}


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

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


$query = $db->query("
SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject


$query = $db->query("
SELECT a.*, p.subject AS postsubject, p.dateline, p.uid, u.username, t.tid, t.subject AS threadsubject

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

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


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

// Check if the current user has permission to edit this user
$user_permissions = user_permissions($user['uid']);

// Current user is only a local moderator, cannot edit super mods or admins
if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['canadmincp'] == 1))


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

// Check if the current user has permission to edit this user
$user_permissions = user_permissions($user['uid']);

// Current user is only a local moderator, cannot edit super mods or admins
if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['cancp'] == 1))

	{
error_no_permission();
}
// Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins

	{
error_no_permission();
}
// Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins

	else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['canadmincp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))
{

	else if(!modcp_can_manage_user($user['uid']))
{

		error_no_permission();
}
// Otherwise, free to edit

		error_no_permission();
}
// Otherwise, free to edit

Zeile 1464Zeile 1531
		"yahoo" => $mybb->input['yahoo'],
"msn" => $mybb->input['msn'],
"signature" => $mybb->input['signature'],

		"yahoo" => $mybb->input['yahoo'],
"msn" => $mybb->input['msn'],
"signature" => $mybb->input['signature'],

	);

	);


$updated_user['birthday'] = array(
"day" => $mybb->input['birthday_day'],


$updated_user['birthday'] = array(
"day" => $mybb->input['birthday_day'],

Zeile 1479Zeile 1546
	else if($mybb->input['reverttitle'])
{
$updated_user['usertitle'] = '';

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

	}

	}


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


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





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

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

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

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

	{

	{

		error($lang->invalid_user);
}


		error($lang->invalid_user);
}


Zeile 1527Zeile 1594
	$user_permissions = user_permissions($user['uid']);

// Current user is only a local moderator, cannot edit super mods or admins

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

// Current user is only a local moderator, cannot edit super mods or admins

	if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['canadmincp'] == 1))
{
error_no_permission();

	if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['cancp'] == 1))
{
error_no_permission();

	}
// Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins

	}
// Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins

	else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['canadmincp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))

	else if(!modcp_can_manage_user($user['uid']))

	{
error_no_permission();

	{
error_no_permission();

	}

	}

	// Otherwise, free to edit

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

	// Otherwise, free to edit

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

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

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

	}

	}


if(!$errors)
{


if(!$errors)
{

Zeile 1560Zeile 1627
	else
{
$errors = inline_error($errors);

	else
{
$errors = inline_error($errors);

	}


	}


	// Sanitize all input
foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'msn', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)
{

	// Sanitize all input
foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'msn', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)
{

Zeile 1638Zeile 1705
				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 1650Zeile 1717

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


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

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

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

					$select .= "<option value=\"$val\"$sel>$val</option>\n";
}
if(!$profilefield['length'])

					$select .= "<option value=\"$val\"$sel>$val</option>\n";
}
if(!$profilefield['length'])

Zeile 1677Zeile 1744
						$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>";

						$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>";

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

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

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

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

Zeile 1704Zeile 1771
		elseif($type == "checkbox")
{
if($errors)

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

			{

			{

				$useropts = $userfield;
}
else

				$useropts = $userfield;
}
else

Zeile 1736Zeile 1803
		{
$value = htmlspecialchars_uni($userfield);
$code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>";

		{
$value = htmlspecialchars_uni($userfield);
$code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>";

		}
else
{

		}
else
{

			$value = htmlspecialchars_uni($userfield);

			$value = htmlspecialchars_uni($userfield);

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






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

		}
if($profilefield['required'] == 1)
{

Zeile 1774Zeile 1846

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


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

	if(!$perpage)


	$perpage = intval($mybb->input['perpage']);
if(!$perpage || $perpage <= 0)

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

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

Zeile 1843Zeile 1916
		if($mybb->input[$field])
{
$page_url .= "&amp;{$field}=".htmlspecialchars_uni($mybb->input[$field]);

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

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

		}
}


		}
}


Zeile 1859Zeile 1933
		$user['postnum'] = my_number_format($user['postnum']);
$regdate = my_date($mybb->settings['dateformat'], $user['regdate']);
$regtime = my_date($mybb->settings['timeformat'], $user['regdate']);

		$user['postnum'] = my_number_format($user['postnum']);
$regdate = my_date($mybb->settings['dateformat'], $user['regdate']);
$regtime = my_date($mybb->settings['timeformat'], $user['regdate']);

		$lastdate = my_date($mybb->settings['dateformat'], $user['lastactive']);
$lasttime = my_date($mybb->settings['timeformat'], $user['lastactive']);

		$lastdate = my_date($mybb->settings['dateformat'], $user['lastvisit']);
$lasttime = my_date($mybb->settings['timeformat'], $user['lastvisit']);

		$usergroup = $usergroups_cache[$user['usergroup']]['title'];
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");
}

		$usergroup = $usergroups_cache[$user['usergroup']]['title'];
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");
}

Zeile 1886Zeile 1960
		$search['username'] = $db->escape_string($mybb->input['filter']['username']);
$query = $db->simple_select("users", "uid", "username='{$search['username']}'");
$mybb->input['filter']['uid'] = $db->fetch_field($query, "uid");

		$search['username'] = $db->escape_string($mybb->input['filter']['username']);
$query = $db->simple_select("users", "uid", "username='{$search['username']}'");
$mybb->input['filter']['uid'] = $db->fetch_field($query, "uid");

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

	}
if($mybb->input['filter']['uid'])
{

	}
if($mybb->input['filter']['uid'])
{

Zeile 1894Zeile 1969
		if(!isset($mybb->input['search']['username']))
{
$user = get_user($mybb->input['search']['uid']);

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

			$mybb->input['search']['username'] = $user['username'];

			$mybb->input['search']['username'] = htmlspecialchars_uni($user['username']);

		}
}
if($mybb->input['filter']['mod_username'])

		}
}
if($mybb->input['filter']['mod_username'])

Zeile 1902Zeile 1977
		$search['mod_username'] = $db->escape_string($mybb->input['filter']['mod_username']);
$query = $db->simple_select("users", "uid", "username='{$search['mod_username']}'");
$mybb->input['filter']['mod_uid'] = $db->fetch_field($query, "uid");

		$search['mod_username'] = $db->escape_string($mybb->input['filter']['mod_username']);
$query = $db->simple_select("users", "uid", "username='{$search['mod_username']}'");
$mybb->input['filter']['mod_uid'] = $db->fetch_field($query, "uid");

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

	}
if($mybb->input['filter']['mod_uid'])
{

	}
if($mybb->input['filter']['mod_uid'])
{

Zeile 1910Zeile 1986
		if(!isset($mybb->input['search']['mod_username']))
{
$mod_user = get_user($mybb->input['search']['uid']);

		if(!isset($mybb->input['search']['mod_username']))
{
$mod_user = get_user($mybb->input['search']['uid']);

			$mybb->input['search']['mod_username'] = $mod_user['username'];

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

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

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

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

	}
$sortbysel = array();
switch($mybb->input['filter']['sortby'])

	}
$sortbysel = array();
switch($mybb->input['filter']['sortby'])

Zeile 2121Zeile 2198

// Now we have the result counts, paginate
$perpage = intval($mybb->input['perpage']);


// Now we have the result counts, paginate
$perpage = intval($mybb->input['perpage']);

		if(!$perpage)

		if(!$perpage || $perpage <= 0)

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

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

Zeile 2155Zeile 2232
			$page = 1;
}


			$page = 1;
}


		$page_url = "modcp.php?action=ipsearch&amp;perpage={$perpage}&amp;ipaddress={$mybb->input['ipaddress']}";

		$page_url = "modcp.php?action=ipsearch&amp;perpage={$perpage}";

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

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

Zeile 2206Zeile 2283
		if($total_results > $user_results && $post_limit)
{
$post_start = $start-$user_results;

		if($total_results > $user_results && $post_limit)
{
$post_start = $start-$user_results;

			if($post_start < 0) $post_start = 0;




			if($post_start < 0)
{
$post_start = 0;
}

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

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

 
			$ipaddresses = $tids = $uids = array();

			$query = $db->query("

			$query = $db->query("

				SELECT p.username AS postusername, p.uid, u.username, p.subject, p.pid, p.tid, p.ipaddress, t.subject AS threadsubject
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON(p.uid=u.uid)

				SELECT username AS postusername, uid, subject, pid, tid, ipaddress
FROM ".TABLE_PREFIX."posts



				WHERE {$post_ip_sql}

				WHERE {$post_ip_sql}

				ORDER BY p.dateline DESC

				ORDER BY dateline DESC

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

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

				$ip = $ipaddress['ipaddress'];
if(!$ipaddress['username']) $ipaddress['username'] = $ipaddress['postusername']; // Guest username support
$trow = alt_trow();
if(!$ipaddress['subject'])






				$tids[$ipaddress['tid']] = $ipaddress['pid'];
$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;
}

if(!empty($ipaddresses))
{
$query = $db->simple_select("threads", "subject, tid", "tid IN(".implode(',', array_keys($tids)).")");
while($thread = $db->fetch_array($query))

				{

				{

					$ipaddress['subject'] = "RE: {$ipaddress['threadsubject']}";






















					$ipaddresses[$tids[$thread['tid']]]['threadsubject'] = $thread['subject'];
}
unset($tids);

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

foreach($ipaddresses as $ipaddress)
{
$ip = $ipaddress['ipaddress'];
if(!$ipaddress['username']) $ipaddress['username'] = $ipaddress['postusername']; // Guest username support
$trow = alt_trow();
if(!$ipaddress['subject'])
{
$ipaddress['subject'] = "RE: {$ipaddress['threadsubject']}";
}
$subject = "<strong>{$lang->ipresult_post}</strong> <a href=\"".get_post_link($ipaddress['pid'], $ipaddress['tid'])."\">".htmlspecialchars_uni($ipaddress['subject'])."</a> {$lang->by} ".build_profile_link($ipaddress['username'], $ipaddress['uid']);
eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";");

				}

				}

				$subject = "<strong>{$lang->ipresult_post}</strong> <a href=\"".get_post_link($ipaddress['pid'], $ipaddress['tid'])."\">".htmlspecialchars_uni($ipaddress['subject'])."</a> by ".build_profile_link($ipaddress['username'], $ipaddress['uid']);
eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";");

 
			}
}


			}
}


Zeile 2248Zeile 2351
		}

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

		}

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

	}


	}


	// Fetch filter options
if(!$mybb->input['ipaddress'])
{
$mybb->input['search_posts'] = 1;
$mybb->input['search_users'] = 1;

	// Fetch filter options
if(!$mybb->input['ipaddress'])
{
$mybb->input['search_posts'] = 1;
$mybb->input['search_users'] = 1;

	}

	}

	if($mybb->input['search_posts'])

	if($mybb->input['search_posts'])

	{

	{

		$postsearchselect = "checked=\"checked\"";

		$postsearchselect = "checked=\"checked\"";

	}

	}

	if($mybb->input['search_users'])
{
$usersearchselect = "checked=\"checked\"";

	if($mybb->input['search_users'])
{
$usersearchselect = "checked=\"checked\"";

	}


	}


	eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";");
output_page($ipsearch);
}

	eval("\$ipsearch = \"".$templates->get("modcp_ipsearch")."\";");
output_page($ipsearch);
}

Zeile 2288Zeile 2391
	$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");


	$postcount = intval($banned_count)+1;

	$postcount = intval($banned_count);

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

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

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

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

	}


	}


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

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

Zeile 2327Zeile 2430
		ORDER BY lifted ASC
LIMIT {$start}, {$perpage}
");

		ORDER BY lifted ASC
LIMIT {$start}, {$perpage}
");





	// Get the banned users
while($banned = $db->fetch_array($query))
{

	// Get the banned users
while($banned = $db->fetch_array($query))
{

Zeile 2335Zeile 2438

// Only show the edit & lift links if current user created ban, or is super mod/admin
$edit_link = '';


// Only show the edit & lift links if current user created ban, or is super mod/admin
$edit_link = '';

		if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['canadmincp'] == 1)

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

		{
$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>";
}

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

$trow = alt_trow();

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

$trow = alt_trow();





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

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

Zeile 2407Zeile 2510

if(!$ban['uid'])
{


if(!$ban['uid'])
{

		$lang->error_invalidban;

		error($lang->error_invalidban);

	}

// Permission to edit this ban?

	}

// Permission to edit this ban?

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

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

	{
error_no_permission();
}

	{
error_no_permission();
}

Zeile 2452Zeile 2555
		}

// Permission to edit this ban?

		}

// Permission to edit this ban?

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

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

		{
error_no_permission();
}

		{
error_no_permission();
}

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

 
	}
// Creating a new ban
else

	}
// Creating a new ban
else

Zeile 2546Zeile 2647
			);

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

			);

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

		}


		}


		// Move the user to the banned group
$update_array = array(
'usergroup' => intval($mybb->input['usergroup']),

		// Move the user to the banned group
$update_array = array(
'usergroup' => intval($mybb->input['usergroup']),

Zeile 2591Zeile 2692
	if($mybb->input['uid'])
{
$query = $db->query("

	if($mybb->input['uid'])
{
$query = $db->query("

			SELECT b.*, u.username

			SELECT b.*, u.username, u.uid

			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']}'

Zeile 2602Zeile 2703
			$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'];

 
			$user = get_user($banned['uid']);

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

 
	

	// New ban!

	// New ban!

	if(!$banuer_username)

	if(!$banuser_username)

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

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

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

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



	

	$bangroups = '';
$query = $db->simple_select("usergroups", "gid, title", "isbannedgroup=1");
while($item = $db->fetch_array($query))

	$bangroups = '';
$query = $db->simple_select("usergroups", "gid, title", "isbannedgroup=1");
while($item = $db->fetch_array($query))

Zeile 2663Zeile 2766
		}
$bangroups .= "<option value=\"{$item['gid']}\"{$selected}>".htmlspecialchars_uni($item['title'])."</option>\n";
}

		}
$bangroups .= "<option value=\"{$item['gid']}\"{$selected}>".htmlspecialchars_uni($item['title'])."</option>\n";
}

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


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


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

Zeile 2670Zeile 2775

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


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

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


	// Update Moderator Notes cache
$update_cache = array(
"modmessage" => $mybb->input['modnotes']

	// Update Moderator Notes cache
$update_cache = array(
"modmessage" => $mybb->input['modnotes']

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

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

			SELECT t.tid, p.pid, t.uid, t.username, a.filename, a.dateuploaded

			SELECT t.tid, p.pid, p.uid, t.username, a.filename, a.dateuploaded

			FROM  ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			FROM  ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

Zeile 2726Zeile 2834
	if($unapproved_posts > 0)
{
$query = $db->query("

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

			SELECT p.pid, p.tid, p.subject, p.uid, p.username

			SELECT p.pid, p.tid, p.subject, p.uid, p.username, p.dateline

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

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

Zeile 2741Zeile 2849
		$post['subject'] = $post['fullsubject'] = $parser->parse_badwords($post['subject']);
if(my_strlen($post['subject']) > 25)
{

		$post['subject'] = $post['fullsubject'] = $parser->parse_badwords($post['subject']);
if(my_strlen($post['subject']) > 25)
{

			$lastpost_subject = my_substr($post['subject'], 0, 25)."...";

			$post['subject'] = my_substr($post['subject'], 0, 25)."...";

		}
$post['subject'] = htmlspecialchars_uni($post['subject']);
$post['fullsubject'] = htmlspecialchars_uni($post['fullsubject']);

		}
$post['subject'] = htmlspecialchars_uni($post['subject']);
$post['fullsubject'] = htmlspecialchars_uni($post['fullsubject']);

Zeile 2767Zeile 2875
		$thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']);
if(my_strlen($thread['subject']) > 25)
{

		$thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']);
if(my_strlen($thread['subject']) > 25)
{

			$lastpost_subject = my_substr($thread['subject'], 0, 25)."...";

			$post['subject'] = my_substr($thread['subject'], 0, 25)."...";

		}
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']);

		}
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']);

Zeile 2835Zeile 2943

// Only show the edit & lift links if current user created ban, or is super mod/admin
$edit_link = '';


// Only show the edit & lift links if current user created ban, or is super mod/admin
$edit_link = '';

		if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['canadmincp'] == 1)

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

		{
$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>";
}