Vergleich modcp.php - 1.6.6 - 1.6.7

  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 5585 2011-09-13 13:14:41Z Tomm $

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

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 67Zeile 67
else
{
$flist = $tflist = '';

else
{
$flist = $tflist = '';

 
}

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

if($unviewableforums && !is_super_admin($mybb->user['uid']))
{
$flist .= " AND fid NOT IN ({$unviewableforums})";
$tflist .= " AND t.fid NOT IN ({$unviewableforums})";

}

// Fetch the Mod CP menu

}

// Fetch the Mod CP menu

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


		error($lang->error_noselected_reports);
}


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







	$sql = '1=1';
if(!$mybb->input['allbox'])
{
$mybb->input['reports'] = array_map("intval", $mybb->input['reports']);
$rids = implode($mybb->input['reports'], "','");
$rids = "'0','{$rids}'";

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


$plugins->run_hooks("modcp_do_reports");



$plugins->run_hooks("modcp_do_reports");


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

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

	$cache->update_reportedposts();

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

	$cache->update_reportedposts();

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

Zeile 106Zeile 121
	add_breadcrumb($lang->mcp_nav_reported_posts, "modcp.php?action=reports");

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

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

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

	{

	{

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


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


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

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

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

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


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


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

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

Zeile 138Zeile 153
	$postcount = intval($report_count);
$pages = $postcount / $perpage;
$pages = ceil($pages);

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





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

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

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

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

	{

	{

		$page = 1;
}


		$page = 1;
}


Zeile 164Zeile 179
	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))


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

Zeile 173Zeile 188
	}

$plugins->run_hooks("modcp_reports_start");

	}

$plugins->run_hooks("modcp_reports_start");


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


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

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

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

Zeile 278Zeile 293
	}

$query = $db->simple_select("forums", "fid, name");

	}

$query = $db->simple_select("forums", "fid, name");

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

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

	
$plugins->run_hooks("modcp_allreports_start");


	
$plugins->run_hooks("modcp_allreports_start");


Zeile 307Zeile 322
		$reporttime = my_date($mybb->settings['timeformat'], $report['dateline']);

if($report['reportstatus'] == 0)

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

if($report['reportstatus'] == 0)

		{

		{

			$trow = "trow_shaded";

			$trow = "trow_shaded";

		}

		}

		else
{
$trow = alt_trow();

		else
{
$trow = alt_trow();

		}


		}


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

if($report['threadsubject'])

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

if($report['threadsubject'])

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

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

	}

	}


$plugins->run_hooks("modcp_reports");



$plugins->run_hooks("modcp_reports");


Zeile 352Zeile 367
	}

$where = '';

	}

$where = '';





	// Searching for entries by a particular user
if($mybb->input['uid'])
{
$where .= " AND l.uid='".intval($mybb->input['uid'])."'";

	// Searching for entries by a particular user
if($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'])
{

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

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

	}


	}


	$plugins->run_hooks("modcp_modlogs_start");

$query = $db->query("

	$plugins->run_hooks("modcp_modlogs_start");

$query = $db->query("

Zeile 488Zeile 503
	// Fetch filter options
$sortbysel[$mybb->input['sortby']] = "selected=\"selected\"";
$ordersel[$mybb->input['order']] = "selected=\"selected\"";

	// Fetch filter options
$sortbysel[$mybb->input['sortby']] = "selected=\"selected\"";
$ordersel[$mybb->input['order']] = "selected=\"selected\"";

	$query = $db->query("
SELECT DISTINCT l.uid, u.username

	$query = $db->query("
SELECT DISTINCT l.uid, u.username

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (l.uid=u.uid)
ORDER BY u.username ASC

		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (l.uid=u.uid)
ORDER BY u.username ASC

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

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

	}


	}


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

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

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

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

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

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





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

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

Zeile 542Zeile 557
}

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

}

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

{

{

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


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


Zeile 550Zeile 565
	$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);

if(!$announcement['aid'])

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

if(!$announcement['aid'])

	{

	{

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

	{
error_no_permission();

	{
error_no_permission();

	}

$plugins->run_hooks("modcp_delete_announcement");

	}

$plugins->run_hooks("modcp_delete_announcement");

Zeile 565Zeile 581
}

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

}

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

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

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

if(!trim($mybb->input['message']))
{
$errors[] = $lang->error_missing_message;
}

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

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

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

if(!trim($mybb->input['message']))
{
$errors[] = $lang->error_missing_message;
}

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

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


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

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


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


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

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

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

$plugins->run_hooks("modcp_do_new_announcement_start");

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

$plugins->run_hooks("modcp_do_new_announcement_start");


if(!$errors)
{


if(!$errors)
{

Zeile 672Zeile 688
	else
{
$mybb->input['action'] = 'new_announcement';

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

	}

	}

}

if($mybb->input['action'] == "new_announcement")
{
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");

}

if($mybb->input['action'] == "new_announcement")
{
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");





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

Zeile 698Zeile 714
		$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'];

		

		

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

Zeile 718Zeile 734
		$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
{
// Note: dates are in GMT timezone

	else
{
// Note: dates are in GMT timezone

Zeile 737Zeile 753
		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";
}

if($endday == $i)

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

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

		}

		}

	}

$startmonthsel = $endmonthsel = array();

	}

