Vergleich modcp.php - 1.6.7 - 1.6.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: modcp.php 5761 2012-03-22 15:22:01Z Tomm $

 * $Id$

 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'modcp.php');


 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'modcp.php');


$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport";
$templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban";
$templatelist .= ",modcp_banning_multipage,modcp_banning_nobanned,modcp_banning_auser,modcp_banning_error";
$templatelist .= ",modcp_banning_edit,modcp_banning_banned_user,modcp_nav,modcp_modlogs_noresults,modcp";
$templatelist .= ",modcp_no_announcements_global,modcp_announcements_global,modcp_announcements_forum,modcp_announcements";
$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,modcp_modlogs_result,modcp_editprofile_signature_info,modcp_editprofile_signature_options,modcp_editprofile_signature";


$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport,modcp_reports_allreports,modcp_modlogs_multipage,modcp_announcements_delete,modcp_announcements_edit";
$templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban,modcp_announcements_announcement_global,modcp_no_announcements_forum,modcp_modqueue_threads_thread";
$templatelist .= ",modcp_banning_multipage,modcp_banning_nobanned,modcp_modqueue_threads_empty,modcp_modqueue_masscontrols,modcp_modqueue_threads,modcp_modqueue_posts_post,modcp_modqueue_posts_empty";
$templatelist .= ",modcp_nav,modcp_modlogs_noresults,modcp,modcp_modqueue_posts,modcp_modqueue_attachments_attachment,modcp_modqueue_attachments_empty,modcp_modqueue_attachments,modcp_editprofile_suspensions_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_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";


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 76Zeile 77
{
$flist .= " AND fid NOT IN ({$unviewableforums})";
$tflist .= " AND t.fid NOT IN ({$unviewableforums})";

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

 

$unviewableforums = str_replace("'", '', $unviewableforums);
$unviewableforums = explode(',', $unviewableforums);
}
else
{
$unviewableforums = array();

}

// Fetch the Mod CP menu

}

// Fetch the Mod CP menu

Zeile 87Zeile 95
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 110Zeile 118

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


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

	

	

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

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

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

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

Zeile 119Zeile 127
if($mybb->input['action'] == "reports")
{
add_breadcrumb($lang->mcp_nav_reported_posts, "modcp.php?action=reports");

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


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


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

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


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


Zeile 144Zeile 152
		if(($result % $perpage) == 0)
{
$page = $result / $perpage;

		if(($result % $perpage) == 0)
{
$page = $result / $perpage;

		}

		}

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

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

Zeile 165Zeile 173
	}

if($page && $page > 0)

	}

if($page && $page > 0)

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

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

	else
{
$start = 0;

	else
{
$start = 0;

Zeile 179Zeile 187
	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'];


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

	}

	}

	
$plugins->run_hooks("modcp_reports_start");


	
$plugins->run_hooks("modcp_reports_start");


Zeile 201Zeile 209
		ORDER BY r.dateline DESC
LIMIT {$start}, {$perpage}
");

		ORDER BY r.dateline DESC
LIMIT {$start}, {$perpage}
");

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







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

	{

	{

		$trow = alt_trow();
if(is_moderator($report['fid']))

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


		{

		{

			$trow = 'trow_shaded';















			$trow = alt_trow();
if(is_moderator($report['fid']))
{
$trow = 'trow_shaded';
}

$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);
$report['posterlink'] = get_profile_link($report['postuid']);
$report['reporterlink'] = get_profile_link($report['uid']);
$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")."\";");

		}

		}

		$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);
$report['posterlink'] = get_profile_link($report['postuid']);
$report['reporterlink'] = get_profile_link($report['uid']);
$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")."\";");
}
if(!$reports)
{
eval("\$reports = \"".$templates->get("modcp_reports_noreports")."\";");

 
	}


	}


	$plugins->run_hooks("modcp_reports");

	$plugins->run_hooks("modcp_reports_end");


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


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

}

}


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


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

Zeile 242Zeile 256
	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");

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

	$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']);
$query = $db->simple_select("reportedposts", "COUNT(rid) AS count", "rid <= '".$mybb->input['rid']."'");
$result = $db->fetch_field($query, "count");

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

