Vergleich moderation.php - 1.8.14 - 1.8.25

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'moderation.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'moderation.php');


$templatelist = "changeuserbox,loginbox,moderation_delayedmoderation_custommodtool,moderation_delayedmodaction_notes,moderation_delayedmoderation_merge,moderation_delayedmoderation_move";
$templatelist .= ",moderation_delayedmoderation,moderation_deletethread,moderation_deletepoll,moderation_mergeposts_post,moderation_viewthreadnotes,moderation_confirmation,moderation_purgespammer";
$templatelist .= ",moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_threadnotes,moderation_getip_modoptions,moderation_getip,moderation_getpmip";

$templatelist = "changeuserbox,loginbox,moderation_delayedmoderation_custommodtool,moderation_delayedmodaction_notes,moderation_delayedmoderation_merge,moderation_delayedmoderation_move,moderation_threadnotes";
$templatelist .= ",moderation_delayedmoderation,moderation_deletethread,moderation_deletepoll,moderation_mergeposts_post,moderation_viewthreadnotes,moderation_confirmation,moderation_purgespammer,forumjump_bit";
$templatelist .= ",moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_getip_modoptions,moderation_getip,moderation_getpmip,moderation_getpmip_modal";

$templatelist .= ",moderation_split_post,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts,moderation_threadnotes_modaction_error";
$templatelist .= ",moderation_inline_splitposts,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password,moderation_inline_moveposts,moderation_delayedmodaction_error";
$templatelist .= ",moderation_delayedmodaction_notes_thread_single,moderation_delayedmodaction_notes_thread_multiple,moderation_delayedmodaction_notes_forum,moderation_delayedmodaction_notes_new_forum";

$templatelist .= ",moderation_split_post,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts,moderation_threadnotes_modaction_error";
$templatelist .= ",moderation_inline_splitposts,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password,moderation_inline_moveposts,moderation_delayedmodaction_error";
$templatelist .= ",moderation_delayedmodaction_notes_thread_single,moderation_delayedmodaction_notes_thread_multiple,moderation_delayedmodaction_notes_forum,moderation_delayedmodaction_notes_new_forum";

$templatelist .= ",moderation_delayedmodaction_notes_redirect,moderation_delayedmodaction_notes_merge,moderation_delayedmoderation_thread,moderation_threadnotes_modaction_thread,forumjump_bit";

$templatelist .= ",moderation_delayedmodaction_notes_redirect,moderation_delayedmodaction_notes_merge,moderation_delayedmoderation_thread,moderation_threadnotes_modaction_thread,moderation_getip_modal";

$templatelist .= ",moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month,moderation_threadnotes_modaction_post,moderation_merge,moderation_split,moderation_threadnotes_modaction_forum";
$templatelist .= ",moderation_delayedmoderation_openclose,moderation_delayedmoderation_softdeleterestore,moderation_delayedmoderation_delete,moderation_delayedmoderation_stick,moderation_delayedmoderation_approve";


$templatelist .= ",moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month,moderation_threadnotes_modaction_post,moderation_merge,moderation_split,moderation_threadnotes_modaction_forum";
$templatelist .= ",moderation_delayedmoderation_openclose,moderation_delayedmoderation_softdeleterestore,moderation_delayedmoderation_delete,moderation_delayedmoderation_stick,moderation_delayedmoderation_approve";


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

$pid = $mybb->get_input('pid', 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($pid)
{
$post = get_post($pid);
if(!$post)
{


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

		error($lang->error_invalidpost);

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

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

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

Zeile 54Zeile 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 79Zeile 80

if(!$pm)
{


if(!$pm)
{

		error($lang->error_invalidpm);

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

	}
}


	}
}


Zeile 197Zeile 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 248Zeile 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 290Zeile 291

if($mybb->input['type'] == 'move')
{


if($mybb->input['type'] == 'move')
{

				$newforum = get_forum($fid);










				$newfid = (int)$mybb->input['delayedmoderation']['new_forum'];

// Make sure moderator has permission to move to the new forum
$newperms = forum_permissions($newfid);
if($newperms['canview'] == 0 || !is_moderator($newfid, 'canmovetononmodforum'))
{
$errors[] = $lang->error_movetononmodforum;
}

$newforum = get_forum($newfid);

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

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

				{

				{

					$errors[] = $lang->error_invalidforum;

					$errors[] = $lang->error_invalidforum;

 
				}

$method = $mybb->input['delayedmoderation']['method'];
if($method != "copy" && $fid == $newfid)
{
$errors[] = $lang->error_movetosameforum;

				}
}


				}
}


Zeile 516Zeile 532
					");
}
}

					");
}
}

		



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

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

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

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

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

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

