Vergleich moderation.php - 1.8.21 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 532Zeile 532
					");
}
}

					");
}
}

		



		while($delayedmod = $db->fetch_array($query))
{

		while($delayedmod = $db->fetch_array($query))
{

			$delayedmod['dateline'] = my_date("jS M Y, {$mybb->settings['timeformat']}", $delayedmod['delaydateline']);

			$delayedmod['dateline'] = my_date('normal', $delayedmod['delaydateline'], "", 2);

			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];

			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];

Zeile 624Zeile 624

$threads = $lang->sprintf($lang->threads_selected, count($tids));
$moderation_delayedmoderation_merge = '';


$threads = $lang->sprintf($lang->threads_selected, count($tids));
$moderation_delayedmoderation_merge = '';

		}

		}

		$redirect_expire = $mybb->get_input('redirect_expire');
eval("\$moderation_delayedmoderation_move = \"".$templates->get("moderation_delayedmoderation_move")."\";");


		$redirect_expire = $mybb->get_input('redirect_expire');
eval("\$moderation_delayedmoderation_move = \"".$templates->get("moderation_delayedmoderation_move")."\";");


Zeile 652Zeile 652
		

eval('$datemonth = "'.$templates->get('moderation_delayedmoderation_date_month').'";');

		

eval('$datemonth = "'.$templates->get('moderation_delayedmoderation_date_month').'";');





		$dateyear = gmdate('Y', TIME_NOW  + $localized_time_offset);
$datetime = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset);

$openclosethread = '';
if(is_moderator($fid, "canopenclosethreads"))

		$dateyear = gmdate('Y', TIME_NOW  + $localized_time_offset);
$datetime = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset);

$openclosethread = '';
if(is_moderator($fid, "canopenclosethreads"))

		{

		{

			eval('$openclosethread = "'.$templates->get('moderation_delayedmoderation_openclose').'";');
}

$softdeleterestorethread = '';
if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads"))

			eval('$openclosethread = "'.$templates->get('moderation_delayedmoderation_openclose').'";');
}

$softdeleterestorethread = '';
if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads"))

		{

		{

			eval('$softdeleterestorethread = "'.$templates->get('moderation_delayedmoderation_softdeleterestore').'";');
}

$deletethread = '';
if(is_moderator($fid, "candeletethreads"))

			eval('$softdeleterestorethread = "'.$templates->get('moderation_delayedmoderation_softdeleterestore').'";');
}

$deletethread = '';
if(is_moderator($fid, "candeletethreads"))

		{

		{

			eval('$deletethread = "'.$templates->get('moderation_delayedmoderation_delete').'";');
}


			eval('$deletethread = "'.$templates->get('moderation_delayedmoderation_delete').'";');
}


Zeile 761Zeile 761
		log_moderator_action($modlogdata, $lang->mod_process);

moderation_redirect(get_thread_link($thread['tid']), $redirect);

		log_moderator_action($modlogdata, $lang->mod_process);

moderation_redirect(get_thread_link($thread['tid']), $redirect);

		break;


		break;


	// Remove redirects to a specific thread
case "removeredirects":


	// Remove redirects to a specific thread
case "removeredirects":


Zeile 772Zeile 772
		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

		}


		}


		if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);

		if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);

		}


		}


		$plugins->run_hooks("moderation_removeredirects");

$moderation->remove_redirects($tid);

		$plugins->run_hooks("moderation_removeredirects");

$moderation->remove_redirects($tid);

Zeile 789Zeile 789

// Delete thread confirmation page
case "deletethread":


// Delete thread confirmation page
case "deletethread":





		add_breadcrumb($lang->nav_deletethread);

if(!is_moderator($fid, "candeletethreads"))

		add_breadcrumb($lang->nav_deletethread);

if(!is_moderator($fid, "candeletethreads"))

Zeile 801Zeile 801
		}

$plugins->run_hooks("moderation_deletethread");

		}

$plugins->run_hooks("moderation_deletethread");





		eval("\$deletethread = \"".$templates->get("moderation_deletethread")."\";");
output_page($deletethread);
break;

		eval("\$deletethread = \"".$templates->get("moderation_deletethread")."\";");
output_page($deletethread);
break;





	// Delete the actual thread here

	// Delete the actual thread here

	case "do_deletethread":


	case "do_deletethread":


		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "candeletethreads"))

		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "candeletethreads"))

		{
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid'])
{
error_no_permission();
}

		{
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid'])
{
error_no_permission();
}

		}

$plugins->run_hooks("moderation_do_deletethread");

		}

$plugins->run_hooks("moderation_do_deletethread");

Zeile 828Zeile 828
		$thread['subject'] = $db->escape_string($thread['subject']);
$lang->thread_deleted = $lang->sprintf($lang->thread_deleted, $thread['subject']);
log_moderator_action($modlogdata, $lang->thread_deleted);

		$thread['subject'] = $db->escape_string($thread['subject']);
$lang->thread_deleted = $lang->sprintf($lang->thread_deleted, $thread['subject']);
log_moderator_action($modlogdata, $lang->thread_deleted);





		$moderation->delete_thread($tid);

mark_reports($tid, "thread");

		$moderation->delete_thread($tid);

mark_reports($tid, "thread");

Zeile 850Zeile 850
		$plugins->run_hooks("moderation_deletepoll");

$query = $db->simple_select("polls", "pid", "tid='$tid'");

		$plugins->run_hooks("moderation_deletepoll");

$query = $db->simple_select("polls", "pid", "tid='$tid'");

		$poll = $db->fetch_array($query);