Zeile 262Zeile 276
		}
}
$postcount = intval($warnings);

		}
}
$postcount = intval($warnings);

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

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

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

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

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

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

		$page = 1;
}


		$page = 1;
}


Zeile 288Zeile 302

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


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

	{

	{

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

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

	}

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

 
	}

$plugins->run_hooks("modcp_allreports_start");

	}

$plugins->run_hooks("modcp_allreports_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

	$query = $db->query("
SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
FROM ".TABLE_PREFIX."reportedposts r

Zeile 309Zeile 316
		LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
ORDER BY r.dateline DESC

		LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
ORDER BY r.dateline DESC

		LIMIT $start, $perpage

		LIMIT {$start}, {$perpage}

	");

	");

	while($report = $db->fetch_array($query))
{
$report['postlink'] = get_post_link($report['pid'], $report['tid']);
$report['threadlink'] = get_thread_link($report['tid']);
$report['posterlink'] = get_profile_link($report['postuid']);
$report['reporterlink'] = get_profile_link($report['uid']);

 




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

if($report['reportstatus'] == 0)
{
$trow = "trow_shaded";
}
else

	$allreports = '';
if(!$db->num_rows($query))
{
eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";");
}
else
{
while($report = $db->fetch_array($query))

		{
$trow = alt_trow();

		{
$trow = alt_trow();

		}

$report['postusername'] = build_profile_link($report['postusername'], $report['postuid']);


























			
$report['threadlink'] = get_thread_link($report['tid']);

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

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

if($report['reportstatus'] == 0)
{
$trow = "trow_shaded";
}

// No subject? Set it to N/A
if($report['threadsubject'] == '')
{
$report['threadsubject'] = $lang->na;
}
else
{
// Only parse bad words and sanitize subject if there is one...
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
}

$report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>";





		if($report['threadsubject'])
{
$report['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($report['threadsubject']));
$report['threadsubject'] = "<a href=\"".get_thread_link($report['tid'])."\" target=\"_blank\">{$report['threadsubject']}</a>";
}
else
{
$report['threadsubject'] = $lang->na;

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








		}

		}

 
	}





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

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

$plugins->run_hooks("modcp_reports");

	$plugins->run_hooks("modcp_allreports_end");










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


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

Zeile 359Zeile 371
if($mybb->input['action'] == "modlogs")
{
add_breadcrumb($lang->mcp_nav_modlogs, "modcp.php?action=modlogs");

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





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

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

	}


	}


	$where = '';

// Searching for entries by a particular user
if($mybb->input['uid'])

	$where = '';

// Searching for entries by a particular user
if($mybb->input['uid'])

	{

	{

		$where .= " AND l.uid='".intval($mybb->input['uid'])."'";

		$where .= " AND l.uid='".intval($mybb->input['uid'])."'";

	}


	}


	// Searching for entries in a specific forum
if($mybb->input['fid'])

	// Searching for entries in a specific forum
if($mybb->input['fid'])

	{
$where .= " AND t.fid='".intval($mybb->input['fid'])."'";
}


	{
$where .= " AND t.fid='".intval($mybb->input['fid'])."'";
}


	// Order?
switch($mybb->input['sortby'])
{
case "username":
$sortby = "u.username";

	// Order?
switch($mybb->input['sortby'])
{
case "username":
$sortby = "u.username";

			break;

			break;

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

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

Zeile 397Zeile 409
	}
$order = $mybb->input['order'];
if($order != "asc")

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

	{

	{

		$order = "desc";
}

$plugins->run_hooks("modcp_modlogs_start");

		$order = "desc";
}

$plugins->run_hooks("modcp_modlogs_start");





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

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

Zeile 414Zeile 426

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


Zeile 427Zeile 439
		$page = $pages;
}


		$page = $pages;
}


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


	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 470Zeile 482
		if($logitem['tsubject'])
{
$information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />";

		if($logitem['tsubject'])
{
$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\">{$logitem['fname']}</a><br />";
}
if($logitem['psubject'])

		if($logitem['fname'])
{
$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 491Zeile 503
		}

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

		}

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

	}


	}


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

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

Zeile 515Zeile 527
		if(!$user['username'])
{
$user['username'] = $lang->na_deleted;

		if(!$user['username'])
{
$user['username'] = $lang->na_deleted;

		}

		}

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

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

