Vergleich moderation.php - 1.8.15 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 45Zeile 45
	$post = get_post($pid);
if(!$post)
{

	$post = get_post($pid);
if(!$post)
{

		error($lang->error_invalidpost);

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

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

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

Zeile 55Zeile 55
	$thread = get_thread($tid);
if(!$thread)
{

	$thread = get_thread($tid);
if(!$thread)
{

		error($lang->error_invalidthread);

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

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

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

Zeile 80Zeile 80

if(!$pm)
{


if(!$pm)
{

		error($lang->error_invalidpm);

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

	}
}


	}
}


Zeile 198Zeile 198
			}
if(count($tids) < 1)
{

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

				error($lang->error_inline_nothreadsselected);

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

			}

$mybb->input['tids'] = $tids;

			}

$mybb->input['tids'] = $tids;

Zeile 249Zeile 249
			{
case "pgsql":
case "sqlite":

			{
case "pgsql":
case "sqlite":

					$query = $db->simple_select("modtools", 'tid, name, groups', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");

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

					break;
default:

					break;
default:

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

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

			}
while($tool = $db->fetch_array($query))
{

Zeile 580Zeile 580
					eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";");
}
}

					eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";");
}
}

			else if($delayedmod['type'] == 'merge')

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

			{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);

			{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);

Zeile 601Zeile 601
		{
$lang->threads = $lang->thread;
$thread['link'] = get_thread_link($tid);

		{
$lang->threads = $lang->thread;
$thread['link'] = get_thread_link($tid);

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

			eval("\$threads = \"".$templates->get("moderation_delayedmoderation_thread")."\";");
eval("\$moderation_delayedmoderation_merge = \"".$templates->get("moderation_delayedmoderation_merge")."\";");
}

			eval("\$threads = \"".$templates->get("moderation_delayedmoderation_thread")."\";");
eval("\$moderation_delayedmoderation_merge = \"".$templates->get("moderation_delayedmoderation_merge")."\";");
}

Zeile 617Zeile 619
			}
if(count($tids) < 1)
{

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

				error($lang->error_inline_nothreadsselected);

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

			}

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

			}

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

		$mybb->input['redirect_expire'] = $mybb->get_input('redirect_expire');

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

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

// Generate form elements for date form

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

// Generate form elements for date form

Zeile 697Zeile 699
		if(!is_moderator($fid, "canopenclosethreads"))
{
error_no_permission();

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

 
		}

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

		}

if($thread['closed'] == 1)

		}

if($thread['closed'] == 1)

Zeile 710Zeile 717
			$openclose = $lang->closed;
$redirect = $lang->redirect_closethread;
$moderation->close_threads($tid);

			$openclose = $lang->closed;
$redirect = $lang->redirect_closethread;
$moderation->close_threads($tid);

		}

$lang->mod_process = $lang->sprintf($lang->mod_process, $openclose);

		}

$lang->mod_process = $lang->sprintf($lang->mod_process, $openclose);


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



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


Zeile 723Zeile 730
	case "stick":
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

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





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

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

		{

		{

			error_no_permission();

			error_no_permission();

 
		}

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

		}

$plugins->run_hooks("moderation_stick");

		}

$plugins->run_hooks("moderation_stick");

Zeile 762Zeile 774
			error_no_permission();
}


			error_no_permission();
}


		$plugins->run_hooks("moderation_removeredirects");






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

$plugins->run_hooks("moderation_removeredirects");


$moderation->remove_redirects($tid);



$moderation->remove_redirects($tid);


Zeile 772Zeile 789

// Delete thread confirmation page
case "deletethread":


// Delete thread confirmation page
case "deletethread":





		add_breadcrumb($lang->nav_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":


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


Zeile 821Zeile 838
	// 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'])

			{
error_no_permission();
}

			{
error_no_permission();
}

Zeile 833Zeile 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);

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

		}

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

		}

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

Zeile 848Zeile 865

// 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($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);
}


if(!isset($mybb->input['delete']))
{
error($lang->redirect_pollnotdeleted);


if(!isset($mybb->input['delete']))
{
error($lang->redirect_pollnotdeleted);

		}

		}

		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 863Zeile 885
		$query = $db->simple_select("polls", "pid", "tid = $tid");