$startmonthsel = $endmonthsel = array();

Zeile 789Zeile 805
	if($mybb->input['allowhtml'] || !isset($mybb->input['allowhtml']))
{
$html_sel['yes'] = ' checked="checked"';

	if($mybb->input['allowhtml'] || !isset($mybb->input['allowhtml']))
{
$html_sel['yes'] = ' checked="checked"';

	}

	}

	else
{
$html_sel['no'] = ' checked="checked"';
}

if($mybb->input['allowmycode'] || !isset($mybb->input['allowmycode']))

	else
{
$html_sel['no'] = ' checked="checked"';
}

if($mybb->input['allowmycode'] || !isset($mybb->input['allowmycode']))

	{

	{

		$mycode_sel['yes'] = ' checked="checked"';
}
else
{
$mycode_sel['no'] = ' checked="checked"';

		$mycode_sel['yes'] = ' checked="checked"';
}
else
{
$mycode_sel['no'] = ' checked="checked"';

	}

	}


if($mybb->input['allowsmilies'] || !isset($mybb->input['allowsmilies']))
{


if($mybb->input['allowsmilies'] || !isset($mybb->input['allowsmilies']))
{

Zeile 905Zeile 921
	}

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

	}

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

	{
$enddate = '0';

	{
$enddate = '0';

	}
else
{

	}
else
{

Zeile 973Zeile 989
	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();

 
	}

if(!$announcement['startdate'])
{
// No start date? Make it now.
$announcement['startdate'] = TIME_NOW;
}

$makeshift_end = false;
if(!$announcement['enddate'])
{
$makeshift_end = true;
$makeshift_time = TIME_NOW;
if($announcement['startdate'])
{
$makeshift_time = $announcement['startdate'];
}

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

	}

// Deal with inline errors

	}

// Deal with inline errors

Zeile 1109Zeile 1145
		$smilies_sel['no'] = ' checked="checked"';
}


		$smilies_sel['no'] = ' checked="checked"';
}


	if(($errored && $mybb->input['endtime_type'] == 2) || (!$errored && intval($announcement['enddate']) == 0))

	if(($errored && $mybb->input['endtime_type'] == 2) || (!$errored && intval($announcement['enddate']) == 0) || $makeshift_end == true)

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

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

Zeile 1153Zeile 1189
			{
$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;\" /> ";
}
else

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

Zeile 1253Zeile 1289
			}
}
if(is_array($posts_to_approve))

			}
}
if(is_array($posts_to_approve))

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

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

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

$plugins->run_hooks("modcp_do_modqueue_end");

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

$plugins->run_hooks("modcp_do_modqueue_end");

Zeile 1275Zeile 1311
		{
$action = $mybb->input['attachments'][$attachment['aid']];
if($action == "approve")

		{
$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 1307Zeile 1343

$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)
{
$start = ($page-1) * $perpage;
}
else
{

		$pages = ceil($pages);

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

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

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

			$start = 0;
$page = 1;
}

			$start = 0;
$page = 1;
}

Zeile 2572Zeile 2608
				WHERE {$user_ip_sql}
ORDER BY regdate DESC
LIMIT {$start}, {$perpage}

				WHERE {$user_ip_sql}
ORDER BY regdate DESC
LIMIT {$start}, {$perpage}

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

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

				$result = false;
$profile_link = build_profile_link($ipaddress['username'], $ipaddress['uid']);
$trow = alt_trow();

				$result = false;
$profile_link = build_profile_link($ipaddress['username'], $ipaddress['uid']);
$trow = alt_trow();

Zeile 2679Zeile 2715
		}

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

		}

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

	}

	}


// Fetch filter options
if(!$mybb->input['ipaddress'])


// Fetch filter options
if(!$mybb->input['ipaddress'])

Zeile 2722Zeile 2758
					$ipaddress_location .= $lang->comma.htmlspecialchars_uni($ip_record['city']);
}
}

					$ipaddress_location .= $lang->comma.htmlspecialchars_uni($ip_record['city']);
}
}

		}


		}


		$ipaddress_host_name = htmlspecialchars_uni(@gethostbyaddr($mybb->input['ipaddress']));

// gethostbyaddr returns the same ip on failure
if($ipaddress_host_name == $mybb->input['ipaddress'])
{
$ipaddress_host_name = $lang->na;

		$ipaddress_host_name = htmlspecialchars_uni(@gethostbyaddr($mybb->input['ipaddress']));

// gethostbyaddr returns the same ip on failure
if($ipaddress_host_name == $mybb->input['ipaddress'])
{
$ipaddress_host_name = $lang->na;

		}
}

		}
}

	
$plugins->run_hooks("modcp_iplookup_end");


	
$plugins->run_hooks("modcp_iplookup_end");