Zeile 530Zeile 546
				$delayed_thread['link'] = get_thread_link($delayed_thread['tid']);
$delayed_thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($delayed_thread['subject']));
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_single")."\";");

				$delayed_thread['link'] = get_thread_link($delayed_thread['tid']);
$delayed_thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($delayed_thread['subject']));
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_single")."\";");

			}

			}

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

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

Zeile 560Zeile 576
					{
$redirect_expire_bit = (int)$delayedmod['inputs']['redirect_expire']." {$lang->days}";
}

					{
$redirect_expire_bit = (int)$delayedmod['inputs']['redirect_expire']." {$lang->days}";
}





					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 578Zeile 594
		{
$cols = 5;
eval("\$delayedmods = \"".$templates->get("moderation_delayedmodaction_error")."\";");

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

		}

		}


$url = '';
if($mybb->get_input('tid', MyBB::INPUT_INT))
{
$lang->threads = $lang->thread;
$thread['link'] = get_thread_link($tid);


$url = '';
if($mybb->get_input('tid', MyBB::INPUT_INT))
{
$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 601Zeile 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 675Zeile 693
		break;
// Open or close a thread
case "openclosethread":

		break;
// Open or close a thread
case "openclosethread":

		// Verify incoming POST request

		// Verify incoming POST request

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

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

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

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

		{
error_no_permission();
}






		{
error_no_permission();
}

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


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


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

Zeile 690Zeile 713
			$moderation->open_threads($tid);
}
else

			$moderation->open_threads($tid);
}
else

		{

		{

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

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

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

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





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


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


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

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

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

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

		{
error_no_permission();
}

$plugins->run_hooks("moderation_stick");







		{
error_no_permission();
}

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

$plugins->run_hooks("moderation_stick");


		if($thread['sticky'] == 1)
{
$stuckunstuck = $lang->unstuck;

		if($thread['sticky'] == 1)
{
$stuckunstuck = $lang->unstuck;

Zeile 726Zeile 754
			$stuckunstuck = $lang->stuck;
$redirect = $lang->redirect_stickthread;
$moderation->stick_threads($tid);

			$stuckunstuck = $lang->stuck;
$redirect = $lang->redirect_stickthread;
$moderation->stick_threads($tid);

		}

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


		}

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


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

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

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

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

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

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

 
		}

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

		}

$plugins->run_hooks("moderation_removeredirects");

		}

$plugins->run_hooks("moderation_removeredirects");

Zeile 752Zeile 785

log_moderator_action($modlogdata, $lang->redirects_removed);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_redirectsremoved);


log_moderator_action($modlogdata, $lang->redirects_removed);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_redirectsremoved);

		break;

		break;


// Delete thread confirmation page
case "deletethread":

add_breadcrumb($lang->nav_deletethread);



// Delete thread confirmation page
case "deletethread":

add_breadcrumb($lang->nav_deletethread);


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

$plugins->run_hooks("moderation_deletethread");


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

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





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


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


Zeile 791Zeile 824

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


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





		$moderation->delete_thread($tid);

mark_reports($tid, "thread");

		$moderation->delete_thread($tid);

mark_reports($tid, "thread");

Zeile 812Zeile 845
			{
error_no_permission();
}

			{
error_no_permission();
}

		}


		}


		$plugins->run_hooks("moderation_deletepoll");

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

		$plugins->run_hooks("moderation_deletepoll");

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

			error($lang->error_invalidpoll);

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

		}

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

		}

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

Zeile 828Zeile 861
		break;

// Delete the actual poll here!

		break;

// Delete the actual poll here!

	case "do_deletepoll":

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

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






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

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

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

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

		{

		{

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

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

		}

		}

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

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


$plugins->run_hooks("moderation_do_deletepoll");



$plugins->run_hooks("moderation_do_deletepoll");


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








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

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_approvethread");

Zeile 885Zeile 929

// Unapprove a thread
case "unapprovethread":


// Unapprove a thread
case "unapprovethread":





		// 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 893Zeile 937
		{
error_no_permission();
}

		{
error_no_permission();
}

		$thread = get_thread($tid);








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']);
log_moderator_action($modlogdata, $lang->thread_unapproved);


$plugins->run_hooks("moderation_unapprovethread");

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





		$moderation->unapprove_threads($tid);

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

		$moderation->unapprove_threads($tid);

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

Zeile 907Zeile 957

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

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

$plugins->run_hooks("moderation_restorethread");


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

$plugins->run_hooks("moderation_restorethread");


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


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


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