$poll = $db->fetch_array($query);
if(!$poll)

		$query = $db->simple_select("polls", "pid", "tid = $tid");
$poll = $db->fetch_array($query);
if(!$poll)

		{
error($lang->error_invalidpoll);
}

$plugins->run_hooks("moderation_do_deletepoll");


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

$plugins->run_hooks("moderation_do_deletepoll");


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


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


Zeile 879Zeile 901

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

 

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


		$thread = get_thread($tid);

$plugins->run_hooks("moderation_approvethread");

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_approvethread");

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

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

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

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





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


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


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

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

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

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

		{
error_no_permission();
}
$thread = get_thread($tid);








		{
error_no_permission();
}

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

$thread = get_thread($tid);


		$plugins->run_hooks("moderation_unapprovethread");

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

		$plugins->run_hooks("moderation_unapprovethread");

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

Zeile 923Zeile 957

// Restore a thread
case "restorethread":


// Restore a thread
case "restorethread":


// 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(!is_moderator($fid, "canrestorethreads"))
{
error_no_permission();

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

Zeile 937Zeile 971

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


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





		$moderation->restore_threads($tid);

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

		$moderation->restore_threads($tid);

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





	// Soft delete a thread
case "softdeletethread":


	// Soft delete a thread
case "softdeletethread":


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

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

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

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

		{
error_no_permission();
}

		{
error_no_permission();
}

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_softdeletethread");

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_softdeletethread");

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

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

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


		$plugins->run_hooks("moderation_move");

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

		$plugins->run_hooks("moderation_move");

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

Zeile 982Zeile 1021

// Let's get this thing moving!
case "do_move":


// Let's get this thing moving!
case "do_move":





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


Zeile 993Zeile 1032
		{
error_no_permission();
}

		{
error_no_permission();
}

 


		// Check if user has moderator permission to move to destination
if(!is_moderator($moveto, "canmanagethreads") && !is_moderator($fid, "canmovetononmodforum"))
{
error_no_permission();
}

		// Check if user has moderator permission to move to destination
if(!is_moderator($moveto, "canmanagethreads") && !is_moderator($fid, "canmovetononmodforum"))
{
error_no_permission();
}

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


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

		{

		{

			error($lang->error_movetononmodforum);

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

		}

		}









		
$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'] != '')
{

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

			error($lang->error_invalidforum);

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

		}
if($method != "copy" && $thread['fid'] == $moveto)

		}
if($method != "copy" && $thread['fid'] == $moveto)

		{
error($lang->error_movetosameforum);
}

$plugins->run_hooks('moderation_do_move');


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

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

$newtid = $moderation->move_thread($tid, $moveto, $method, $expire);

		$the_thread = $tid;

$newtid = $moderation->move_thread($tid, $moveto, $method, $expire);





		switch($method)
{
case "copy":
log_moderator_action($modlogdata, $lang->thread_copied);

		switch($method)
{
case "copy":
log_moderator_action($modlogdata, $lang->thread_copied);

				break;

				break;

			default:
case "move":
case "redirect":

			default:
case "move":
case "redirect":

Zeile 1039Zeile 1085
		}

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

		}

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

		break;

		break;


// Viewing thread notes
case "viewthreadnotes":


// Viewing thread notes
case "viewthreadnotes":

Zeile 1051Zeile 1097
		// Make sure we are looking at a real thread here.
if(!$thread)
{

		// Make sure we are looking at a real thread here.
if(!$thread)
{

			error($lang->error_nomember);

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

		}

$plugins->run_hooks('moderation_viewthreadnotes');

		}

$plugins->run_hooks('moderation_viewthreadnotes');

