Vergleich moderation.php - 1.8.21 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 39Zeile 39
$fid = $mybb->get_input('fid', MyBB::INPUT_INT);
$pmid = $mybb->get_input('pmid', MyBB::INPUT_INT);
$modal = $mybb->get_input('modal', MyBB::INPUT_INT);

$fid = $mybb->get_input('fid', MyBB::INPUT_INT);
$pmid = $mybb->get_input('pmid', MyBB::INPUT_INT);
$modal = $mybb->get_input('modal', MyBB::INPUT_INT);

 

if($mybb->user['uid'] == 0)
{
error_no_permission();
}



if($pid)
{


if($pid)
{

Zeile 46Zeile 52
	if(!$post)
{
error($lang->error_invalidpost, $lang->error);

	if(!$post)
{
error($lang->error_invalidpost, $lang->error);

	}

	}

	$tid = $post['tid'];
}


	$tid = $post['tid'];
}


Zeile 73Zeile 79
}

if($pmid > 0)

}

if($pmid > 0)

{

{

	$query = $db->simple_select('privatemessages', 'uid, subject, ipaddress, fromid', "pmid = $pmid");

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

	$query = $db->simple_select('privatemessages', 'uid, subject, ipaddress, fromid', "pmid = $pmid");

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

Zeile 93Zeile 99
		break;
case "allreports":
add_breadcrumb($lang->all_reported_posts);

		break;
case "allreports":
add_breadcrumb($lang->all_reported_posts);

		break;

		break;


}



}


Zeile 105Zeile 111
}

if(isset($forum))

}

if(isset($forum))

{

{

	// Check if this forum is password protected and we have a valid password
check_forum_password($forum['fid']);
}

	// Check if this forum is password protected and we have a valid password
check_forum_password($forum['fid']);
}

Zeile 123Zeile 129
	}

$modlogdata['tids'] = (array)$tids;

	}

$modlogdata['tids'] = (array)$tids;





	unset($tids);
}

	unset($tids);
}





$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);
eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");

$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);
eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");





$allowable_moderation_actions = array("getip", "getpmip", "cancel_delayedmoderation", "delayedmoderation", "threadnotes", "purgespammer", "viewthreadnotes");

if($mybb->request_method != "post" && !in_array($mybb->input['action'], $allowable_moderation_actions))

$allowable_moderation_actions = array("getip", "getpmip", "cancel_delayedmoderation", "delayedmoderation", "threadnotes", "purgespammer", "viewthreadnotes");

if($mybb->request_method != "post" && !in_array($mybb->input['action'], $allowable_moderation_actions))

Zeile 142Zeile 148
{
// Delayed Moderation
case "cancel_delayedmoderation":

{
// Delayed Moderation
case "cancel_delayedmoderation":

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

add_breadcrumb($lang->delayed_moderation);
if(!is_moderator($fid, "canmanagethreads"))
{

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

add_breadcrumb($lang->delayed_moderation);
if(!is_moderator($fid, "canmanagethreads"))
{

			error_no_permission();
}


			error_no_permission();
}


Zeile 255Zeile 261
					$query = $db->simple_select("modtools", 'tid, name, `groups`', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");
}
while($tool = $db->fetch_array($query))

					$query = $db->simple_select("modtools", 'tid, name, `groups`', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");
}
while($tool = $db->fetch_array($query))

			{

			{

				if(is_member($tool['groups']))
{
$allowed_types[] = "modtool_".$tool['tid'];

				if(is_member($tool['groups']))
{
$allowed_types[] = "modtool_".$tool['tid'];

Zeile 363Zeile 369

$rundate_format = my_date('relative', $rundate, '', 2);
$lang->redirect_delayed_moderation_thread = $lang->sprintf($lang->redirect_delayed_moderation_thread, $rundate_format);


$rundate_format = my_date('relative', $rundate, '', 2);
$lang->redirect_delayed_moderation_thread = $lang->sprintf($lang->redirect_delayed_moderation_thread, $rundate_format);





				if(!empty($mybb->input['tid']))
{
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_delayed_moderation_thread);

				if(!empty($mybb->input['tid']))
{
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_delayed_moderation_thread);

Zeile 420Zeile 426
			$method_selected = array('move' => 'checked="checked"', 'redirect' => '', 'copy' => '');

$mybb->input['delayedmoderation']['redirect_expire'] = '';

			$method_selected = array('move' => 'checked="checked"', 'redirect' => '', 'copy' => '');

$mybb->input['delayedmoderation']['redirect_expire'] = '';

			$mybb->input['delayedmoderation']['subject'] = $thread['subject'];

			$mybb->input['delayedmoderation']['subject'] = isset($thread['subject']) ? $thread['subject'] : '';

			$mybb->input['delayedmoderation']['threadurl'] = '';

$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "delayedmoderation[new_forum]");

			$mybb->input['delayedmoderation']['threadurl'] = '';

$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "delayedmoderation[new_forum]");

Zeile 468Zeile 474
		if($tid == 0)
{
// Inline thread moderation is used

		if($tid == 0)
{
// Inline thread moderation is used

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

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

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

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

Zeile 532Zeile 538
					");
}
}

					");
}
}

		



		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 550Zeile 556
			else
{
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_multiple")."\";");

			else
{
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_multiple")."\";");

			}

			}