Zeile 938Zeile 988
			error_no_permission();
}
$thread = get_thread($tid);

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





		$plugins->run_hooks("moderation_softdeletethread");

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

		$plugins->run_hooks("moderation_softdeletethread");

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





		$moderation->soft_delete_threads($tid);

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

		$moderation->soft_delete_threads($tid);

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

		break;

		break;


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


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

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

$plugins->run_hooks("moderation_move");






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


$forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto");
eval("\$movethread = \"".$templates->get("moderation_move")."\";");

Zeile 966Zeile 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 974Zeile 1029
		$method = $mybb->get_input('method');

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

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

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

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

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

		{

		{

			error_no_permission();
}

			error_no_permission();
}

 

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


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

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

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

		}

$plugins->run_hooks('moderation_do_move');

		}

$plugins->run_hooks('moderation_do_move');

Zeile 1035Zeile 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 1074Zeile 1136
			$modactions = '';
while($modaction = $db->fetch_array($query))
{

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

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

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

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

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

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

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

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

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

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

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

Zeile 1208Zeile 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 1279Zeile 1341

$plugins->run_hooks('moderation_getip');



$plugins->run_hooks('moderation_getip');


		eval("\$getip = \"".$templates->get("moderation_getip")."\";");
output_page($getip);
break;










		if($modal)
{
eval("\$getip = \"".$templates->get("moderation_getip_modal", 1, 0)."\";");
echo $getip;
exit;
}
else
{
eval("\$getip = \"".$templates->get("moderation_getip")."\";");
output_page($getip);
break;
}


// Let's look up the ip address of a PM
case "getpmip":
if($pmid <= 0)
{


// Let's look up the ip address of a PM
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 1318Zeile 1389

$plugins->run_hooks('moderation_getpmip');



$plugins->run_hooks('moderation_getpmip');


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










		if($modal)
{
eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";");
echo $getpmip;
exit;
}
else
{
eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";");
output_page($getpmip);
break;
}


// Merge threads
case "merge":
add_breadcrumb($lang->nav_merge);


// Merge threads
case "merge":
add_breadcrumb($lang->nav_merge);

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

$plugins->run_hooks("moderation_merge");






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

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

$plugins->run_hooks("moderation_merge");


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


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

Zeile 1338Zeile 1423

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

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


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

// explode at # sign in a url (indicates a name reference) and reassign to the url

		$plugins->run_hooks("moderation_do_merge");

// explode at # sign in a url (indicates a name reference) and reassign to the url

Zeile 1407Zeile 1497
		$mergethread = get_thread($mergetid);
if(!$mergethread)
{

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

Zeile 1432Zeile 1522

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


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





	// Divorce the posts in this thread (Split!)
case "split":
add_breadcrumb($lang->nav_split);
if(!is_moderator($fid, "canmanagethreads"))

	// Divorce the posts in this thread (Split!)
case "split":
add_breadcrumb($lang->nav_split);
if(!is_moderator($fid, "canmanagethreads"))

		{

		{

			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 1447Zeile 1543
			WHERE tid='$tid'
ORDER BY dateline ASC
");

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

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

 




		$altbg = "trow1";







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

$altbg = "trow1";

		$posts = '';
while($post = $db->fetch_array($query))
{
$postdate = my_date('relative', $post['dateline']);
$post['username'] = htmlspecialchars_uni($post['username']);

		$posts = '';
while($post = $db->fetch_array($query))
{
$postdate = my_date('relative', $post['dateline']);
$post['username'] = htmlspecialchars_uni($post['username']);





			$parser_options = array(
"allow_html" => $forum['allowhtml'],
"allow_mycode" => $forum['allowmycode'],

			$parser_options = array(
"allow_html" => $forum['allowhtml'],
"allow_mycode" => $forum['allowmycode'],

Zeile 1480Zeile 1577

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


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





		$plugins->run_hooks("moderation_split");

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

		$plugins->run_hooks("moderation_split");

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

Zeile 1496Zeile 1593
		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_do_split");

		}

$plugins->run_hooks("moderation_do_split");

Zeile 1503Zeile 1605
		$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']))

		}

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

Zeile 1530Zeile 1632
		$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);

		}

$pids = array();

		}

$pids = array();

Zeile 1551Zeile 1653
		log_moderator_action($modlogdata, $lang->thread_split);

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

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

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

		break;


		break;


	// Delete Thread Subscriptions
case "removesubscriptions":

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

	// Delete Thread Subscriptions
case "removesubscriptions":

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





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

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

		}

$plugins->run_hooks("moderation_removesubscriptions");






		}

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