Zeile 1121Zeile 1167
			if(!$modactions)
{
eval("\$modactions = \"".$templates->get("moderation_threadnotes_modaction_error")."\";");

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

			}
}


			}
}


		$actions = array(
'openclosethread' => $lang->open_close_thread,
'deletethread' => $lang->delete_thread,

		$actions = array(
'openclosethread' => $lang->open_close_thread,
'deletethread' => $lang->delete_thread,

Zeile 1134Zeile 1180
			'removesubscriptions' => $lang->remove_subscriptions,
'approveunapprovethread' => $lang->approve_unapprove_thread
);

			'removesubscriptions' => $lang->remove_subscriptions,
'approveunapprovethread' => $lang->approve_unapprove_thread
);


switch($db->type)
{


switch($db->type)
{

			case "pgsql":
case "sqlite":
$query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");

			case "pgsql":
case "sqlite":
$query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");

Zeile 1162Zeile 1208
					LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=d.uid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=d.fid)
WHERE ','||d.tids||',' LIKE '%,{$tid},%'

					LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=d.uid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=d.fid)
WHERE ','||d.tids||',' LIKE '%,{$tid},%'

					ORDER BY d.dateline DESC
LIMIT 0, 20
");

					ORDER BY d.dateline DESC
LIMIT 0, 20
");

				break;
default:
$query = $db->query("

				break;
default:
$query = $db->query("

Zeile 1224Zeile 1270
					eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";");
}
}

					eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";");
}
}

			else if($delayedmod['type'] == 'merge')

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

			{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);

			{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);

Zeile 1248Zeile 1294

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


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


// Verify incoming POST request


// Verify incoming POST request

		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 1290Zeile 1336
		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');

		}

$plugins->run_hooks('moderation_getip');

Zeile 1312Zeile 1358
	case "getpmip":
if($pmid <= 0)
{

	case "getpmip":
if($pmid <= 0)
{

			error($lang->error_invalidpm);

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

		}
add_breadcrumb($lang->nav_pms, "private.php");
$pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));

		}
add_breadcrumb($lang->nav_pms, "private.php");
$pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));

Zeile 1362Zeile 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);

		}

$plugins->run_hooks("moderation_merge");

		}

$plugins->run_hooks("moderation_merge");





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

		eval("\$merge = \"".$templates->get("moderation_merge")."\";");
output_page($merge);
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":


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

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


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

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

			error_no_permission();

			error_no_permission();

 
		}

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

		}

$plugins->run_hooks("moderation_do_merge");

		}

$plugins->run_hooks("moderation_do_merge");

Zeile 1393Zeile 1449
			// 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])
{
$parameters['tid'] = $threadmatch[1];

			if($threadmatch[1])
{
$parameters['tid'] = $threadmatch[1];

			}


			}


			if($postmatch[1])
{
$parameters['pid'] = $postmatch[1];

			if($postmatch[1])
{
$parameters['pid'] = $postmatch[1];

Zeile 1419Zeile 1475
				}
}
else

				}
}
else

			{

			{

				$temp2 = explode("=", $splitloc[1], 2);
$parameters[$temp2[0]] = $temp2[1];
}

				$temp2 = explode("=", $splitloc[1], 2);
$parameters[$temp2[0]] = $temp2[1];
}

Zeile 1433Zeile 1489
		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)

			$mergetid = 0;
}
$mergethread = get_thread($mergetid);
if(!$mergethread)

		{
error($lang->error_badmergeurl);
}

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

		if($mergetid == $tid)
{ // sanity check

		if($mergetid == $tid)
{ // sanity check

			error($lang->error_mergewithself);

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

		}
if(!is_moderator($mergethread['fid'], "canmanagethreads"))

		}