if($delayedmod['fname'])
{


if($delayedmod['fname'])
{

Zeile 581Zeile 587
				}
}
elseif($delayedmod['type'] == 'merge')

				}
}
elseif($delayedmod['type'] == 'merge')

			{

			{

				$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_merge")."\";");

				$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_merge")."\";");

Zeile 791Zeile 797
	case "deletethread":

add_breadcrumb($lang->nav_deletethread);

	case "deletethread":

add_breadcrumb($lang->nav_deletethread);


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


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

		}

		}





		$plugins->run_hooks("moderation_deletethread");

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

		$plugins->run_hooks("moderation_deletethread");

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

		break;


		break;


	// Delete the actual thread here
case "do_deletethread":

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

	// Delete the actual thread here
case "do_deletethread":

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





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

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

// Log the subject of the deleted thread
$modlogdata['thread_subject'] = $thread['subject'];

		$plugins->run_hooks("moderation_do_deletethread");

// Log the subject of the deleted thread
$modlogdata['thread_subject'] = $thread['subject'];





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

Zeile 838Zeile 844
	// Delete the poll from a thread confirmation page
case "deletepoll":
add_breadcrumb($lang->nav_deletepoll);

	// Delete the poll from a thread confirmation page
case "deletepoll":
add_breadcrumb($lang->nav_deletepoll);





		if(!is_moderator($fid, "canmanagepolls"))
{
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid'])

		if(!is_moderator($fid, "canmanagepolls"))
{
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid'])

Zeile 850Zeile 856
		$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)

		$poll = $db->fetch_array($query);
if(!$poll)

		{
error($lang->error_invalidpoll, $lang->error);
}

		{
error($lang->error_invalidpoll, $lang->error);
}

Zeile 861Zeile 867
		break;

// Delete the actual poll here!

		break;

// Delete the actual poll here!

	case "do_deletepoll":


	case "do_deletepoll":


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

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

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

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

		}

		}


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


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

Zeile 881Zeile 887
			{
error_no_permission();
}

			{
error_no_permission();
}

		}

		}

		$query = $db->simple_select("polls", "pid", "tid = $tid");
$poll = $db->fetch_array($query);
if(!$poll)
{
error($lang->error_invalidpoll, $lang->error);
}

		$query = $db->simple_select("polls", "pid", "tid = $tid");
$poll = $db->fetch_array($query);
if(!$poll)
{
error($lang->error_invalidpoll, $lang->error);
}





		$plugins->run_hooks("moderation_do_deletepoll");

$lang->poll_deleted = $lang->sprintf($lang->poll_deleted, $thread['subject']);

		$plugins->run_hooks("moderation_do_deletepoll");

$lang->poll_deleted = $lang->sprintf($lang->poll_deleted, $thread['subject']);

Zeile 901Zeile 907

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

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