if(!$poll)
{
error($lang->error_invalidpoll, $lang->error);
}

		$poll = $db->fetch_array($query);
if(!$poll)
{
error($lang->error_invalidpoll, $lang->error);
}


eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";");
output_page($deletepoll);


eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";");
output_page($deletepoll);

Zeile 872Zeile 872
		}

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

		}

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

		{

		{

			error($lang->redirect_pollnotdeleted);
}
if(!is_moderator($fid, "canmanagepolls"))

			error($lang->redirect_pollnotdeleted);
}
if(!is_moderator($fid, "canmanagepolls"))

Zeile 895Zeile 895
		log_moderator_action($modlogdata, $lang->poll_deleted);

$moderation->delete_poll($poll['pid']);

		log_moderator_action($modlogdata, $lang->poll_deleted);

$moderation->delete_poll($poll['pid']);





		moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_polldeleted);
break;

		moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_polldeleted);
break;





	// Approve a thread
case "approvethread":

	// Approve a thread
case "approvethread":


// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canapproveunapprovethreads"))


// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canapproveunapprovethreads"))

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 997Zeile 997
		$moderation->soft_delete_threads($tid);

moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadsoftdeleted);

		$moderation->soft_delete_threads($tid);

moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadsoftdeleted);

		break;


		break;


	// Move a thread
case "move":
add_breadcrumb($lang->nav_move);

	// Move a thread
case "move":
add_breadcrumb($lang->nav_move);

Zeile 1090Zeile 1090
	// Viewing thread notes
case "viewthreadnotes":
if(!is_moderator($fid))

	// Viewing thread notes
case "viewthreadnotes":
if(!is_moderator($fid))

		{
error_no_permission();

		{
error_no_permission();

		}

// Make sure we are looking at a real thread here.

		}

// Make sure we are looking at a real thread here.

Zeile 1136Zeile 1136
			$modactions = '';
while($modaction = $db->fetch_array($query))
{

			$modactions = '';
while($modaction = $db->fetch_array($query))
{

				$modaction['dateline'] = my_date("jS M Y, G:i", $modaction['dateline']);

				$modaction['dateline'] = my_date('relative', $modaction['dateline']);

				$modaction['username'] = htmlspecialchars_uni($modaction['username']);
$modaction['profilelink'] = build_profile_link($modaction['username'], $modaction['uid']);
$modaction['action'] = htmlspecialchars_uni($modaction['action']);

				$modaction['username'] = htmlspecialchars_uni($modaction['username']);
$modaction['profilelink'] = build_profile_link($modaction['username'], $modaction['uid']);
$modaction['action'] = htmlspecialchars_uni($modaction['action']);

Zeile 1226Zeile 1226
		$delayedmods = '';
while($delayedmod = $db->fetch_array($query))
{

		$delayedmods = '';
while($delayedmod = $db->fetch_array($query))
{

			$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);

			$delayedmod['dateline'] = my_date('normal', $delayedmod['delaydateline'], "", 2);

			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];

			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];

Zeile 1279Zeile 1279

eval("\$delayedmods .= \"".$templates->get("moderation_threadnotes_delayedmodaction")."\";");
$trow = alt_trow();


eval("\$delayedmods .= \"".$templates->get("moderation_threadnotes_delayedmodaction")."\";");
$trow = alt_trow();

		}

		}

		if(!$delayedmods)
{
$cols = 4;
eval("\$delayedmods = \"".$templates->get("moderation_delayedmodaction_error")."\";");

		if(!$delayedmods)
{
$cols = 4;
eval("\$delayedmods = \"".$templates->get("moderation_delayedmodaction_error")."\";");

		}


		}


		$plugins->run_hooks("moderation_threadnotes");

eval("\$threadnotes = \"".$templates->get("moderation_threadnotes")."\";");
output_page($threadnotes);

		$plugins->run_hooks("moderation_threadnotes");

eval("\$threadnotes = \"".$templates->get("moderation_threadnotes")."\";");
output_page($threadnotes);

		break;

		break;


// Update the thread notes!
case "do_threadnotes":


// Update the thread notes!
case "do_threadnotes":

Zeile 1299Zeile 1299
		verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canmanagethreads"))

		verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canmanagethreads"))

		{
error_no_permission();
}

		{
error_no_permission();
}


$plugins->run_hooks("moderation_do_threadnotes");



$plugins->run_hooks("moderation_do_threadnotes");


Zeile 1312Zeile 1312
		$db->update_query("threads", $sqlarray, "tid='$tid'");
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadnotesupdated);
break;

		$db->update_query("threads", $sqlarray, "tid='$tid'");
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadnotesupdated);
break;





	// Let's look up the ip address of a post
case "getip":
add_breadcrumb($lang->nav_getip);

	// Let's look up the ip address of a post
case "getip":
add_breadcrumb($lang->nav_getip);

Zeile 1324Zeile 1324
		$post['ipaddress'] = my_inet_ntop($db->unescape_binary($post['ipaddress']));
$hostname = @gethostbyaddr($post['ipaddress']);
if(!$hostname || $hostname == $post['ipaddress'])

		$post['ipaddress'] = my_inet_ntop($db->unescape_binary($post['ipaddress']));
$hostname = @gethostbyaddr($post['ipaddress']);
if(!$hostname || $hostname == $post['ipaddress'])

		{
$hostname = $lang->resolve_fail;
}

		{
$hostname = $lang->resolve_fail;
}