Zeile 543Zeile 555
	{
error($lang->error_invalid_announcement);
}

	{
error($lang->error_invalid_announcement);
}

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

	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 569Zeile 581
		error($lang->error_invalid_announcement);
}


		error($lang->error_invalid_announcement);
}


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

	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 585Zeile 597
	verify_post_check($mybb->input['my_post_key']);

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

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

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

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

	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 604Zeile 616
	{
$errors[] = $lang->error_missing_forum;
}

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

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

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

		{

		{

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

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

Zeile 625Zeile 637
		if($enddate[0] >= 24)
{
$enddate[0] = "00";

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

	}

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

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

	if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)
{


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

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

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

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

	{

	{

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

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

		{

		{

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

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

		}

		}

		$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 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)
{

		if(!checkdate(intval($mybb->input['endtime_month']), intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])) || $enddate < 0 || $enddate == false)
{

			$errors[] = $lang->error_invalid_end_date;

			$errors[] = $lang->error_invalid_end_date;

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

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

	}

$plugins->run_hooks("modcp_do_new_announcement_start");

	}

$plugins->run_hooks("modcp_do_new_announcement_start");

Zeile 698Zeile 709

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



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


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

	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 729Zeile 740
		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

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

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

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

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

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

	}
else
{

	}
else
{

Zeile 753Zeile 764
		if($startday == $i)
{
$startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		if($startday == $i)
{
$startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		}

		}

		else
{
$startdateday .= "<option value=\"$i\">$i</option>\n";

		else
{
$startdateday .= "<option value=\"$i\">$i</option>\n";

Zeile 845Zeile 856
	$plugins->run_hooks("modcp_new_announcement");

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

	$plugins->run_hooks("modcp_new_announcement");

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

	output_page($announcements);

	output_page($announcements);

}

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

}

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

Zeile 864Zeile 875
	}

// Mod has permissions to edit this announcement

	}

// Mod has permissions to edit this announcement

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

	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 884Zeile 895
	{
$errors[] = $lang->error_missing_forum;
}

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



	

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

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

Zeile 915Zeile 926
	}

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

	}

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

	if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)

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

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

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

			$mybb->input['endtime_month'] = 1;
}
$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)

		if(!checkdate(intval($mybb->input['endtime_month']), intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])) || $enddate < 0 || $enddate == false)

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

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

		elseif($enddate < $startdate)

		elseif($enddate <= $startdate)

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

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

Zeile 986Zeile 997
	{
error($lang->error_invalid_announcement);
}

	{
error($lang->error_invalid_announcement);
}

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

	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 1037Zeile 1048
		$startmonth = $mybb->input['starttime_month'];
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']);
$startday = intval($mybb->input['starttime_day']);

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

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

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

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

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


$errored = true;
}


$errored = true;
}

Zeile 1190Zeile 1201
				$trow = alt_trow();
if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
{

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

					$icon = "<img src=\"images/minioff.gif\" alt=\"({$lang->expired})\" title=\"{$lang->expired_announcement}\"  style=\"vertical-align: middle;\" /> ";

					$icon = "<img src=\"{$theme['imgdir']}/minioff.gif\" alt=\"({$lang->expired})\" title=\"{$lang->expired_announcement}\"  style=\"vertical-align: middle;\" /> ";

				}
else
{

				}
else
{

					$icon = "<img src=\"images/minion.gif\" alt=\"({$lang->active})\" title=\"{$lang->active_announcement}\"  style=\"vertical-align: middle;\" /> ";

					$icon = "<img src=\"{$theme['imgdir']}/minion.gif\" alt=\"({$lang->active})\" title=\"{$lang->active_announcement}\"  style=\"vertical-align: middle;\" /> ";

				}

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

				}

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

Zeile 1365Zeile 1376
			$page = 1;
}


			$page = 1;
}


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

		$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


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

Zeile 1451Zeile 1462
			$page = 1;
}


			$page = 1;
}


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

		$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


$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 1537Zeile 1548
			$page = 1;
}


			$page = 1;
}


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

		$multipage = multipage($unapproved_attachments, $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 1587Zeile 1598
			eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";");
eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";");
output_page($attachmentqueue);

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

		}
}

		}
}


// Still nothing? All queues are empty! :-D
if(!$threadqueue && !$postqueue && !$attachmentqueue)