$thread = get_thread($tid);

$plugins->run_hooks("moderation_approvethread");



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

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

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

$thread = get_thread($tid);

$plugins->run_hooks("moderation_approvethread");


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

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





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

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

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

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

		break;

		break;


// Unapprove a thread
case "unapprovethread":


// Unapprove a thread
case "unapprovethread":

Zeile 957Zeile 963

// Restore a thread
case "restorethread":


// Restore a thread
case "restorethread":


// Verify incoming POST request


// Verify incoming POST request

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

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

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

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

Zeile 1014Zeile 1020

$plugins->run_hooks("moderation_move");



$plugins->run_hooks("moderation_move");


		$forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto");

		$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");

		eval("\$movethread = \"".$templates->get("moderation_move")."\";");
output_page($movethread);
break;

		eval("\$movethread = \"".$templates->get("moderation_move")."\";");
output_page($movethread);
break;

Zeile 1046Zeile 1052
		
$newperms = forum_permissions($moveto);
if($newperms['canview'] == 0 && !is_moderator($fid, "canmovetononmodforum"))

		
$newperms = forum_permissions($moveto);
if($newperms['canview'] == 0 && !is_moderator($fid, "canmovetononmodforum"))

		{

		{

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

$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')

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

$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')

		{

		{

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

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

		}

		}

		if($method != "copy" && $thread['fid'] == $moveto)
{
error($lang->error_movetosameforum, $lang->error);

		if($method != "copy" && $thread['fid'] == $moveto)
{
error($lang->error_movetosameforum, $lang->error);

		}


		}


		$plugins->run_hooks('moderation_do_move');

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

		$plugins->run_hooks('moderation_do_move');

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

		}

		}


$the_thread = $tid;



$the_thread = $tid;


Zeile 1136Zeile 1142
			$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 1232
		$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 1284Zeile 1290
		{
$cols = 4;
eval("\$delayedmods = \"".$templates->get("moderation_delayedmodaction_error")."\";");

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

$plugins->run_hooks("moderation_do_threadnotes");

		{
error_no_permission();
}

$plugins->run_hooks("moderation_do_threadnotes");


log_moderator_action($modlogdata, $lang->thread_notes_edited);
$sqlarray = array(


log_moderator_action($modlogdata, $lang->thread_notes_edited);
$sqlarray = array(

Zeile 1336Zeile 1342
		if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canuseipsearch'] == 1)
{
$ipaddress = $post['ipaddress'];

		if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canuseipsearch'] == 1)
{
$ipaddress = $post['ipaddress'];

			eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");
}


			eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");
}


		$plugins->run_hooks('moderation_getip');

if($modal)

		$plugins->run_hooks('moderation_getip');

if($modal)

Zeile 1489Zeile 1495
		elseif(!empty($parameters['tid']))
{
$mergetid = (int)$parameters['tid'];

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

		}
else
{

		}
else
{

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

			$mergetid = 0;
}
$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();
}
if(isset($mybb->input['subject']))

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

Zeile 1514Zeile 1520
		else
{
$subject = $thread['subject'];

		else
{
$subject = $thread['subject'];

		}

$moderation->merge_threads($mergetid, $tid, $subject);


		}

$moderation->merge_threads($mergetid, $tid, $subject);


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

moderation_redirect(get_thread_link($tid), $lang->redirect_threadsmerged);

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

moderation_redirect(get_thread_link($tid), $lang->redirect_threadsmerged);

Zeile 1529Zeile 1535
		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 1541Zeile 1547
			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE tid='$tid'

			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE tid='$tid'

			ORDER BY dateline ASC

			ORDER BY dateline ASC, pid ASC

		");

		");





		$numposts = $db->num_rows($query);
if($numposts <= 1)
{
error($lang->error_cantsplitonepost, $lang->error);

		$numposts = $db->num_rows($query);
if($numposts <= 1)
{
error($lang->error_cantsplitonepost, $lang->error);

		}

		}


$altbg = "trow1";
$posts = '';
while($post = $db->fetch_array($query))


$altbg = "trow1";
$posts = '';
while($post = $db->fetch_array($query))

		{

		{

			$postdate = my_date('relative', $post['dateline']);
$post['username'] = htmlspecialchars_uni($post['username']);


			$postdate = my_date('relative', $post['dateline']);
$post['username'] = htmlspecialchars_uni($post['username']);


Zeile 1569Zeile 1575
			{
$parser_options['allow_smilies'] = 0;
}

			{
$parser_options['allow_smilies'] = 0;
}





			$message = $parser->parse_message($post['message'], $parser_options);
eval("\$posts .= \"".$templates->get("moderation_split_post")."\";");
$altbg = alt_trow();

			$message = $parser->parse_message($post['message'], $parser_options);
eval("\$posts .= \"".$templates->get("moderation_split_post")."\";");
$altbg = alt_trow();

Zeile 1586Zeile 1592

// Let's break them up buddy! (Do the split)
case "do_split":


// Let's break them up buddy! (Do the split)
case "do_split":


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

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

if($thread['visible'] == -1)


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

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

if($thread['visible'] == -1)

		{
error($lang->error_thread_deleted, $lang->error);
}

		{
error($lang->error_thread_deleted, $lang->error);
}

Zeile 1621Zeile 1627
		}

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

		}

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

		{

		{

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

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

		}

		}

		else
{
$moveto = $fid;

		else
{
$moveto = $fid;

		}


		}


		$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')
{
error($lang->error_invalidforum, $lang->error);
}

		$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')
{
error($lang->error_invalidforum, $lang->error);
}





		$pids = array();

// move the selected posts over

		$pids = array();

// move the selected posts over

Zeile 1646Zeile 1652
				$pids[] = $post['pid'];
}
mark_reports($post['pid'], "post");

				$pids[] = $post['pid'];
}
mark_reports($post['pid'], "post");

		}


		}


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