if(!is_moderator($mergethread['fid'], "canmanagethreads"))

		{

		{

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

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

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

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

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

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





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


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


Zeile 1474Zeile 1530
		{
error_no_permission();
}

		{
error_no_permission();
}

 

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


		$query = $db->query("
SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p

		$query = $db->query("
SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p

Zeile 1481Zeile 1543
			WHERE tid='$tid'
ORDER BY dateline ASC
");

			WHERE tid='$tid'
ORDER BY dateline ASC
");

 


		$numposts = $db->num_rows($query);
if($numposts <= 1)
{

		$numposts = $db->num_rows($query);
if($numposts <= 1)
{

			error($lang->error_cantsplitonepost);

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

		}

$altbg = "trow1";

		}

$altbg = "trow1";

Zeile 1505Zeile 1568
			if($post['smilieoff'] == 1)
{
$parser_options['allow_smilies'] = 0;

			if($post['smilieoff'] == 1)
{
$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 1530Zeile 1593
		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

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

		}

$plugins->run_hooks("moderation_do_split");







		}

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

$plugins->run_hooks("moderation_do_split");


		$mybb->input['splitpost'] = $mybb->get_input('splitpost', MyBB::INPUT_ARRAY);
if(empty($mybb->input['splitpost']))
{

		$mybb->input['splitpost'] = $mybb->get_input('splitpost', MyBB::INPUT_ARRAY);
if(empty($mybb->input['splitpost']))
{

			error($lang->error_nosplitposts);

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

		}
$query = $db->simple_select("posts", "COUNT(*) AS totalposts", "tid='{$tid}'");
$count = $db->fetch_array($query);

if($count['totalposts'] == 1)
{

		}
$query = $db->simple_select("posts", "COUNT(*) AS totalposts", "tid='{$tid}'");
$count = $db->fetch_array($query);

if($count['totalposts'] == 1)
{

			error($lang->error_cantsplitonepost);

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

		}

if($count['totalposts'] == count($mybb->input['splitpost']))

		}

if($count['totalposts'] == count($mybb->input['splitpost']))

		{
error($lang->error_cantsplitall);
}


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


		if(!empty($mybb->input['moveto']))
{
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
}
else

		if(!empty($mybb->input['moveto']))
{
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
}
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);
}

$pids = array();


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

$pids = array();


		// move the selected posts over
$query = $db->simple_select("posts", "pid", "tid='$tid'");
while($post = $db->fetch_array($query))

		// move the selected posts over
$query = $db->simple_select("posts", "pid", "tid='$tid'");
while($post = $db->fetch_array($query))

Zeile 1579Zeile 1647
			}
mark_reports($post['pid'], "post");
}

			}
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 1589Zeile 1657

// Delete Thread Subscriptions
case "removesubscriptions":


// Delete Thread Subscriptions
case "removesubscriptions":





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

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

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

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

		{

		{

			error_no_permission();

			error_no_permission();

 
		}

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

		}

$plugins->run_hooks("moderation_removesubscriptions");

		}

$plugins->run_hooks("moderation_removesubscriptions");

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

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





		if(!empty($mybb->input['searchid']))
{
// From search page

		if(!empty($mybb->input['searchid']))
{
// From search page

Zeile 1621Zeile 1694
			}
}
else

			}
}
else

		{

		{

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

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

Zeile 1630Zeile 1703
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

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

		}

$inlineids = implode("|", $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');

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

Zeile 1648Zeile 1721
		break;

// Actually delete the threads - Inline moderation

		break;

// Actually delete the threads - Inline moderation

	case "do_multideletethreads":

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

Zeile 1678Zeile 1751
		break;

// Open threads - Inline moderation

		break;

// Open threads - Inline moderation

	case "multiopenthreads":


	case "multiopenthreads":


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


Zeile 1688Zeile 1761
			// 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();
}

		}
else
{

		}
else
{

Zeile 1699Zeile 1772
			{
error_no_permission();
}

			{
error_no_permission();
}

		}


		}


		if(count($threads) < 1)
{

		if(count($threads) < 1)
{

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->open_threads($threads);

		}

$moderation->open_threads($threads);

Zeile 1712Zeile 1785
		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');

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

Zeile 1721Zeile 1794
		break;

// Close threads - Inline moderation

		break;

// Close threads - Inline moderation

	case "multiclosethreads":


	case "multiclosethreads":


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


Zeile 1745Zeile 1818
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->close_threads($threads);

		}

$moderation->close_threads($threads);

Zeile 1787Zeile 1860
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

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

		}

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

Zeile 1830Zeile 1903
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

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

		}

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

Zeile 1873Zeile 1946
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->restore_threads($threads);

		}

$moderation->restore_threads($threads);

Zeile 1916Zeile 1989
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->soft_delete_threads($threads);

		}

$moderation->soft_delete_threads($threads);