$post['username'] = htmlspecialchars_uni($post['username']);
$username = build_profile_link($post['username'], $post['uid']);


$post['username'] = htmlspecialchars_uni($post['username']);
$username = build_profile_link($post['username'], $post['uid']);

Zeile 1337Zeile 1337
		{
$ipaddress = $post['ipaddress'];
eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");

		{
$ipaddress = $post['ipaddress'];
eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");

		}


		}


		$plugins->run_hooks('moderation_getip');

if($modal)

		$plugins->run_hooks('moderation_getip');

if($modal)

Zeile 1372Zeile 1372
		$pm['ipaddress'] = my_inet_ntop($db->unescape_binary($pm['ipaddress']));
$hostname = @gethostbyaddr($pm['ipaddress']);
if(!$hostname || $hostname == $pm['ipaddress'])

		$pm['ipaddress'] = my_inet_ntop($db->unescape_binary($pm['ipaddress']));
$hostname = @gethostbyaddr($pm['ipaddress']);
if(!$hostname || $hostname == $pm['ipaddress'])

		{

		{

			$hostname = $lang->resolve_fail;
}

$name = $db->fetch_field($db->simple_select('users', 'username', "uid = {$pm['fromid']}"), 'username');
$username = build_profile_link($name, $pm['fromid']);

			$hostname = $lang->resolve_fail;
}

$name = $db->fetch_field($db->simple_select('users', 'username', "uid = {$pm['fromid']}"), 'username');
$username = build_profile_link($name, $pm['fromid']);





		// Moderator options
$modoptions = "";
if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canuseipsearch'] == 1)

		// Moderator options
$modoptions = "";
if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canuseipsearch'] == 1)

Zeile 1390Zeile 1390
		$plugins->run_hooks('moderation_getpmip');

if($modal)

		$plugins->run_hooks('moderation_getpmip');

if($modal)

		{

		{

			eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";");
echo $getpmip;
exit;
}
else

			eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";");
echo $getpmip;
exit;
}
else

		{

		{

			eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";");
output_page($getpmip);
break;

			eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";");
output_page($getpmip);
break;

Zeile 1408Zeile 1408
		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

		}

		}


if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);
}


if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);
}





		$plugins->run_hooks("moderation_merge");

eval("\$merge = \"".$templates->get("moderation_merge")."\";");
output_page($merge);

		$plugins->run_hooks("moderation_merge");

eval("\$merge = \"".$templates->get("moderation_merge")."\";");
output_page($merge);

		break;

		break;


// Let's get those threads together baby! (Merge threads)
case "do_merge":


// Let's get those threads together baby! (Merge threads)
case "do_merge":

Zeile 1430Zeile 1430
		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

		}


		}


		if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);

		if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);

Zeile 1442Zeile 1442
		// explode at # sign in a url (indicates a name reference) and reassign to the url
$realurl = explode("#", $mybb->get_input('threadurl'));
$mybb->input['threadurl'] = $realurl[0];

		// explode at # sign in a url (indicates a name reference) and reassign to the url
$realurl = explode("#", $mybb->get_input('threadurl'));
$mybb->input['threadurl'] = $realurl[0];





		// Are we using an SEO URL?
if(substr($mybb->input['threadurl'], -4) == "html")
{

		// Are we using an SEO URL?
if(substr($mybb->input['threadurl'], -4) == "html")
{

Zeile 1465Zeile 1465
			// Get thread to merge's tid the normal way
$splitloc = explode(".php", $mybb->input['threadurl']);
$temp = explode("&", my_substr($splitloc[1], 1));

			// Get thread to merge's tid the normal way
$splitloc = explode(".php", $mybb->input['threadurl']);
$temp = explode("&", my_substr($splitloc[1], 1));





			if(!empty($temp))
{
for($i = 0; $i < count($temp); $i++)

			if(!empty($temp))
{
for($i = 0; $i < count($temp); $i++)

Zeile 1487Zeile 1487
			$mergetid = (int)$post['tid'];
}
elseif(!empty($parameters['tid']))

			$mergetid = (int)$post['tid'];
}
elseif(!empty($parameters['tid']))

		{

		{

			$mergetid = (int)$parameters['tid'];

			$mergetid = (int)$parameters['tid'];

		}

		}

		else
{
$mergetid = 0;

		else
{
$mergetid = 0;

		}

		}

		$mergethread = get_thread($mergetid);
if(!$mergethread)
{
error($lang->error_badmergeurl, $lang->error);

		$mergethread = get_thread($mergetid);
if(!$mergethread)
{
error($lang->error_badmergeurl, $lang->error);

		}

		}

		if($mergetid == $tid)
{ // sanity check
error($lang->error_mergewithself, $lang->error);
}
if(!is_moderator($mergethread['fid'], "canmanagethreads"))

		if($mergetid == $tid)
{ // sanity check
error($lang->error_mergewithself, $lang->error);
}
if(!is_moderator($mergethread['fid'], "canmanagethreads"))

		{

		{

			error_no_permission();

			error_no_permission();

		}

		}

		if(isset($mybb->input['subject']))

		if(isset($mybb->input['subject']))

		{

		{

			$subject = $mybb->get_input('subject');

			$subject = $mybb->get_input('subject');

		}
else
{

		}
else
{

			$subject = $thread['subject'];
}


			$subject = $thread['subject'];
}


Zeile 1651Zeile 1651
		$newtid = $moderation->split_posts($pids, $tid, $moveto, $mybb->get_input('newsubject'));

log_moderator_action($modlogdata, $lang->thread_split);

		$newtid = $moderation->split_posts($pids, $tid, $moveto, $mybb->get_input('newsubject'));

log_moderator_action($modlogdata, $lang->thread_split);





		moderation_redirect(get_thread_link($newtid), $lang->redirect_threadsplit);
break;


		moderation_redirect(get_thread_link($newtid), $lang->redirect_threadsplit);
break;


Zeile 1664Zeile 1664
		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

		}


		}


		if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);

		if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);

		}


		}


		$plugins->run_hooks("moderation_removesubscriptions");