Zeile 1664Zeile 1670
		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 1689Zeile 1695
			// 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();
}

			{
error_no_permission();
}

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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

		}
if(count($threads) < 1)
{

		}
if(count($threads) < 1)
{

Zeile 1707Zeile 1713
		}

$inlineids = implode("|", $threads);

		}

$inlineids = implode("|", $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');
}
$return_url = htmlspecialchars_uni($mybb->get_input('url'));
eval("\$multidelete = \"".$templates->get("moderation_inline_deletethreads")."\";");
output_page($multidelete);

			clearinline($fid, 'forum');
}
$return_url = htmlspecialchars_uni($mybb->get_input('url'));
eval("\$multidelete = \"".$templates->get("moderation_inline_deletethreads")."\";");
output_page($multidelete);

		break;


		break;


	// Actually delete the threads - Inline moderation
case "do_multideletethreads":

	// Actually delete the threads - Inline moderation
case "do_multideletethreads":


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


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

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

Zeile 1751Zeile 1757
		break;

// Open threads - Inline moderation

		break;

// Open threads - Inline moderation

	case "multiopenthreads":

// 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, 'canopenclosethreads'))
{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canopenclosethreads'))
{
error_no_permission();
}
}

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


	case "multiopenthreads":

// 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, 'canopenclosethreads'))
{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canopenclosethreads'))
{
error_no_permission();
}
}

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


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

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

		}
else
{

		}
else
{

Zeile 1804Zeile 1810
			// 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();
}
}

				error_no_permission();
}
}

Zeile 1824Zeile 1830
		$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')

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

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

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

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

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

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

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

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

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

Zeile 1955Zeile 1961
		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
{

		}
else
{

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

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





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


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


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

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

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

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

			{
error_no_permission();
}
}
if(count($threads) < 1)









		{

		{

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

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

		}

		}

		else
{










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

			clearinline($fid, 'forum');
}
$cache->update_stats();

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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

		}
else
{

		}
else
{

Zeile 2034Zeile 2040
		{
error($lang->error_inline_nothreadsselected, $lang->error);
}

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





		$moderation->stick_threads($threads);

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

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

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

		else
{
clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsstuck);

		break;


		break;


	// Unstick threads - Inline moderaton
case "multiunstickthreads":

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

	// Unstick threads - Inline moderaton
case "multiunstickthreads":

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

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

			{
error_no_permission();

			}
}
else

			}
}
else