$plugins->run_hooks("moderation_removesubscriptions");


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



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


Zeile 1576Zeile 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
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'candeletethreads'))

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

			{

			{

				error_no_permission();
}
}

				error_no_permission();
}
}

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

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

Zeile 1614Zeile 1721
		break;

// Actually delete the threads - Inline moderation

		break;

// Actually delete the threads - Inline moderation

	case "do_multideletethreads":

// Verify incoming POST request

	case "do_multideletethreads":

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

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

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

		{

		{

			error_no_permission();
}
foreach($threadlist as $tid)

			error_no_permission();
}
foreach($threadlist as $tid)

Zeile 1632Zeile 1739
		}
log_moderator_action($modlogdata, $lang->multi_deleted_threads);
if($mybb->get_input('inlinetype') == 'search')

		}
log_moderator_action($modlogdata, $lang->multi_deleted_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 1644Zeile 1751
		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'))
{

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

				error_no_permission();
}
}

Zeile 1667Zeile 1774
			}
}


			}
}


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

$moderation->open_threads($threads);


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

$moderation->open_threads($threads);


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

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

Zeile 1685Zeile 1792
		}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsopened);
break;

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





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


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


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

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

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

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

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


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


		$moderation->close_threads($threads);

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

		$moderation->close_threads($threads);

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

		}
else

		}
else

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

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

Zeile 1729Zeile 1836
		break;

// Approve threads - Inline moderation

		break;

// Approve threads - Inline moderation

	case "multiapprovethreads":

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

	case "multiapprovethreads":

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

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

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

Zeile 1753Zeile 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 1764Zeile 1871
			clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else

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

		{

		{

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

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





	// Unapprove threads - Inline moderation
case "multiunapprovethreads":


	// Unapprove threads - Inline moderation
case "multiunapprovethreads":


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

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

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

			{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canapproveunapprovethreads'))
{
error_no_permission();
}
}
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 1805Zeile 1912
		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_threadsunapproved);
break;

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





	// Restore threads - Inline moderation
case "multirestorethreads":


	// Restore threads - Inline moderation
case "multirestorethreads":


Zeile 1833Zeile 1940
		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canrestorethreads'))

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

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

$moderation->restore_threads($threads);


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

$moderation->restore_threads($threads);


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

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

		}
else

		}
else

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

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

Zeile 1873Zeile 1980
			}
}
else

			}
}
else

		{

		{

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

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

		}

		}

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

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

		}

$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

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

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

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

Zeile 1911Zeile 2018
			// 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();
}
}
else
{

			{
error_no_permission();
}
}
else
{

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

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

		}

		}

		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 1940Zeile 2047
			clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsstuck);

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

Zeile 1967Zeile 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 1989Zeile 2096
		add_breadcrumb($lang->nav_multi_movethreads);

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

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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

		}
else
{

		}
else
{

Zeile 2007Zeile 2114
		}

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')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');

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

		}

		}

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

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

Zeile 2032Zeile 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'))
{
error_no_permission();
}
foreach($threadlist as $tid)

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

		{

		{

			$tids[] = (int)$tid;

			$tids[] = (int)$tid;

		}

		}

		// Make sure moderator has permission to move to the new forum
$newperms = forum_permissions($moveto);
if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))

		// Make sure moderator has permission to move to the new forum
$newperms = forum_permissions($moveto);
if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))

		{
error_no_permission();
}

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

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


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

$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 2076Zeile 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 2135Zeile 2253
		if(!empty($tids))
{
foreach($tids as $tid)

		if(!empty($tids))
{
foreach($tids as $tid)

			{
$moderation->delete_thread($tid);

			{
$moderation->delete_thread($tid);

				mark_reports($tid, "thread");
$url = get_forum_link($fid);
}

				mark_reports($tid, "thread");
$url = get_forum_link($fid);
}

Zeile 2199Zeile 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 2231Zeile 2349
			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("\$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();

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

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

		{

		{

			clearinline($tid, 'thread');
}


			clearinline($tid, 'thread');
}


Zeile 2256Zeile 2374

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


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

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

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

		}

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

		}

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

		}

		}


if(!is_moderator_by_pids($postlist, "canmanagethreads"))
{
error_no_permission();
}


if(!is_moderator_by_pids($postlist, "canmanagethreads"))
{
error_no_permission();
}





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

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

		break;


		break;


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

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


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

			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

Zeile 2343Zeile 2461
			{
$pcheck2[] = $tcheck['tid'];
}

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

		}

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

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

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

		{

		{

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

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

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

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





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

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

Zeile 2379Zeile 2497
		{
$pid = (int)$pid;
$plist[] = $pid;

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

		}

		}


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


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

		}

		}


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


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

		{

		{

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

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

			}
}

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

			}
}

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)

			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)

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

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

				error($lang->error_cantsplitonepost);

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

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