$moderation->remove_thread_subscriptions($tid, true);

		$plugins->run_hooks("moderation_removesubscriptions");

$moderation->remove_thread_subscriptions($tid, true);

Zeile 1679Zeile 1679

moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_removed_subscriptions);
break;


moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_removed_subscriptions);
break;





	// Delete Threads - Inline moderation
case "multideletethreads":
add_breadcrumb($lang->nav_multi_deletethreads);

	// Delete Threads - Inline moderation
case "multideletethreads":
add_breadcrumb($lang->nav_multi_deletethreads);

Zeile 1689Zeile 1689
			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'candeletethreads'))

			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'candeletethreads'))

			{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');

			{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');

			if(!is_moderator($fid, 'candeletethreads'))
{
error_no_permission();

			if(!is_moderator($fid, 'candeletethreads'))
{
error_no_permission();

Zeile 1712Zeile 1712
			clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else

			clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else

		{

		{

			clearinline($fid, 'forum');
}
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

			clearinline($fid, 'forum');
}
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

Zeile 1738Zeile 1738
			$tlist[] = $tid;
}
log_moderator_action($modlogdata, $lang->multi_deleted_threads);

			$tlist[] = $tid;
}
log_moderator_action($modlogdata, $lang->multi_deleted_threads);

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{

			clearinline($fid, 'forum');
}
mark_reports($tlist, "threads");

			clearinline($fid, 'forum');
}
mark_reports($tlist, "threads");

Zeile 1782Zeile 1782
		$moderation->open_threads($threads);

log_moderator_action($modlogdata, $lang->multi_opened_threads);

		$moderation->open_threads($threads);

log_moderator_action($modlogdata, $lang->multi_opened_threads);

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{

			clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsopened);
break;

			clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsopened);
break;





	// Close threads - Inline moderation
case "multiclosethreads":


	// Close threads - Inline moderation
case "multiclosethreads":


Zeile 1804Zeile 1804
			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'canopenclosethreads'))

			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'canopenclosethreads'))

			{
error_no_permission();
}
}
else

			{
error_no_permission();
}
}
else

		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canopenclosethreads'))

		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canopenclosethreads'))

Zeile 1824Zeile 1824
		$moderation->close_threads($threads);

log_moderator_action($modlogdata, $lang->multi_closed_threads);

		$moderation->close_threads($threads);

log_moderator_action($modlogdata, $lang->multi_closed_threads);

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{

			clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsclosed);
break;

			clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsclosed);
break;





	// Approve threads - Inline moderation
case "multiapprovethreads":


	// Approve threads - Inline moderation
case "multiapprovethreads":


Zeile 1846Zeile 1846
			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'canapproveunapprovethreads'))

			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'canapproveunapprovethreads'))

			{
error_no_permission();
}
}
else

			{
error_no_permission();
}
}
else

		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canapproveunapprovethreads'))

		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canapproveunapprovethreads'))

Zeile 1866Zeile 1866
		$moderation->approve_threads($threads, $fid);

log_moderator_action($modlogdata, $lang->multi_approved_threads);

		$moderation->approve_threads($threads, $fid);

log_moderator_action($modlogdata, $lang->multi_approved_threads);

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{
clearinline($fid, 'forum');
}
$cache->update_stats();

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{
clearinline($fid, 'forum');
}
$cache->update_stats();

		moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsapproved);
break;


		moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsapproved);
break;


Zeile 1964Zeile 1964
		moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsrestored);
break;


		moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsrestored);
break;


	// Soft delete threads - Inline moderation
case "multisoftdeletethreads":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!empty($mybb->input['searchid']))
{
// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'cansoftdeletethreads'))
{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'cansoftdeletethreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected, $lang->error);
}

$moderation->soft_delete_threads($threads);

log_moderator_action($modlogdata, $lang->multi_soft_deleted_threads);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{
clearinline($fid, 'forum');
}
$cache->update_stats();
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadssoftdeleted);
break;

// Stick threads - Inline moderation
case "multistickthreads":

	// Soft delete threads - Inline moderation
case "multisoftdeletethreads":













































// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





		if(!empty($mybb->input['searchid']))

		if(!empty($mybb->input['searchid']))

		{

		{

			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');

			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');

			if(!is_moderator_by_tids($threads, 'canstickunstickthreads'))









			if(!is_moderator_by_tids($threads, 'cansoftdeletethreads'))
{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'cansoftdeletethreads'))

			{
error_no_permission();
}

			{
error_no_permission();
}

		}













		}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected, $lang->error);
}

$moderation->soft_delete_threads($threads);

log_moderator_action($modlogdata, $lang->multi_soft_deleted_threads);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}

		else
{

		else
{

			$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canstickunstickthreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
















			clearinline($fid, 'forum');
}
$cache->update_stats();
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadssoftdeleted);
break;

// Stick threads - Inline moderation
case "multistickthreads":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!empty($mybb->input['searchid']))
{
// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'canstickunstickthreads'))
{
error_no_permission();
}
}
else

		{

		{

			error($lang->error_inline_nothreadsselected, $lang->error);





			$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canstickunstickthreads'))
{
error_no_permission();
}

		}

		}