// Still nothing? All queues are empty! :-D
if(!$threadqueue && !$postqueue && !$attachmentqueue)

Zeile 1680Zeile 1691
				"avatartype" => ""
);
remove_avatars($user['uid']);

				"avatartype" => ""
);
remove_avatars($user['uid']);

		}

		}


// Moderator "Options" (suspend signature, suspend/moderate posting)
$moderator_options = array(


// Moderator "Options" (suspend signature, suspend/moderate posting)
$moderator_options = array(

Zeile 1710Zeile 1721
		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

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

			if(!$mybb->input[$option['action']])
{
if($user[$option['update_field']] == 1)

			if(!$mybb->input[$option['action']])
{
if($user[$option['update_field']] == 1)

Zeile 1725Zeile 1737

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


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

				if(intval($mybb->input[$option['time']]) == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)

				if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)

				{
// User has selected a type of ban, but not entered a valid time frame
$string = $option['action']."_error";

				{
// User has selected a type of ban, but not entered a valid time frame
$string = $option['action']."_error";

Zeile 1772Zeile 1784
		if($extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])
{
$errors[] = $lang->suspendmoderate_error;

		if($extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])
{
$errors[] = $lang->suspendmoderate_error;

		}

		}


if(is_array($errors))
{


if(is_array($errors))
{

Zeile 1818Zeile 1830
	if($user['icq'] != "0")
{
$user['icq'] = intval($user['icq']);

	if($user['icq'] != "0")
{
$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
{

	}
else
{

		$errors = inline_error($errors);
}


		$errors = inline_error($errors);
}


Zeile 1838Zeile 1850
	foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'msn', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)
{
$mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);

	foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'msn', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)
{
$mybb->input[$field] = htmlspecialchars_uni($mybb->input[$field]);

	}










	}

// Custom user title, check to see if we have a default group title
if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

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





	if($user['usertitle'] == "")

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

	{

	{

		$query = $db->simple_select("usertitles", "*", "posts <='".$user['postnum']."'", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1));
$utitle = $db->fetch_array($query);
$defaulttitle = $utitle['title'];

		$defaulttitle = $display_group['usertitle'];



	}
else
{

	}
else
{

		if(!$user['displaygroup'])




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

foreach($usertitles as $title)

		{

		{

			$user['displaygroup'] = $user['usergroup'];




			if($title['posts'] <= $mybb->user['postnum'])
{
$defaulttitle = $title['title'];
}

		}

		}


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

 
	}

	}

 


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

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

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

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

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

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

					$val = trim($val);
$val = str_replace("\n", "\\n", $val);

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

					$val = trim($val);
$val = str_replace("\n", "\\n", $val);

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

					{

					{

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

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

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

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

				{
$profilefield['length'] = 3;
}

				{
$profilefield['length'] = 3;
}

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

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

			}

			}

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

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

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

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

				if(!is_array($ip_range))


				
if($ip_range)

				{

				{

					$post_ip_sql = "longipaddress='{$ip_range}'";








					if(!is_array($ip_range))
{
$post_ip_sql = "longipaddress='{$ip_range}'";
}
else
{
$post_ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
}

				}

				}

				else
{
$post_ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
}
}

			}





			$plugins->run_hooks("modcp_ipsearch_posts_start");

			$plugins->run_hooks("modcp_ipsearch_posts_start");

			$query = $db->query("
SELECT COUNT(pid) AS count
FROM ".TABLE_PREFIX."posts
WHERE {$post_ip_sql}
");
$post_results = $db->fetch_field($query, "count");







if($post_ip_sql)
{
$query = $db->query("
SELECT COUNT(pid) AS count
FROM ".TABLE_PREFIX."posts
WHERE {$post_ip_sql}
");

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

		}

// Searching user IP addresses

		}

// Searching user IP addresses

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

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

				if(!is_array($ip_range))



if($ip_range)

				{

				{

					$user_ip_sql = "longregip='{$ip_range}' OR longlastip='{$ip_range}'";








					if(!is_array($ip_range))
{
$user_ip_sql = "longregip='{$ip_range}' OR longlastip='{$ip_range}'";
}
else
{
$user_ip_sql = "(longregip > '{$ip_range[0]}' AND longregip < '{$ip_range[1]}') OR (longlastip > '{$ip_range[0]}' AND longlastip < '{$ip_range[1]}')";
}

				}

				}

				else
{
$user_ip_sql = "(longregip > '{$ip_range[0]}' AND longregip < '{$ip_range[1]}') OR (longlastip > '{$ip_range[0]}' AND longlastip < '{$ip_range[1]}')";
}
}

			}





			$plugins->run_hooks("modcp_ipsearch_users_start");

			$plugins->run_hooks("modcp_ipsearch_users_start");

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








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

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


		$total_results = $post_results+$user_results;

		$total_results = $post_results+$user_results;

 

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


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


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