Zeile 2081Zeile 2087

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


log_moderator_action($modlogdata, $lang->multi_unstuck_threads);
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 2093Zeile 2099

// Move threads - Inline moderation
case "multimovethreads":


// Move threads - Inline moderation
case "multimovethreads":

		add_breadcrumb($lang->nav_multi_movethreads);


		add_breadcrumb($lang->nav_multi_movethreads);


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

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

			{
error_no_permission();
}
}
else
{

			{
error_no_permission();
}
}
else
{

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

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

		}

		}


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 2139Zeile 2145
		verify_post_check($mybb->get_input('my_post_key'));

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

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

$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 2169
			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 2171Zeile 2188
	// Delete posts - Inline moderation
case "multideleteposts":
add_breadcrumb($lang->nav_multi_deleteposts);

	// Delete posts - Inline moderation
case "multideleteposts":
add_breadcrumb($lang->nav_multi_deleteposts);


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


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

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

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

Zeile 2188Zeile 2205
		if(!is_moderator_by_pids($posts, "candeleteposts"))
{
error_no_permission();

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

		}

		}

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





		$return_url = htmlspecialchars_uni($mybb->get_input('url'));

eval("\$multidelete = \"".$templates->get("moderation_inline_deleteposts")."\";");
output_page($multidelete);

		$return_url = htmlspecialchars_uni($mybb->get_input('url'));

eval("\$multidelete = \"".$templates->get("moderation_inline_deleteposts")."\";");
output_page($multidelete);

		break;

		break;


// Actually delete the posts in inline moderation
case "do_multideleteposts":


// Actually delete the posts in inline moderation
case "do_multideleteposts":

Zeile 2301Zeile 2318
				}
// 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))

		}

if(empty($posts))

		{

		{

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

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

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

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

		{

		{

			error_no_permission();
}


			error_no_permission();
}


Zeile 2319Zeile 2336
			SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)

			SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)

			WHERE pid IN (".implode($posts, ",").")
ORDER BY dateline ASC

			WHERE pid IN (".implode(",", $posts).")
ORDER BY dateline ASC, pid ASC

		");
$altbg = "trow1";
while($post = $db->fetch_array($query))

		");
$altbg = "trow1";
while($post = $db->fetch_array($query))

Zeile 2343Zeile 2360
			$message = $parser->parse_message($post['message'], $parser_options);
eval("\$postlist .= \"".$templates->get("moderation_mergeposts_post")."\";");
$altbg = alt_trow();

			$message = $parser->parse_message($post['message'], $parser_options);
eval("\$postlist .= \"".$templates->get("moderation_mergeposts_post")."\";");
$altbg = alt_trow();

		}

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


		}

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


		$return_url = htmlspecialchars_uni($mybb->get_input('url'));

eval("\$multimerge = \"".$templates->get("moderation_inline_mergeposts")."\";");
output_page($multimerge);

		$return_url = htmlspecialchars_uni($mybb->get_input('url'));

eval("\$multimerge = \"".$templates->get("moderation_inline_mergeposts")."\";");
output_page($multimerge);

		break;


		break;


	// Actually merge the posts - Inline moderation
case "do_multimergeposts":

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

	// Actually merge the posts - Inline moderation
case "do_multimergeposts":

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





		$mergepost = $mybb->get_input('mergepost', MyBB::INPUT_ARRAY);
if(count($mergepost) <= 1)
{
error($lang->error_nomergeposts, $lang->error);

		$mergepost = $mybb->get_input('mergepost', MyBB::INPUT_ARRAY);
if(count($mergepost) <= 1)
{
error($lang->error_nomergeposts, $lang->error);

		}


		}


		foreach($mergepost as $pid => $yes)
{
$postlist[] = (int)$pid;

		foreach($mergepost as $pid => $yes)
{
$postlist[] = (int)$pid;

Zeile 2384Zeile 2401
		}

$masterpid = $moderation->merge_posts($postlist, $tid, $mybb->input['sep']);

		}