$moderation->stick_threads($threads);





		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected, $lang->error);
}

$moderation->stick_threads($threads);


log_moderator_action($modlogdata, $lang->multi_stuck_threads);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');


log_moderator_action($modlogdata, $lang->multi_stuck_threads);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');

		}

		}

		else
{
clearinline($fid, 'forum');

		else
{
clearinline($fid, 'forum');

Zeile 2068Zeile 2068
		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canstickunstickthreads'))

		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canstickunstickthreads'))

			{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected, $lang->error);
}


			{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected, $lang->error);
}


		$moderation->unstick_threads($threads);

log_moderator_action($modlogdata, $lang->multi_unstuck_threads);

		$moderation->unstick_threads($threads);

log_moderator_action($modlogdata, $lang->multi_unstuck_threads);

Zeile 2105Zeile 2105
			}
}
else

			}
}
else

		{

		{

			$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canmanagethreads'))
{

			$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canmanagethreads'))
{

Zeile 2116Zeile 2116
		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected, $lang->error);

		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected, $lang->error);

		}

		}

		$inlineids = implode("|", $threads);
if($mybb->get_input('inlinetype') == 'search')
{

		$inlineids = implode("|", $threads);
if($mybb->get_input('inlinetype') == 'search')
{

Zeile 2134Zeile 2134

// Actually move the threads in Inline moderation
case "do_multimovethreads":


// Actually move the threads in Inline moderation
case "do_multimovethreads":





		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





		$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);

		$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);

 
		$method = $mybb->get_input('method');


		$threadlist = explode("|", $mybb->get_input('threads'));
if(!is_moderator_by_tids($threadlist, 'canmanagethreads'))
{

		$threadlist = explode("|", $mybb->get_input('threads'));
if(!is_moderator_by_tids($threadlist, 'canmanagethreads'))
{

Zeile 2161Zeile 2163
			error($lang->error_invalidforum, $lang->error);
}


			error($lang->error_invalidforum, $lang->error);
}


		$moderation->move_threads($tids, $moveto);

		$plugins->run_hooks('moderation_do_multimovethreads');


log_moderator_action($modlogdata, $lang->multi_moved_threads);


log_moderator_action($modlogdata, $lang->multi_moved_threads);












		$expire = 0;
if($mybb->get_input('redirect_expire', MyBB::INPUT_INT) > 0)
{
$expire = TIME_NOW + ($mybb->get_input('redirect_expire', MyBB::INPUT_INT) * 86400);
}

foreach($tids as $tid) {
$moderation->move_thread($tid, $moveto, $method, $expire);
}


		moderation_redirect(get_forum_link($moveto), $lang->redirect_inline_threadsmoved);
break;


		moderation_redirect(get_forum_link($moveto), $lang->redirect_inline_threadsmoved);
break;


Zeile 2175Zeile 2186
		if($mybb->get_input('inlinetype') == 'search')
{
$posts = getids($mybb->get_input('searchid'), 'search');

		if($mybb->get_input('inlinetype') == 'search')
{
$posts = getids($mybb->get_input('searchid'), 'search');

		}
else

		}
else

		{
$posts = getids($tid, 'thread');
}

if(count($posts) < 1)

		{
$posts = getids($tid, 'thread');
}

if(count($posts) < 1)

		{

		{

			error($lang->error_inline_nopostsselected, $lang->error);
}
if(!is_moderator_by_pids($posts, "candeleteposts"))

			error($lang->error_inline_nopostsselected, $lang->error);
}
if(!is_moderator_by_pids($posts, "candeleteposts"))

Zeile 2193Zeile 2204
		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');

		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');

		}

		}

		else
{
clearinline($tid, 'thread');

		else
{
clearinline($tid, 'thread');

Zeile 2206Zeile 2217
		break;

// Actually delete the posts in inline moderation

		break;

// Actually delete the posts in inline moderation

	case "do_multideleteposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	case "do_multideleteposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


		$postlist = explode("|", $mybb->get_input('posts'));
if(!is_moderator_by_pids($postlist, "candeleteposts"))
{

		$postlist = explode("|", $mybb->get_input('posts'));
if(!is_moderator_by_pids($postlist, "candeleteposts"))
{

Zeile 2301Zeile 2312
				}
// Remove the cookie once its data is retrieved
my_unsetcookie($key);

				}
// Remove the cookie once its data is retrieved
my_unsetcookie($key);

			}
}


			}
}


		if(empty($posts))
{
error($lang->error_inline_nopostsselected, $lang->error);

		if(empty($posts))
{
error($lang->error_inline_nopostsselected, $lang->error);

Zeile 2393Zeile 2404
	// Split posts - Inline moderation
case "multisplitposts":
add_breadcrumb($lang->nav_multi_splitposts);

	// Split posts - Inline moderation
case "multisplitposts":
add_breadcrumb($lang->nav_multi_splitposts);


if($mybb->get_input('inlinetype') == 'search')
{
$posts = getids($mybb->get_input('searchid'), 'search');
}
else
{
$posts = getids($tid, 'thread');
}

if(count($posts) < 1)
{
error($lang->error_inline_nopostsselected, $lang->error);
}

if(!is_moderator_by_pids($posts, "canmanagethreads"))
{
error_no_permission();
}
$posts = array_map('intval', $posts);
$pidin = implode(',', $posts);

// Make sure that we are not splitting a thread with one post
// Select number of posts in each thread that the splitted post is in
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin)
GROUP BY p.tid, p.pid
");
$threads = $pcheck = array();
while($tcheck = $db->fetch_array($query))
{
if((int)$tcheck['count'] <= 1)
{
error($lang->error_cantsplitonepost, $lang->error);
}
$threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
}

// Make sure that we are not splitting all posts in the thread
// The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal)
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin)
GROUP BY p.tid, p.pid
");
$pcheck2 = array();