// Make sure that we are not splitting all posts in the thread

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

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

			GROUP BY p.tid, p.pid
");
$pcheck2 = array();

Zeile 2441Zeile 2559
			}
}
if(count($pcheck2) != count($pcheck))

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

		{

		{

			// One or more threads do not have posts after splitting

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

		}

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

Zeile 2453Zeile 2571
		else
{
$moveto = $fid;

		else
{
$moveto = $fid;

		}


		}


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

		}

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

		}

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

Zeile 2467Zeile 2585
		$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);





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


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


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

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

		}
else

		}
else

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

if(count($posts) < 1)

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

if(count($posts) < 1)

		{
error($lang->error_inline_nopostsselected);

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

		}

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

		}

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

		}

		}

		$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

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

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

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

		$threads = $pcheck = array();
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 2528Zeile 2646
		while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)

		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

				$pcheck2[] = $tcheck['tid'];
}
}
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 2559Zeile 2677
		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 2577Zeile 2695
			}

if($postmatch[1])

			}

if($postmatch[1])

			{

			{

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

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

			}
}
else
{

			}
}
else
{

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

if(!empty($temp))

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

if(!empty($temp))

			{

			{

				for($i = 0; $i < count($temp); $i++)
{
$temp2 = explode("=", $temp[$i], 2);
$parameters[$temp2[0]] = $temp2[1];
}

				for($i = 0; $i < count($temp); $i++)
{
$temp2 = explode("=", $temp[$i], 2);
$parameters[$temp2[0]] = $temp2[1];
}

			}

			}

			else
{
$temp2 = explode("=", $splitloc[1], 2);

			else
{
$temp2 = explode("=", $splitloc[1], 2);

Zeile 2611Zeile 2729
		elseif(!empty($parameters['tid']))
{
$newtid = $parameters['tid'];

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

		}

		}

		else
{
$newtid = 0;

		else
{
$newtid = 0;

Zeile 2620Zeile 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'));
$plist = array();
foreach($postlist as $pid)

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

Zeile 2653Zeile 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 2672Zeile 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 2697Zeile 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 2725Zeile 2843
		}
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, "canapproveunapproveposts"))

		}

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

Zeile 2770Zeile 2888

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 2813Zeile 2931
		}
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 2857Zeile 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 2893Zeile 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']))
{

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


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


				$cache->update_banned();

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


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


Zeile 2992Zeile 3109
				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 3024Zeile 3141
			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']))

Zeile 3032Zeile 3154

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



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


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

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

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

Zeile 3043Zeile 3166
				output_page($page);
exit;
}

				output_page($page);
exit;
}

 

$tool['name'] = htmlspecialchars_uni($tool['name']);


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


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

Zeile 3055Zeile 3180
					$tids = getids($fid, "forum");
}
if(count($tids) < 1)

					$tids = getids($fid, "forum");
}
if(count($tids) < 1)

				{
error($lang->error_inline_nopostsselected);
}

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

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

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

Zeile 3066Zeile 3191
				$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);

				}

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

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

					moderation_redirect($return_url, $lang->redirect_customtool_search);
}
else
{

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

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

				}
break;
}

				}
break;
}

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

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

				}

				}


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


$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 3120Zeile 3245
				if($mybb->get_input('inlinetype') == 'search')
{
$pids = getids($mybb->get_input('searchid'), 'search');

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

				}
else
{

				}
else
{

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

if(count($pids) < 1)

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

if(count($pids) < 1)

				{
error($lang->error_inline_nopostsselected);
}

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

				if(!is_moderator_by_pids($pids, "canusecustomtools"))
{
error_no_permission();

				if(!is_moderator_by_pids($pids, "canusecustomtools"))
{
error_no_permission();

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

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

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

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

				}
else
{

				}
else
{

Zeile 3170Zeile 3295
						$lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);
moderation_redirect(get_thread_link($tid), $lang->redirect_customtool_thread);
}

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

				}

				}


break;
}


break;
}

Zeile 3181Zeile 3306

/**
* Some little handy functions for our inline moderation


/**
* Some little handy functions for our inline moderation

 *

 *

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

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

Zeile 3216Zeile 3341
	}

return $newids;

	}

return $newids;

}


}


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

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

Zeile 3257Zeile 3382
			$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);

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

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

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

 */

 */

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

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

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

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

	}

	}

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

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

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

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

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

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

	}

	}

 

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


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

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