$masterpid = $moderation->merge_posts($postlist, $tid, $mybb->input['sep']);





		mark_reports($postlist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_post_link($masterpid)."#pid$masterpid", $lang->redirect_inline_postsmerged);

		mark_reports($postlist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_post_link($masterpid)."#pid$masterpid", $lang->redirect_inline_postsmerged);

Zeile 2393Zeile 2410
	// 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();
while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)
{
$pcheck2[] = $tcheck['tid'];
}
}
if(count($pcheck2) != count($pcheck))
{


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)
{
$pcheck2[] = $tcheck['tid'];
}
}
if(count($pcheck2) != count($pcheck))
{

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

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

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

		}

		}

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

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

		}

		}

		$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");

$return_url = htmlspecialchars_uni($mybb->get_input('url'));

		$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");

$return_url = htmlspecialchars_uni($mybb->get_input('url'));

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

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

		{

		{

			$pid = (int)$pid;
$plist[] = $pid;
}

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

			$pid = (int)$pid;
$plist[] = $pid;
}

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

		{

		{

			error_no_permission();
}


			error_no_permission();
}


Zeile 2501Zeile 2518
			while($pid = $db->fetch_field($query, 'pid'))
{
$posts[] = $pid;

			while($pid = $db->fetch_field($query, 'pid'))
{
$posts[] = $pid;

			}
}

			}
}


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


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

		}


		}


		$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

		$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("

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

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

			GROUP BY p.tid, p.pid
");

		$pcheck = array();
while($tcheck = $db->fetch_array($query))
{

		$pcheck = array();
while($tcheck = $db->fetch_array($query))
{

Zeile 2551Zeile 2568
		{
// 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);

		}

		}


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


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

		{

		{

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

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

		}
else
{

		}
else
{

			$moveto = $fid;
}

$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')

			$moveto = $fid;
}

$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')

		{

		{

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

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





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

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





		$pid_list = implode(', ', $posts);
$lang->split_selective_posts = $lang->sprintf($lang->split_selective_posts, $pid_list, $newtid);
log_moderator_action($modlogdata, $lang->split_selective_posts);

		$pid_list = implode(', ', $posts);
$lang->split_selective_posts = $lang->sprintf($lang->split_selective_posts, $pid_list, $newtid);
log_moderator_action($modlogdata, $lang->split_selective_posts);

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

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

		}


		}


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

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

		{

		{

			error_no_permission();

			error_no_permission();

		}

		}

		$posts = array_map('intval', $posts);

		$posts = array_map('intval', $posts);

		$pidin = implode(',', $posts);

// 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
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 moving 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)
{
$pcheck2[] = $tcheck['tid'];

		$pidin = implode(',', $posts);

// 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
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 moving 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)
{
$pcheck2[] = $tcheck['tid'];

			}
}
if(count($pcheck2) != count($pcheck))

			}
}
if(count($pcheck2) != count($pcheck))

Zeile 2655Zeile 2672
			clearinline($tid, 'thread');
}
$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");

			clearinline($tid, 'thread');
}
$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");

 

$return_url = htmlspecialchars_uni($mybb->get_input('url'));


		eval("\$moveposts = \"".$templates->get("moderation_inline_moveposts")."\";");
output_page($moveposts);
break;

		eval("\$moveposts = \"".$templates->get("moderation_inline_moveposts")."\";");
output_page($moveposts);
break;

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

$plugins->run_hooks("moderation_do_multimoveposts");

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

$plugins->run_hooks("moderation_do_multimoveposts");





		// 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];

Zeile 2677Zeile 2697
			// Get thread to merge's tid the SEO way
preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch);
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);

			// Get thread to merge's tid the SEO way
preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch);
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);


if($threadmatch[1])


if(!empty($threadmatch[1]))

			{
$parameters['tid'] = $threadmatch[1];
}


			{
$parameters['tid'] = $threadmatch[1];
}


			if($postmatch[1])

			if(!empty($postmatch[1]))

			{
$parameters['pid'] = $postmatch[1];
}

			{
$parameters['pid'] = $postmatch[1];
}