if($mybb->get_input('inlinetype') == 'search')
{
$posts = getids($mybb->get_input('searchid'), 'search');
}
else
{
$posts = getids($tid, 'thread');
}

if(count($posts) < 1)
{
error($lang->error_inline_nopostsselected, $lang->error);
}

if(!is_moderator_by_pids($posts, "canmanagethreads"))
{
error_no_permission();
}
$posts = array_map('intval', $posts);
$pidin = implode(',', $posts);

// Make sure that we are not splitting a thread with one post
// Select number of posts in each thread that the splitted post is in
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin)
GROUP BY p.tid, p.pid
");
$threads = $pcheck = array();
while($tcheck = $db->fetch_array($query))
{
if((int)$tcheck['count'] <= 1)
{
error($lang->error_cantsplitonepost, $lang->error);
}
$threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
}

// Make sure that we are not splitting all posts in the thread
// The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal)
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin)
GROUP BY p.tid, p.pid
");
$pcheck2 = array();

		while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)

		while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)

Zeile 2455Zeile 2466
		{
// One or more threads do not have posts after splitting
error($lang->error_cantsplitall, $lang->error);

		{
// One or more threads do not have posts after splitting
error($lang->error_cantsplitall, $lang->error);

		}

		}


$inlineids = implode("|", $posts);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');