Zeile 2600Zeile 2645
		$multipage = multipage($total_results, $perpage, $page, $page_url);

$post_limit = $perpage;

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

$post_limit = $perpage;

		if($mybb->input['search_users'] && $start <= $user_results)

		if($mybb->input['search_users'] && $user_results && $start <= $user_results)

		{
$query = $db->query("
SELECT username, uid, regip, lastip

		{
$query = $db->query("
SELECT username, uid, regip, lastip

Zeile 2635Zeile 2680
				if($result)
{
--$post_limit;

				if($result)
{
--$post_limit;

				}

				}

			}
}
$post_start = 0;

			}
}
$post_start = 0;

Zeile 2647Zeile 2692
				$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'] && $post_results && (!$mybb->input['search_users'] || ($mybb->input['search_users'] && $post_limit > 0)))

		{
$ipaddresses = $tids = $uids = array();
$query = $db->query("

		{
$ipaddresses = $tids = $uids = array();
$query = $db->query("

Zeile 2707Zeile 2752
		else
{
$lang->ipsearch_results = $lang->ipsearch;

		else
{
$lang->ipsearch_results = $lang->ipsearch;

		}

		}

		
if(!strstr($mybb->input['ipaddress'], "*") && !strstr($mybb->input['ipaddress'], ":"))
{

		
if(!strstr($mybb->input['ipaddress'], "*") && !strstr($mybb->input['ipaddress'], ":"))
{

			$misc_info_link = "<div class=\"float_right\">(<a href=\"modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."\" onclick=\"MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."', 'iplookup', 500, 250); return false;\">{$lang->info_on_ip}</a>)</div>";

			$misc_info_link = "<div class=\"float_right\">(<a href=\"modcp.php?action=iplookup&ipaddress=".htmlspecialchars_uni($mybb->input['ipaddress'])."\" onclick=\"MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress=".urlencode($mybb->input['ipaddress'])."', 'iplookup', 500, 250); return false;\">{$lang->info_on_ip}</a>)</div>";

		}

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

		}

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

Zeile 2982Zeile 3027
		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']))
{
$errors[] = $lang->error_cannotbanuser;


// Have permissions to ban this user?
if(!modcp_can_manage_user($user['uid']))
{
$errors[] = $lang->error_cannotbanuser;

	}

	}


// Check for an incoming reason
if(!$mybb->input['banreason'])
{
$errors[] = $lang->error_nobanreason;


// Check for an incoming reason
if(!$mybb->input['banreason'])
{
$errors[] = $lang->error_nobanreason;

	}

	}


// Check banned group
$query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".intval($mybb->input['usergroup'])."'");
if(!$db->fetch_field($query, "gid"))


// Check banned group
$query = $db->simple_select("usergroups", "gid", "isbannedgroup=1 AND gid='".intval($mybb->input['usergroup'])."'");
if(!$db->fetch_field($query, "gid"))

	{

	{

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

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

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

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

	{

	{

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

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

Zeile 3028Zeile 3073
		if($mybb->input['liftafter'] == '---')
{
$lifted = 0;

		if($mybb->input['liftafter'] == '---')
{
$lifted = 0;

		}

		}

		else
{
$lifted = ban_date2timestamp($mybb->input['liftafter'], $user['dateline']);

		else
{
$lifted = ban_date2timestamp($mybb->input['liftafter'], $user['dateline']);

		}

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

		}

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

		{

		{

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

			$update_array = array(

			$update_array = array(

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

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

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

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

$cache->update_banned();

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

$cache->update_banned();

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











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

		
$plugins->run_hooks("modcp_do_banuser_end");


		
$plugins->run_hooks("modcp_do_banuser_end");