Zeile 2743Zeile 2763
		}

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

		}

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

		{
error_no_permission();

		{
error_no_permission();

		}

// Ensure all posts exist

		}

// Ensure all posts exist

Zeile 2849Zeile 2869
		$moderation->approve_posts($pids);

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

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

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

		else
{
clearinline($tid, 'thread');
}
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsapproved);

		else
{
clearinline($tid, 'thread');
}
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsapproved);

		break;


		break;


	// Unapprove posts - Inline moderation
case "multiunapproveposts":

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

	// 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')
{


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

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

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

		}

		}


if(count($posts) < 1)
{


if(count($posts) < 1)
{

Zeile 2886Zeile 2906
			error_no_permission();
}
foreach($posts as $pid)

			error_no_permission();
}
foreach($posts as $pid)

		{

		{

			$pids[] = (int)$pid;
}


			$pids[] = (int)$pid;
}


Zeile 2905Zeile 2925
		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'));

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

	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');
}
else
{
$posts = getids($tid, 'thread');
}
if(count($posts) < 1)

		{
error($lang->error_inline_nopostsselected, $lang->error);
}

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

		{
error($lang->error_inline_nopostsselected, $lang->error);
}

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

		{

		{

			error_no_permission();
}

$pids = array();

			error_no_permission();
}

$pids = array();

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

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

		}

		}





		$moderation->restore_posts($pids);

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

		$moderation->restore_posts($pids);

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

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

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

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

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

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

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

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


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


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

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

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

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


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


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





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

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

Zeile 2981Zeile 3001
		log_moderator_action($modlogdata, $lang->multi_soft_delete_posts);

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

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

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

		{

		{

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

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

		}

		}

		moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postssoftdeleted);
break;
case "do_purgespammer":

		moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postssoftdeleted);
break;
case "do_purgespammer":

Zeile 3002Zeile 3022

$uid = $mybb->get_input('uid', MyBB::INPUT_INT);
$user = get_user($uid);


$uid = $mybb->get_input('uid', MyBB::INPUT_INT);
$user = get_user($uid);

		if(!$user['uid'] || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid']))

		if(!$user || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid']))

		{
error($lang->purgespammer_invalid_user);
}

		{
error($lang->purgespammer_invalid_user);
}

Zeile 3015Zeile 3035

// Run the hooks first to avoid any issues when we delete the user
$plugins->run_hooks("moderation_purgespammer_purge");


// Run the hooks first to avoid any issues when we delete the user
$plugins->run_hooks("moderation_purgespammer_purge");





			require_once MYBB_ROOT.'inc/datahandlers/user.php';
$userhandler = new UserDataHandler('delete');


			require_once MYBB_ROOT.'inc/datahandlers/user.php';
$userhandler = new UserDataHandler('delete');


Zeile 3049Zeile 3069
						"reason" => $db->escape_string($mybb->settings['purgespammerbanreason'])
);
$db->insert_query('banned', $insert);

						"reason" => $db->escape_string($mybb->settings['purgespammerbanreason'])
);
$db->insert_query('banned', $insert);

				}

				}


// Add the IP's to the banfilters


// Add the IP's to the banfilters

				foreach(array($user['regip'], $user['lastip']) as $ip)

				if($mybb->settings['purgespammerbanip'] == 1)

				{

				{

					$ip = my_inet_ntop($db->unescape_binary($ip));
$query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'");
if($db->num_rows($query) == 0)

					foreach(array($user['regip'], $user['lastip']) as $ip)



					{

					{

						$insert = array(
"filter" => $db->escape_string($ip),
"type" => 1,
"dateline" => TIME_NOW
);
$db->insert_query("banfilters", $insert);






						$ip = my_inet_ntop($db->unescape_binary($ip));
$query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'");
if($db->num_rows($query) == 0)
{
$insert = array(
"filter" => $db->escape_string($ip),
"type" => 1,
"dateline" => TIME_NOW
);
$db->insert_query("banfilters", $insert);
}

					}
}

					}
}





				// 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 3080Zeile 3102
			elseif($mybb->settings['purgespammerbandelete'] == "delete")
{
$user_deleted = $userhandler->delete_user($uid, 1);

			elseif($mybb->settings['purgespammerbandelete'] == "delete")
{
$user_deleted = $userhandler->delete_user($uid, 1);

			}


			}


			// Submit the user to stop forum spam