$inlineids = implode("|", $posts);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');

		}

		}

		else
{
clearinline($tid, 'thread');

		else
{
clearinline($tid, 'thread');

Zeile 2472Zeile 2483

eval("\$splitposts = \"".$templates->get("moderation_inline_splitposts")."\";");
output_page($splitposts);


eval("\$splitposts = \"".$templates->get("moderation_inline_splitposts")."\";");
output_page($splitposts);

		break;

// Actually split the posts - Inline moderation
case "do_multisplitposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

$plist = array();
$postlist = explode("|", $mybb->get_input('posts'));
foreach($postlist as $pid)
{
$pid = (int)$pid;
$plist[] = $pid;
}

if(!is_moderator_by_pids($plist, "canmanagethreads"))
{

		break;

// Actually split the posts - Inline moderation
case "do_multisplitposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

$plist = array();
$postlist = explode("|", $mybb->get_input('posts'));
foreach($postlist as $pid)
{
$pid = (int)$pid;
$plist[] = $pid;
}

if(!is_moderator_by_pids($plist, "canmanagethreads"))
{

			error_no_permission();
}


			error_no_permission();
}


Zeile 2722Zeile 2733
		else
{
$newtid = 0;

		else
{
$newtid = 0;

		}

		}

		$newtid = (int)$newtid;
$newthread = get_thread($newtid);
if(!$newthread)

		$newtid = (int)$newtid;
$newthread = get_thread($newtid);
if(!$newthread)

Zeile 2732Zeile 2743
		if($newtid == $tid)
{ // sanity check
error($lang->error_movetoself, $lang->error);

		if($newtid == $tid)
{ // sanity check
error($lang->error_movetoself, $lang->error);

		}


		}


		$postlist = explode("|", $mybb->get_input('posts'));
$plist = array();
foreach($postlist as $pid)

		$postlist = explode("|", $mybb->get_input('posts'));
$plist = array();
foreach($postlist as $pid)

Zeile 2750Zeile 2761
		// Ensure all posts exist
$posts = array();
if(!empty($plist))

		// Ensure all posts exist
$posts = array();
if(!empty($plist))

		{

		{

			$query = $db->simple_select('posts', 'pid', 'pid IN ('.implode(',', $plist).')');
while($pid = $db->fetch_field($query, 'pid'))
{

			$query = $db->simple_select('posts', 'pid', 'pid IN ('.implode(',', $plist).')');
while($pid = $db->fetch_field($query, 'pid'))
{

Zeile 2767Zeile 2778

// Make sure that we are not moving posts in a thread with one post
// Select number of posts in each thread that the moved post is in


// Make sure that we are not moving posts in a thread with one post
// Select number of posts in each thread that the moved post is in

		$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count

		$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count

			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin)

			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin)

Zeile 2780Zeile 2791
			if((int)$tcheck['count'] <= 1)
{
error($lang->error_cantsplitonepost, $lang->error);

			if((int)$tcheck['count'] <= 1)
{
error($lang->error_cantsplitonepost, $lang->error);

			}

			}

			$threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
}


			$threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
}


Zeile 2814Zeile 2825
		log_moderator_action($modlogdata, $lang->move_selective_posts);

moderation_redirect(get_thread_link($newtid), $lang->redirect_moveposts);

		log_moderator_action($modlogdata, $lang->move_selective_posts);

moderation_redirect(get_thread_link($newtid), $lang->redirect_moveposts);

		break;


		break;


	// Approve posts - Inline moderation
case "multiapproveposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

	// Approve posts - Inline moderation
case "multiapproveposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





		if($mybb->get_input('inlinetype') == 'search')

		if($mybb->get_input('inlinetype') == 'search')

		{

		{

			$posts = getids($mybb->get_input('searchid'), 'search');

			$posts = getids($mybb->get_input('searchid'), 'search');

		}
else
{

		}
else
{

			$posts = getids($tid, 'thread');
}
if(count($posts) < 1)
{
error($lang->error_inline_nopostsselected, $lang->error);

			$posts = getids($tid, 'thread');
}
if(count($posts) < 1)
{
error($lang->error_inline_nopostsselected, $lang->error);

		}

		}


if(!is_moderator_by_pids($posts, "canapproveunapproveposts"))
{
error_no_permission();


if(!is_moderator_by_pids($posts, "canapproveunapproveposts"))
{
error_no_permission();

		}

		}


$pids = array();
foreach($posts as $pid)
{
$pids[] = (int)$pid;


$pids = array();
foreach($posts as $pid)
{
$pids[] = (int)$pid;

		}


		}


		$moderation->approve_posts($pids);

log_moderator_action($modlogdata, $lang->multi_approve_posts);
if($mybb->get_input('inlinetype') == 'search')

		$moderation->approve_posts($pids);

log_moderator_action($modlogdata, $lang->multi_approve_posts);
if($mybb->get_input('inlinetype') == 'search')

		{

		{

			clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else

			clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else

Zeile 2861Zeile 2872
		break;

// Unapprove posts - Inline moderation

		break;

// Unapprove posts - Inline moderation

	case "multiunapproveposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if($mybb->get_input('inlinetype') == 'search')

	case "multiunapproveposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if($mybb->get_input('inlinetype') == 'search')

		{
$posts = getids($mybb->get_input('searchid'), 'search');

		{
$posts = getids($mybb->get_input('searchid'), 'search');

		}
else
{

		}
else
{

			$posts = getids($tid, 'thread');
}


			$posts = getids($tid, 'thread');
}


Zeile 2882Zeile 2893
		$pids = array();

if(!is_moderator_by_pids($posts, "canapproveunapproveposts"))

		$pids = array();

if(!is_moderator_by_pids($posts, "canapproveunapproveposts"))

		{

		{

			error_no_permission();

			error_no_permission();

		}

		}

		foreach($posts as $pid)
{
$pids[] = (int)$pid;

		foreach($posts as $pid)
{
$pids[] = (int)$pid;

		}

		}


$moderation->unapprove_posts($pids);



$moderation->unapprove_posts($pids);


Zeile 2905Zeile 2916
		break;

// Restore posts - Inline moderation

		break;

// Restore posts - Inline moderation

	case "multirestoreposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

	case "multirestoreposts":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


if($mybb->get_input('inlinetype') == 'search')
{
$posts = getids($mybb->get_input('searchid'), 'search');


if($mybb->get_input('inlinetype') == 'search')
{
$posts = getids($mybb->get_input('searchid'), 'search');

		}
else

		}
else

		{
$posts = getids($tid, 'thread');
}

		{
$posts = getids($tid, 'thread');
}

Zeile 2926Zeile 2937
		if(!is_moderator_by_pids($posts, "canrestoreposts"))
{
error_no_permission();

		if(!is_moderator_by_pids($posts, "canrestoreposts"))
{
error_no_permission();

		}

		}


$pids = array();
foreach($posts as $pid)


$pids = array();
foreach($posts as $pid)

Zeile 2951Zeile 2962
	// Soft delete posts - Inline moderation
case "multisoftdeleteposts":
// Verify incoming POST request

	// Soft delete posts - Inline moderation
case "multisoftdeleteposts":
// Verify incoming POST request

		verify_post_check($mybb->get_input('my_post_key'));

if($mybb->get_input('inlinetype') == 'search')
{

		verify_post_check($mybb->get_input('my_post_key'));

if($mybb->get_input('inlinetype') == 'search')
{

			$posts = getids($mybb->get_input('searchid'), 'search');
}
else

			$posts = getids($mybb->get_input('searchid'), 'search');
}
else

Zeile 3070Zeile 3081
				// Clear the profile
$userhandler->clear_profile($uid, $mybb->settings['purgespammerbangroup']);


				// Clear the profile
$userhandler->clear_profile($uid, $mybb->settings['purgespammerbangroup']);


				$cache->update_banned();

 
				$cache->update_bannedips();
$cache->update_awaitingactivation();


				$cache->update_bannedips();
$cache->update_awaitingactivation();


Zeile 3093Zeile 3103
			if($user_deleted)
{
redirect($mybb->settings['bburl'], $lang->purgespammer_success);

			if($user_deleted)
{
redirect($mybb->settings['bburl'], $lang->purgespammer_success);

			}
else
{

			}
else
{

				redirect(get_profile_link($uid), $lang->purgespammer_success);
}
}

				redirect(get_profile_link($uid), $lang->purgespammer_success);
}
}

Zeile 3141Zeile 3151
			if(!empty($options['confirmation']) && empty($mybb->input['confirm']))
{
add_breadcrumb($lang->confirm_execute_tool);

			if(!empty($options['confirmation']) && empty($mybb->input['confirm']))
{
add_breadcrumb($lang->confirm_execute_tool);





				$lang->confirm_execute_tool_desc = $lang->sprintf($lang->confirm_execute_tool_desc, htmlspecialchars_uni($tool['name']));


				$lang->confirm_execute_tool_desc = $lang->sprintf($lang->confirm_execute_tool_desc, htmlspecialchars_uni($tool['name']));


				$action = $mybb->input['action'];
$modtype = $mybb->get_input('modtype');
$inlinetype = $mybb->get_input('inlinetype');
$searchid = $mybb->get_input('searchid');

				$action = $mybb->get_input('action', MyBB::INPUT_INT);
$modtype = htmlspecialchars_uni($mybb->get_input('modtype'));
$inlinetype = htmlspecialchars_uni($mybb->get_input('inlinetype'));
$searchid = $mybb->get_input('searchid', MyBB::INPUT_INT);

				$url = htmlspecialchars_uni($mybb->get_input('url'));
$plugins->run_hooks('moderation_confirmation');


				$url = htmlspecialchars_uni($mybb->get_input('url'));
$plugins->run_hooks('moderation_confirmation');


Zeile 3164Zeile 3174
				if($mybb->get_input('inlinetype') == 'search')
{
$tids = getids($mybb->get_input('searchid'), 'search');

				if($mybb->get_input('inlinetype') == 'search')
{
$tids = getids($mybb->get_input('searchid'), 'search');

				}

				}

				else
{
$tids = getids($fid, "forum");

				else
{
$tids = getids($fid, "forum");

Zeile 3174Zeile 3184
					error($lang->error_inline_nopostsselected, $lang->error);
}
if(!is_moderator_by_tids($tids, "canusecustomtools"))

					error($lang->error_inline_nopostsselected, $lang->error);
}
if(!is_moderator_by_tids($tids, "canusecustomtools"))

				{

				{

					error_no_permission();
}


					error_no_permission();
}


Zeile 3185Zeile 3195
				}

$custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tids);

				}

$custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tids);

 				$lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']);