Zeile 1959Zeile 2032
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->stick_threads($threads);

		}

$moderation->stick_threads($threads);

Zeile 2001Zeile 2074
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->unstick_threads($threads);

		}

$moderation->unstick_threads($threads);

Zeile 2042Zeile 2115

if(count($threads) < 1)
{


if(count($threads) < 1)
{

			error($lang->error_inline_nothreadsselected);

			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 2066Zeile 2139
		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 2079Zeile 2154
		$newperms = forum_permissions($moveto);
if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))
{

		$newperms = forum_permissions($moveto);
if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))
{

			error($lang->error_movetononmodforum);
}

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

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

		}


		}


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





	// 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')
{
$posts = getids($mybb->get_input('searchid'), 'search');


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

		}
else
{

		}
else
{

Zeile 2110Zeile 2194

if(count($posts) < 1)
{


if(count($posts) < 1)
{

			error($lang->error_inline_nopostsselected);

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

		}
if(!is_moderator_by_pids($posts, "candeleteposts"))
{

		}
if(!is_moderator_by_pids($posts, "candeleteposts"))
{

Zeile 2185Zeile 2269
				$moderation->delete_thread($tid);
mark_reports($tid, "thread");
$url = get_forum_link($fid);

				$moderation->delete_thread($tid);
mark_reports($tid, "thread");
$url = get_forum_link($fid);

			}

			}

			else
{
mark_reports($plist, "posts");

			else
{
mark_reports($plist, "posts");

Zeile 2233Zeile 2317

if(empty($posts))
{


if(empty($posts))
{

			error($lang->error_inline_nopostsselected);

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

		}

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

		}

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

Zeile 2270Zeile 2354
			$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')


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

Zeile 2297Zeile 2381
		$mergepost = $mybb->get_input('mergepost', MyBB::INPUT_ARRAY);
if(count($mergepost) <= 1)
{

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

			error($lang->error_nomergeposts);

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

		}

foreach($mergepost as $pid => $yes)

		}

foreach($mergepost as $pid => $yes)

Zeile 2332Zeile 2416

if(count($posts) < 1)
{


if(count($posts) < 1)
{

			error($lang->error_inline_nopostsselected);

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

		}

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

		}

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

Zeile 2355Zeile 2439
		while($tcheck = $db->fetch_array($query))
{
if((int)$tcheck['count'] <= 1)

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

			{
error($lang->error_cantsplitonepost);

			{
error($lang->error_cantsplitonepost, $lang->error);

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

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

Zeile 2372Zeile 2456
		");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))

		");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))

		{

		{

			if($tcheck['count'] > 0)
{
$pcheck2[] = $tcheck['tid'];
}

			if($tcheck['count'] > 0)
{
$pcheck2[] = $tcheck['tid'];
}

		}

		}

		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

			error($lang->error_cantsplitall);
}


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

		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;

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

		}

		}


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


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

Zeile 2433Zeile 2517

if(empty($posts))
{


if(empty($posts))
{

			error($lang->error_inline_nopostsselected);

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

			GROUP BY p.tid, p.pid

			GROUP BY p.tid, p.pid

		");
$pcheck = array();
while($tcheck = $db->fetch_array($query))
{
if((int)$tcheck['count'] <= 1)
{

		");
$pcheck = array();
while($tcheck = $db->fetch_array($query))
{
if((int)$tcheck['count'] <= 1)
{

				error($lang->error_cantsplitonepost);

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

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

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

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

Zeile 2477Zeile 2561
		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

			error($lang->error_cantsplitall);

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

		}

if(isset($mybb->input['moveto']))
{
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);

		}

if(isset($mybb->input['moveto']))
{
$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);

		{
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 2520Zeile 2604

if(count($posts) < 1)
{


if(count($posts) < 1)
{

			error($lang->error_inline_nopostsselected);

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

		}

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

		}

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

Zeile 2528Zeile 2612
			error_no_permission();
}
$posts = array_map('intval', $posts);

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

		$pidin = implode(',', $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("

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

Zeile 2544Zeile 2628
		{
if((int)$tcheck['count'] <= 1)
{

		{
if((int)$tcheck['count'] <= 1)
{

				error($lang->error_cantsplitonepost);

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

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

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

Zeile 2569Zeile 2653
		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

			error($lang->error_cantmoveall);

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

		}

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

		}

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

Zeile 2613Zeile 2697
			if($postmatch[1])
{
$parameters['pid'] = $postmatch[1];

			if($postmatch[1])
{
$parameters['pid'] = $postmatch[1];

			}
}

			}
}

		else
{
// Get thread to merge's tid the normal way

		else
{
// Get thread to merge's tid the normal way

Zeile 2654Zeile 2738
		$newthread = get_thread($newtid);
if(!$newthread)
{

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

			error($lang->error_badmovepostsurl);

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

		}
if($newtid == $tid)
{ // sanity check

		}
if($newtid == $tid)
{ // sanity check

			error($lang->error_movetoself);

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

		}

$postlist = explode("|", $mybb->get_input('posts'));

		}

$postlist = explode("|", $mybb->get_input('posts'));

Zeile 2687Zeile 2771

if(empty($posts))
{


if(empty($posts))
{

			error($lang->error_inline_nopostsselected);

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

		}

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

		}

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

Zeile 2706Zeile 2790
		{
if((int)$tcheck['count'] <= 1)
{

		{
if((int)$tcheck['count'] <= 1)
{

				error($lang->error_cantsplitonepost);

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

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

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

Zeile 2731Zeile 2815
		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

			error($lang->error_cantmoveall);

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

		}

$newtid = $moderation->split_posts($posts, $tid, $newthread['fid'], $db->escape_string($newthread['subject']), $newtid);

		}

$newtid = $moderation->split_posts($posts, $tid, $newthread['fid'], $db->escape_string($newthread['subject']), $newtid);

Zeile 2745Zeile 2829

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


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


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

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

		}

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

		}

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

Zeile 2769Zeile 2853

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


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

		{

		{

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


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


Zeile 2779Zeile 2863
		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 2788Zeile 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')
{
$posts = getids($mybb->get_input('searchid'), 'search');
}
else
{
$posts = getids($tid, 'thread');
}

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


if(count($posts) < 1)
{


if(count($posts) < 1)
{

			error($lang->error_inline_nopostsselected);

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

		}
$pids = array();

		}
$pids = array();





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

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

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

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

		}

$moderation->unapprove_posts($pids);

		}

$moderation->unapprove_posts($pids);


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


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

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

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

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

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

			error($lang->error_inline_nopostsselected);

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

		}

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

		}

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

Zeile 2891Zeile 2975

if(count($posts) < 1)
{


if(count($posts) < 1)
{

			error($lang->error_inline_nopostsselected);

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

		}
$pids = array();


		}
$pids = array();


Zeile 2927Zeile 3011
			error_no_permission();
}


			error_no_permission();
}


		$uid = $mybb->input['uid'];

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

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

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

		{

		{

			error($lang->purgespammer_invalid_user);
}


			error($lang->purgespammer_invalid_user);
}


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

			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)

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

if($user_deleted)

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

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

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

		elseif($mybb->input['action'] == "purgespammer")

		{
$plugins->run_hooks("moderation_purgespammer_show");


		{
$plugins->run_hooks("moderation_purgespammer_show");


Zeile 3058Zeile 3142
			if(!is_member($tool['groups']))
{
error_no_permission();

			if(!is_member($tool['groups']))
{
error_no_permission();

 
			}

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

			}

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

			}

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

				$modtype = $mybb->get_input('modtype');
$inlinetype = $mybb->get_input('inlinetype');
$searchid = $mybb->get_input('searchid');

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

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

				}

				}

				if(count($tids) < 1)
{

				if(count($tids) < 1)
{

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

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





				}

				}


$thread_options = my_unserialize($tool['threadoptions']);





				if(!is_moderator_by_tids($tids, "canusecustomtools"))
{
error_no_permission();
}

$thread_options = my_unserialize($tool['threadoptions']);

				if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")
{

				if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")
{

					error($lang->error_movetocategory);

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

				}

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

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

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

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

				}
else
{

				}
else
{

Zeile 3128Zeile 3218
				if(!is_moderator_by_tids($tid, "canusecustomtools"))
{
error_no_permission();

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


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

					error($lang->error_movetocategory);

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

				}

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

				}

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

Zeile 3143Zeile 3233
				{
$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

				}
else

				{
$lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_customtool_thread);

				{
$lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_customtool_thread);

Zeile 3160Zeile 3250
				else
{
$pids = getids($tid, 'thread');

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

				}

				}


if(count($pids) < 1)
{


if(count($pids) < 1)
{

					error($lang->error_inline_nopostsselected);

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

				}
if(!is_moderator_by_pids($pids, "canusecustomtools"))
{

				}
if(!is_moderator_by_pids($pids, "canusecustomtools"))
{

Zeile 3187Zeile 3277
 				$lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']);
log_moderator_action($modlogdata, $lang->custom_tool);
if($mybb->get_input('inlinetype') == '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'));

					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 3229Zeile 3319

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


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

	if(isset($mybb->cookies[$cookie]))
{

	if(isset($mybb->cookies[$cookie]))
{

		$cookie_ids = explode("|", $mybb->cookies[$cookie]);

foreach($cookie_ids as $cookie_id)
{
if(empty($cookie_id))

		$cookie_ids = explode("|", $mybb->cookies[$cookie]);

foreach($cookie_ids as $cookie_id)
{
if(empty($cookie_id))

			{

			{

				continue;
}

if($cookie_id == 'ALL')

				continue;
}

if($cookie_id == 'ALL')

			{

			{

				$newids += getallids($id, $type);
}
else

				$newids += getallids($id, $type);
}
else

Zeile 3272Zeile 3362
	if(isset($mybb->cookies[$cookie]))
{
$removed_ids = explode("|", $mybb->cookies[$cookie]);

	if(isset($mybb->cookies[$cookie]))
{
$removed_ids = explode("|", $mybb->cookies[$cookie]);





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

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

		}
}


		}
}


	// "Select all Threads in this forum" only supported by forumdisplay and search
if($type == 'forum')
{

	// "Select all Threads in this forum" only supported by forumdisplay and search
if($type == 'forum')
{

Zeile 3288Zeile 3378
			if(in_array($tid, $removed_ids))
{
continue;

			if(in_array($tid, $removed_ids))
{
continue;

			}

			}


$ids[] = $tid;
}
}


$ids[] = $tid;
}
}

	else if($type == 'search')

	elseif($type == 'search')

	{
$query = $db->simple_select("searchlog", "resulttype, posts, threads", "sid='".$db->escape_string($id)."' AND uid='{$mybb->user['uid']}'", 1);
$searchlog = $db->fetch_array($query);
if($searchlog['resulttype'] == 'posts')
{
$ids = explode(',', $searchlog['posts']);

	{
$query = $db->simple_select("searchlog", "resulttype, posts, threads", "sid='".$db->escape_string($id)."' AND uid='{$mybb->user['uid']}'", 1);
$searchlog = $db->fetch_array($query);
if($searchlog['resulttype'] == 'posts')
{
$ids = explode(',', $searchlog['posts']);

		}

		}

		else
{
$ids = explode(',', $searchlog['threads']);

		else
{
$ids = explode(',', $searchlog['threads']);

Zeile 3315Zeile 3405
					unset($ids[$key]);
}
}

					unset($ids[$key]);
}
}

		}

		}

	}

return $ids;

	}

return $ids;

}

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

}

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

function clearinline($id, $type)
{
my_unsetcookie("inlinemod_".$type.$id);

function clearinline($id, $type)
{
my_unsetcookie("inlinemod_".$type.$id);

Zeile 3352Zeile 3442
 * @return bool True if moderator of all; false otherwise
*/
function is_moderator_by_pids($posts, $permission='')

 * @return bool True if moderator of all; false otherwise
*/
function is_moderator_by_pids($posts, $permission='')

{
global $db, $mybb;

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

{
global $db, $mybb;

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

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

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

Zeile 3440Zeile 3530
	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);
}