Zeile 2886Zeile 2922
	if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
{
error_no_permission();

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

	}


	}


	$plugins->run_hooks("modcp_liftban_start");

	$plugins->run_hooks("modcp_liftban_start");

 

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


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


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

Zeile 2900Zeile 2939

$cache->update_banned();
$cache->update_moderators();


$cache->update_banned();
$cache->update_moderators();

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

	
$plugins->run_hooks("modcp_liftban_end");


	
$plugins->run_hooks("modcp_liftban_end");


Zeile 2913Zeile 2953

// Editing an existing ban
if($mybb->input['uid'])


// Editing an existing ban
if($mybb->input['uid'])

	{

	{

		// Get the users info from their uid
$query = $db->query("
SELECT b.*, u.uid, u.usergroup, u.additionalgroups, u.displaygroup

		// Get the users info from their uid
$query = $db->query("
SELECT b.*, u.uid, u.usergroup, u.additionalgroups, u.displaygroup

Zeile 2937Zeile 2977
	else
{
// Get the users info from their Username

	else
{
// Get the users info from their Username

		$query = $db->simple_select("users", "uid, usergroup, additionalgroups, displaygroup", "username = '".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));

		$query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "username = '".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));

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

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

		{

		{

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

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

Zeile 2960Zeile 3000
	if(!$mybb->input['banreason'])
{
$errors[] = $lang->error_nobanreason;

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


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

Zeile 2986Zeile 3026
	{
// Ban the user
if($mybb->input['liftafter'] == '---')

	{
// Ban the user
if($mybb->input['liftafter'] == '---')

		{

		{

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

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

		}

		}


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


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

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

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

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

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

Zeile 3034Zeile 3074
		$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);

		
$plugins->run_hooks("modcp_do_banuser_end");

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

		
$plugins->run_hooks("modcp_do_banuser_end");

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

		{

		{

			redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);
}
else
{
redirect("modcp.php?action=banning", $lang->redirect_banuser);

			redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);
}
else
{
redirect("modcp.php?action=banning", $lang->redirect_banuser);

		}

		}

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

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

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

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


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


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

		add_breadcrumb($lang->mcp_nav_ban_user);
}
else
{
add_breadcrumb($lang->mcp_nav_editing_ban);

		add_breadcrumb($lang->mcp_nav_ban_user);
}
else
{
add_breadcrumb($lang->mcp_nav_editing_ban);

	}

	}

	
$plugins->run_hooks("modcp_banuser_start");

// If incoming user ID, we are editing a ban
if($mybb->input['uid'])

	
$plugins->run_hooks("modcp_banuser_start");

// If incoming user ID, we are editing a ban
if($mybb->input['uid'])

	{

	{

		$query = $db->query("
SELECT b.*, u.username, u.uid
FROM ".TABLE_PREFIX."banned b

		$query = $db->query("
SELECT b.*, u.username, u.uid
FROM ".TABLE_PREFIX."banned b

Zeile 3096Zeile 3137
		{
$user = get_user($mybb->input['uid']);
$username = $user['username'];

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

		}

		}

		else
{
$username = htmlspecialchars_uni($mybb->input['username']);
}
eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";");

		else
{
$username = htmlspecialchars_uni($mybb->input['username']);
}
eval("\$banuser_username = \"".$templates->get("modcp_banuser_addusername")."\";");

	}

	}


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


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

Zeile 3114Zeile 3155
			"gid" => $mybb->input['gid']
);
$banreason = htmlspecialchars_uni($mybb->input['banreason']);

			"gid" => $mybb->input['gid']
);
$banreason = htmlspecialchars_uni($mybb->input['banreason']);

	}

	}


// Generate the banned times dropdown
foreach($bantimes as $time => $title)


// Generate the banned times dropdown
foreach($bantimes as $time => $title)

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

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

		{

		{

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

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

		}

		}

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

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

		}

		}

	}

$bangroups = '';

	}

$bangroups = '';

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

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


	}

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


	$plugins->run_hooks("modcp_banuser_end");

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

	$plugins->run_hooks("modcp_banuser_end");

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

Zeile 3271Zeile 3312
	else
{
$latest_thread = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>";

	else
{
$latest_thread = "<span style=\"text-align: center;\">{$lang->lastpost_never}</span>";

 
	}

$where = '';
if($tflist)
{
$where = "WHERE (t.fid <> 0 {$tflist}) OR (!l.fid)";

	}

$query = $db->query("

	}

$query = $db->query("

Zeile 3280Zeile 3327
		LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)

		LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=l.fid)
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=l.pid)

 
		{$where}

		ORDER BY l.dateline DESC
LIMIT 5
");

		ORDER BY l.dateline DESC
LIMIT 5
");

 


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

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

Zeile 3356Zeile 3405
		else
{
$banned['reason'] = $lang->na;

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

		}

		}


if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---')
{


if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---')
{

Zeile 3369Zeile 3418
			$remaining = $banned['remaining'];

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

			$remaining = $banned['remaining'];

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





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

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

Zeile 3408Zeile 3457
	eval("\$modcp = \"".$templates->get("modcp")."\";");
output_page($modcp);
}

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



 
?>

?>