log_moderator_action($modlogdata, $lang->custom_tool);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->get_input('url'));
redirect($return_url, $lang->redirect_customtool_search);
}

 				$lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']);
log_moderator_action($modlogdata, $lang->custom_tool);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->get_input('url'));
moderation_redirect($return_url, $lang->redirect_customtool_search);
}

				else
{
clearinline($fid, "forum");
$lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']);
redirect(get_forum_link($fid), $lang->redirect_customtool_forum);

				else
{
clearinline($fid, "forum");
$lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']);
redirect(get_forum_link($fid), $lang->redirect_customtool_forum);

				}

				}

				break;
}
elseif($tool['type'] == 't' && $mybb->get_input('modtype') == 'thread')
{
if(!is_moderator_by_tids($tid, "canusecustomtools"))

				break;
}
elseif($tool['type'] == 't' && $mybb->get_input('modtype') == 'thread')
{
if(!is_moderator_by_tids($tid, "canusecustomtools"))

				{

				{

					error_no_permission();
}

$thread_options = my_unserialize($tool['threadoptions']);
if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")

					error_no_permission();
}

$thread_options = my_unserialize($tool['threadoptions']);
if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")

				{

				{

					error($lang->error_movetocategory, $lang->error);
}


					error($lang->error_movetocategory, $lang->error);
}


Zeile 3222Zeile 3232
				{
$lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']);
moderation_redirect(get_forum_link($fid), $lang->redirect_customtool_forum);

				{
$lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']);
moderation_redirect(get_forum_link($fid), $lang->redirect_customtool_forum);

				}

				}

				else
{
$lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);

				else
{
$lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);

Zeile 3235Zeile 3245
				if($mybb->get_input('inlinetype') == 'search')
{
$pids = getids($mybb->get_input('searchid'), 'search');

				if($mybb->get_input('inlinetype') == 'search')
{
$pids = getids($mybb->get_input('searchid'), 'search');

				}
else
{
$pids = getids($tid, 'thread');
}

				}
else
{
$pids = getids($tid, 'thread');
}


if(count($pids) < 1)
{


if(count($pids) < 1)
{

Zeile 3270Zeile 3280
					clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

					clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

					redirect($return_url, $lang->redirect_customtool_search);

					moderation_redirect($return_url, $lang->redirect_customtool_search);

				}
else
{

				}
else
{

Zeile 3331Zeile 3341
	}

return $newids;

	}

return $newids;

}

/**

}

/**

 * @param int $id
* @param string $type
*

 * @param int $id
* @param string $type
*

Zeile 3473Zeile 3483
 * @param array $threads Array of thread IDs
* @param string $permission Permission to check
* @return bool True if moderator of all; false otherwise

 * @param array $threads Array of thread IDs
* @param string $permission Permission to check
* @return bool True if moderator of all; false otherwise

 */

 */

function is_moderator_by_tids($threads, $permission='')
{
global $db, $mybb;

function is_moderator_by_tids($threads, $permission='')
{
global $db, $mybb;

Zeile 3491Zeile 3501
	if(!is_array($threads))
{
$threads = array($threads);

	if(!is_array($threads))
{
$threads = array($threads);

	}

	}

	// Validate input
$threads = array_map('intval', $threads);
$threads[] = 0;

	// Validate input
$threads = array_map('intval', $threads);
$threads[] = 0;

Zeile 3519Zeile 3529
	global $mybb;
if(!empty($mybb->input['url']))
{

	global $mybb;
if(!empty($mybb->input['url']))
{

		redirect(htmlentities($mybb->input['url']), $message, $title);

		$url = htmlentities($mybb->input['url']);

	}

	}

 

if(my_strpos($url, $mybb->settings['bburl'].'/') !== 0)
{
if(my_strpos($url, '/') === 0)
{
$url = my_substr($url, 1);
}
$url_segments = explode('/', $url);
$url = $mybb->settings['bburl'].'/'.end($url_segments);
}


	redirect($url, $message, $title);
}

	redirect($url, $message, $title);
}