Vergleich modcp.php - 1.6.2 - 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}
");

		ORDER BY {$sortby} {$order}
LIMIT {$start}, {$perpage}
");

Zeile 536Zeile 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 544Zeile 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 663Zeile 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 941Zeile 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 968Zeile 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 986Zeile 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 1003Zeile 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 1104Zeile 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 1172Zeile 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 1222Zeile 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 1302Zeile 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 1623Zeile 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 2885Zeile 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 2896Zeile 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 2933Zeile 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 2988Zeile 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,
'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'])
);

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

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

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

		}

		}

		else
{
$insert_array = array(

		else
{
$insert_array = array(

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

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





		$cache->update_banned();

		$cache->update_banned();

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


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

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

		}
}

		}
}

	// Otherwise has errors, throw back to ban page
else
{
$mybb->input['action'] = "banuser";
}
}

	// Otherwise has errors, throw back to ban page
else
{
$mybb->input['action'] = "banuser";
}
}





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

	$plugins->run_hooks("modcp_banuser_start");

// If incoming user ID, we are editing a ban

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

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

		}
else

		}
else

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

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

Zeile 3197Zeile 3242
		$attachment['profilelink'] = build_profile_link($attachment['username'], $attachment['uid']);
$attachment['link'] = get_post_link($attachment['pid'], $attachment['tid']);
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);

		$attachment['profilelink'] = build_profile_link($attachment['username'], $attachment['uid']);
$attachment['link'] = get_post_link($attachment['pid'], $attachment['tid']);
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);





		eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";");
}
else

		eval("\$latest_attachment = \"".$templates->get("modcp_lastattachment")."\";");
}
else

Zeile 3267Zeile 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 3276Zeile 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 3352Zeile 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 3373Zeile 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 3404Zeile 3457
	eval("\$modcp = \"".$templates->get("modcp")."\";");
output_page($modcp);
}

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



 
?>

?>