if(!empty($mybb->settings['purgespammerapikey']))
{
$sfs = @fetch_remote_file("http://stopforumspam.com/add.php?username=" . urlencode($user['username']) . "&ip_addr=" . urlencode(my_inet_ntop($db->unescape_binary($user['lastip']))) . "&email=" . urlencode($user['email']) . "&api_key=" . urlencode($mybb->settings['purgespammerapikey']));

			// Submit the user to stop forum spam
if(!empty($mybb->settings['purgespammerapikey']))
{
$sfs = @fetch_remote_file("http://stopforumspam.com/add.php?username=" . urlencode($user['username']) . "&ip_addr=" . urlencode(my_inet_ntop($db->unescape_binary($user['lastip']))) . "&email=" . urlencode($user['email']) . "&api_key=" . urlencode($mybb->settings['purgespammerapikey']));

			}


			}


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

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

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

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 3134Zeile 3156
			}

if($thread['visible'] == -1)

			}

if($thread['visible'] == -1)

			{

			{

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

if(!empty($options['confirmation']) && empty($mybb->input['confirm']))

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

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


				add_breadcrumb($lang->confirm_execute_tool);

$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 = htmlspecialchars_uni($mybb->get_input('searchid'));

				$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 3161Zeile 3183

if($tool['type'] == 't' && $mybb->get_input('modtype') == 'inlinethread')
{


if($tool['type'] == 't' && $mybb->get_input('modtype') == 'inlinethread')
{

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

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

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

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

Zeile 3185Zeile 3207
				}

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

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

Zeile 3253Zeile 3275
				// Get threads which are associated with the posts
$tids = array();
$options = array(

				// Get threads which are associated with the posts
$tids = array();
$options = array(

					'order_by' => 'dateline',
'order_dir' => 'asc'

					'order_by' => 'dateline, pid',


				);
$query = $db->simple_select("posts", "DISTINCT tid, dateline", "pid IN (".implode(',',$pids).")", $options);
while($row = $db->fetch_array($query))

				);
$query = $db->simple_select("posts", "DISTINCT tid, dateline", "pid IN (".implode(',',$pids).")", $options);
while($row = $db->fetch_array($query))

Zeile 3270Zeile 3291
					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 3303Zeile 3324
 * @return array
*/
function getids($id, $type)

 * @return array
*/
function getids($id, $type)

{
global $mybb;

{
global $mybb;


$newids = array();
$cookie = "inlinemod_".$type.$id;


$newids = array();
$cookie = "inlinemod_".$type.$id;

Zeile 3466Zeile 3487

/**
* Checks if the current user is a moderator of all the threads specified


/**
* Checks if the current user is a moderator of all the threads specified

 *

 *

 * Note: If no threads are specified, this function will return true.  It is the
* responsibility of the calling script to error-check this case if necessary.
*
* @param array $threads Array of thread IDs
* @param string $permission Permission to check
* @return bool True if moderator of all; false otherwise

 * Note: If no threads are specified, this function will return true.  It is the
* responsibility of the calling script to error-check this case if necessary.
*
* @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;

// Speedy determination for supermods/admins and guests
if($mybb->usergroup['issupermod'])

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

// Speedy determination for supermods/admins and guests
if($mybb->usergroup['issupermod'])

	{

	{

		return true;
}
elseif(!$mybb->user['uid'])
{
return false;

		return true;
}
elseif(!$mybb->user['uid'])
{
return false;

	}

	}

	// Make an array of threads if not an array
if(!is_array($threads))
{

	// Make an array of threads if not an array
if(!is_array($threads))
{

Zeile 3519Zeile 3540
	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);
}