Vergleich modcp.php - 1.6.1 - 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 5120 2010-07-26 20:10:05Z RyanGordon $

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

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 46Zeile 46
$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{

$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{

	$query = $db->simple_select("moderators", "*", "id='{$mybb->user['uid']}' AND isgroup = '0'");

	$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id='{$mybb->user['usergroup']}' AND isgroup = '1')");

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

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

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


}

// Fetch the Mod CP menu
eval("\$modcp_nav = \"".$templates->get("modcp_nav")."\";");


$plugins->run_hooks("modcp_start");


$plugins->run_hooks("modcp_start");


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


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


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 393Zeile 408
		FROM ".TABLE_PREFIX."moderatorlog l
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=l.tid)

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

		WHERE 1=1 {$where}

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

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


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


Zeile 439Zeile 454
		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 1=1 {$where}

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

		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");
while($logitem = $db->fetch_array($query))
{
$information = '';

		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");
while($logitem = $db->fetch_array($query))
{
$information = '';

 
		$logitem['action'] = htmlspecialchars_uni($logitem['action']);

		$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);
$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();

		$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);
$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();

Zeile 535Zeile 551
	$plugins->run_hooks("modcp_do_delete_announcement");

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

	$plugins->run_hooks("modcp_do_delete_announcement");

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

 
	$cache->update_forumsdisplay();


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


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

Zeile 543Zeile 560
{
$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}'");

 


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

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




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


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

Zeile 662Zeile 682
		
$plugins->run_hooks("modcp_do_new_announcement_end");


		
$plugins->run_hooks("modcp_do_new_announcement_end");


 
		$cache->update_forumsdisplay();

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

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

Zeile 940Zeile 961
		
$plugins->run_hooks("modcp_do_edit_announcement_end");


		
$plugins->run_hooks("modcp_do_edit_announcement_end");


 
		$cache->update_forumsdisplay();

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

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

Zeile 967Zeile 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
if(is_array($errors))
{
$errors = inline_error($errors);

	}

// Deal with inline errors
if(is_array($errors))
{
$errors = inline_error($errors);





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

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

Zeile 985Zeile 1027
		if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;

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

		}

		}

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

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

Zeile 1002Zeile 1044
		$endtime_time = htmlspecialchars($mybb->input['endtime_time']);

$errored = true;

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

$errored = true;

	}

	}

	else
{
// Note: dates are in GMT timezone

	else
{
// Note: dates are in GMT timezone

Zeile 1103Zeile 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 1171Zeile 1213
	{
// Moderator is not super, so don't show global annnouncemnets
$announcements_global = '';

	{
// Moderator is not super, so don't show global annnouncemnets
$announcements_global = '';

	}


	}


	fetch_forum_announcements();

if(!$announcements_forum)

	fetch_forum_announcements();

if(!$announcements_forum)

Zeile 1221Zeile 1263
		{
foreach($threads_to_delete as $tid)
{

		{
foreach($threads_to_delete as $tid)
{

				$moderation->delete_thread($thread['tid']);

				$moderation->delete_thread($tid);

			}
log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);
}

			}
log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);
}

Zeile 1301Zeile 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
{
$start = 0;
$page = 1;
}

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

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

$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 1622Zeile 1664
	$errors = '';

// Validate the user and get any errors that might have occurred.

	$errors = '';

// Validate the user and get any errors that might have occurred.

	$userhandler->admin_override = true;

 
	if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

	if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

Zeile 2884Zeile 2925
	}

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





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


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


Zeile 2932Zeile 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'])
{

Zeile 2949Zeile 2994
	if(!modcp_can_manage_user($user['uid']))
{
$errors[] = $lang->error_cannotbanuser;

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

	}

	}


// Check for an incoming reason
if(!$mybb->input['banreason'])


// Check for an incoming reason
if(!$mybb->input['banreason'])

	{

	{

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


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


Zeile 2962Zeile 3007
	if(!$db->fetch_field($query, "gid"))
{
$errors[] = $lang->error_nobangroup;

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


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

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

		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 3029Zeile 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 3051Zeile 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 3091Zeile 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 3109Zeile 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 3121Zeile 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 3140Zeile 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 3266Zeile 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 3275Zeile 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 = '';

 
		$logitem['action'] = htmlspecialchars_uni($logitem['action']);

		$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);
$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();

		$log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']);
$log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
$trow = alt_trow();

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

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

		}


		}


		if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---')
{
$banlength = $lang->permanent;

		if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---')
{
$banlength = $lang->permanent;

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

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

			}

			}

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

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

			{

			{

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

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

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

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



 
?>

?>