Vergleich moderation.php - 1.8.8 - 1.8.15

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


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

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


if($pid)
{

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

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

 
}

$log_multithreads_actions = array("do_multideletethreads", "multiclosethreads", "multiopenthreads", "multiapprovethreads", "multiunapprovethreads", "multirestorethreads", "multisoftdeletethreads","multistickthreads", "multiunstickthreads", "do_multimovethreads");
if(in_array($mybb->input['action'], $log_multithreads_actions))
{
if(!empty($mybb->input['searchid']))
{
$tids = getids($mybb->get_input('searchid'), 'search');
}
else
{
$tids = getids($fid, 'forum');
}

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

unset($tids);

}

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


}

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


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


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


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

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

{

{

	error_no_permission();
}


	error_no_permission();
}


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

{
// Delayed Moderation
case "cancel_delayedmoderation":

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


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


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

		{

		{

			error_no_permission();

			error_no_permission();

		}

$plugins->run_hooks('moderation_cancel_delayedmoderation');

		}

$plugins->run_hooks('moderation_cancel_delayedmoderation');


$db->delete_query("delayedmoderation", "did='".$mybb->get_input('did', MyBB::INPUT_INT)."'");

if($tid == 0)
{


$db->delete_query("delayedmoderation", "did='".$mybb->get_input('did', MyBB::INPUT_INT)."'");

if($tid == 0)
{

			moderation_redirect(get_forum_link($fid), $lang->redirect_delayed_moderation_cancelled);
}
else
{

			moderation_redirect(get_forum_link($fid), $lang->redirect_delayed_moderation_cancelled);
}
else
{

			moderation_redirect("moderation.php?action=delayedmoderation&tid={$tid}&my_post_key={$mybb->post_code}", $lang->redirect_delayed_moderation_cancelled);
}
break;

			moderation_redirect("moderation.php?action=delayedmoderation&tid={$tid}&my_post_key={$mybb->post_code}", $lang->redirect_delayed_moderation_cancelled);
}
break;

Zeile 195Zeile 214
		$errors = array();
$customthreadtools = "";


		$errors = array();
$customthreadtools = "";


		$allowed_types = array('openclosethread', 'softdeleterestorethread', 'deletethread', 'move', 'stick', 'merge', 'removeredirects', 'removesubscriptions', 'approveunapprovethread');

		$allowed_types = array('move', 'merge', 'removeredirects', 'removesubscriptions');





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

switch($db->type)

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



		{

		{

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



















			$allowed_types[] = "openclosethread";
}

if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads"))
{
$allowed_types[] = "softdeleterestorethread";
}

if(is_moderator($fid, "candeletethreads"))
{
$allowed_types[] = "deletethread";
}

if(is_moderator($fid, "canstickunstickthreads"))
{
$allowed_types[] = "stick";
}

if(is_moderator($fid, "canapproveunapprovethreads"))
{
$allowed_types[] = "approveunapprovethread";
}

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

if(is_moderator($fid, "canusecustomtools"))

		{

		{

			$allowed_types[] = "modtool_".$tool['tid'];

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

$checked = "";
if($mybb->input['type'] == "modtool_".$tool['tid'])





			switch($db->type)
{
case "pgsql":
case "sqlite":
$query = $db->simple_select("modtools", 'tid, name, groups', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");
break;
default:
$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))

			{

			{

				$checked = "checked=\"checked\"";
}










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

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

$checked = "";
if($mybb->input['type'] == "modtool_".$tool['tid'])
{
$checked = "checked=\"checked\"";
}





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



					eval("\$customthreadtools .= \"".$templates->get("moderation_delayedmoderation_custommodtool")."\";");
}
}

		}

$mybb->input['delayedmoderation'] = $mybb->get_input('delayedmoderation', MyBB::INPUT_ARRAY);

		}

$mybb->input['delayedmoderation'] = $mybb->get_input('delayedmoderation', MyBB::INPUT_ARRAY);

Zeile 241Zeile 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 281Zeile 346
			{
if(is_array($mybb->input['tids']))
{

			{
if(is_array($mybb->input['tids']))
{

					$mybb->input['tids'] = implode(',' , $mybb->input['tids']);

					$mybb->input['tids'] = implode(',', $mybb->input['tids']);

				}

$did = $db->insert_query("delayedmoderation", array(

				}

$did = $db->insert_query("delayedmoderation", array(

Zeile 588Zeile 653

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


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

 

$openclosethread = '';
if(is_moderator($fid, "canopenclosethreads"))
{
eval('$openclosethread = "'.$templates->get('moderation_delayedmoderation_openclose').'";');
}

$softdeleterestorethread = '';
if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads"))
{
eval('$softdeleterestorethread = "'.$templates->get('moderation_delayedmoderation_softdeleterestore').'";');
}

$deletethread = '';
if(is_moderator($fid, "candeletethreads"))
{
eval('$deletethread = "'.$templates->get('moderation_delayedmoderation_delete').'";');
}

$stickunstickthread = '';
if(is_moderator($fid, "canstickunstickthreads"))
{
eval('$stickunstickthread = "'.$templates->get('moderation_delayedmoderation_stick').'";');
}

$approveunapprovethread = '';
if(is_moderator($fid, "canapproveunapprovethreads"))
{
eval('$approveunapprovethread = "'.$templates->get('moderation_delayedmoderation_approve').'";');
}


$plugins->run_hooks("moderation_delayedmoderation");



$plugins->run_hooks("moderation_delayedmoderation");


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


Zeile 615Zeile 710
			$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);

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

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

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

Zeile 632Zeile 727
		if(!is_moderator($fid, "canstickunstickthreads"))
{
error_no_permission();

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

		}


		}


		$plugins->run_hooks("moderation_stick");

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

		$plugins->run_hooks("moderation_stick");

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

		{

		{

			$stuckunstuck = $lang->unstuck;
$redirect = $lang->redirect_unstickthread;
$moderation->unstick_threads($tid);

			$stuckunstuck = $lang->unstuck;
$redirect = $lang->redirect_unstickthread;
$moderation->unstick_threads($tid);

Zeile 647Zeile 742
			$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);

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

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


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

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

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

		break;


		break;


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


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


Zeile 666Zeile 761
		{
error_no_permission();
}

		{
error_no_permission();
}





		$plugins->run_hooks("moderation_removeredirects");

$moderation->remove_redirects($tid);

		$plugins->run_hooks("moderation_removeredirects");

$moderation->remove_redirects($tid);





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

// Delete thread confirmation page
case "deletethread":

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

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

		}

$plugins->run_hooks("moderation_deletethread");

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

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

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

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

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


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


		$plugins->run_hooks("moderation_do_deletethread");

// Log the subject of the deleted thread

		$plugins->run_hooks("moderation_do_deletethread");

// Log the subject of the deleted thread

Zeile 715Zeile 810

$thread['subject'] = $db->escape_string($thread['subject']);
$lang->thread_deleted = $lang->sprintf($lang->thread_deleted, $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);


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


		$moderation->delete_thread($tid);

mark_reports($tid, "thread");
moderation_redirect(get_forum_link($fid), $lang->redirect_threaddeleted);
break;

		$moderation->delete_thread($tid);

mark_reports($tid, "thread");
moderation_redirect(get_forum_link($fid), $lang->redirect_threaddeleted);
break;





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

$plugins->run_hooks("moderation_deletepoll");



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

$plugins->run_hooks("moderation_deletepoll");


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

Zeile 784Zeile 879

// 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();
}
$thread = get_thread($tid);

$plugins->run_hooks("moderation_approvethread");



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

if(!is_moderator($fid, "canapproveunapprovethreads"))
{
error_no_permission();
}
$thread = get_thread($tid);

$plugins->run_hooks("moderation_approvethread");


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


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


Zeile 803Zeile 898

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


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





	// 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 817Zeile 912
		$thread = get_thread($tid);

$plugins->run_hooks("moderation_unapprovethread");

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

$moderation->unapprove_threads($tid);

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

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

		break;

		break;


// Restore a thread
case "restorethread":


// Restore a thread
case "restorethread":

Zeile 906Zeile 1001
		$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);

		}

$newforum = get_forum($moveto);

		}

$newforum = get_forum($moveto);

Zeile 1176Zeile 1271
	case "getip":
add_breadcrumb($lang->nav_getip);
if(!is_moderator($fid, "canviewips"))

	case "getip":
add_breadcrumb($lang->nav_getip);
if(!is_moderator($fid, "canviewips"))

		{
error_no_permission();
}


		{
error_no_permission();
}


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

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

		}

		}


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


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

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

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

		{

		{

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

$plugins->run_hooks('moderation_getip');


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

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


// Let's look up the ip address of a PM
case "getpmip":

Zeile 1239Zeile 1343

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


// Merge threads
case "merge":

Zeile 1316Zeile 1429
		{
$post = get_post($parameters['pid']);
$mergetid = (int)$post['tid'];

		{
$post = get_post($parameters['pid']);
$mergetid = (int)$post['tid'];

		}

		}

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

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

		}
else

		}
else

		{
$mergetid = 0;
}

		{
$mergetid = 0;
}

Zeile 1336Zeile 1449
		}
if(!is_moderator($mergethread['fid'], "canmanagethreads"))
{

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

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

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

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

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

		}


		}


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

Zeile 1357Zeile 1470
	// Divorce the posts in this thread (Split!)
case "split":
add_breadcrumb($lang->nav_split);

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

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

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

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

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

Zeile 1372Zeile 1485
		if($numposts <= 1)
{
error($lang->error_cantsplitonepost);

		if($numposts <= 1)
{
error($lang->error_cantsplitonepost);

		}

		}


$altbg = "trow1";
$posts = '';


$altbg = "trow1";
$posts = '';

Zeile 1398Zeile 1511
			eval("\$posts .= \"".$templates->get("moderation_split_post")."\";");
$altbg = alt_trow();
}

			eval("\$posts .= \"".$templates->get("moderation_split_post")."\";");
$altbg = alt_trow();
}

 

clearinline($tid, 'thread');

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

$plugins->run_hooks("moderation_split");

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

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

$plugins->run_hooks("moderation_split");

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

		break;


		break;


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


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


Zeile 1474Zeile 1589

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

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





		$plugins->run_hooks("moderation_removesubscriptions");

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

		$plugins->run_hooks("moderation_removesubscriptions");

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

Zeile 1493Zeile 1612
		add_breadcrumb($lang->nav_multi_deletethreads);

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

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

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

			{
error_no_permission();

			{
error_no_permission();

			}
}
else

			}
}
else

Zeile 1530Zeile 1649

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


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





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

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

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

		{
error_no_permission();

		{
error_no_permission();

		}
foreach($threadlist as $tid)

		}
foreach($threadlist as $tid)

		{

		{

			$tid = (int)$tid;
$moderation->delete_thread($tid);
$tlist[] = $tid;

			$tid = (int)$tid;
$moderation->delete_thread($tid);
$tlist[] = $tid;

Zeile 1549Zeile 1668
		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');
}
mark_reports($tlist, "threads");
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsdeleted);
break;

			clearinline($fid, 'forum');
}
mark_reports($tlist, "threads");
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsdeleted);
break;





	// Open threads - Inline moderation
case "multiopenthreads":

	// Open threads - Inline moderation
case "multiopenthreads":


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

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


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

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

		}

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

		}

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

		}

		}


$moderation->open_threads($threads);



$moderation->open_threads($threads);


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

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


		$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');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsclosed);
break;

// Approve threads - Inline moderation

			clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsclosed);
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');
if(!is_moderator($fid, 'canapproveunapprovethreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
{

	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(count($threads) < 1)
{

			error($lang->error_inline_nothreadsselected);
}


			error($lang->error_inline_nothreadsselected);
}


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

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

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

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

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

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

		}

		}





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

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





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

		log_moderator_action($modlogdata, $lang->multi_unapproved_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 1731Zeile 1850

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


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





		// 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 1744Zeile 1863
				error_no_permission();
}
}

				error_no_permission();
}
}

		else









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

		{

		{

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

$moderation->restore_threads($threads);










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

		log_moderator_action($modlogdata, $lang->multi_restored_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 1773Zeile 1892
		break;

// Soft delete threads - Inline moderation

		break;

// Soft delete threads - Inline moderation

	case "multisoftdeletethreads":


	case "multisoftdeletethreads":


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


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


Zeile 1787Zeile 1906
				error_no_permission();
}
}

				error_no_permission();
}
}

		else









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

		{

		{

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




































			error($lang->error_inline_nothreadsselected);
}

$moderation->soft_delete_threads($threads);

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

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

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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

		}

		}

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


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


		$moderation->soft_delete_threads($threads);

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

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

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

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

		$moderation->stick_threads($threads);

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




































		{

		{

			error($lang->error_inline_nothreadsselected);
}

$moderation->stick_threads($threads);

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

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









		}
else
{

		}
else
{

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

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

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

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

Zeile 1888Zeile 2007
		$moderation->unstick_threads($threads);

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

		$moderation->unstick_threads($threads);

log_moderator_action($modlogdata, $lang->multi_unstuck_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 1904Zeile 2023
		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();
}
}
else

				error_no_permission();
}
}
else

		{

		{

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

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

Zeile 1926Zeile 2045
			error($lang->error_inline_nothreadsselected);
}
$inlineids = implode("|", $threads);

			error($lang->error_inline_nothreadsselected);
}
$inlineids = implode("|", $threads);

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

		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

		{

		{

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

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

Zeile 1939Zeile 2058
		eval("\$movethread = \"".$templates->get("moderation_inline_movethreads")."\";");
output_page($movethread);
break;

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





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


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


Zeile 1949Zeile 2068
		$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
$threadlist = explode("|", $mybb->get_input('threads'));
if(!is_moderator_by_tids($threadlist, 'canmanagethreads'))

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

		{
error_no_permission();
}

		{
error_no_permission();
}

		foreach($threadlist as $tid)
{
$tids[] = (int)$tid;

		foreach($threadlist as $tid)
{
$tids[] = (int)$tid;

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

			error($lang->error_movetononmodforum);

		}

$newforum = get_forum($moveto);

		}

$newforum = get_forum($moveto);

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

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

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

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


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



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


Zeile 2015Zeile 2134

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


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





		// 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 2044Zeile 2163
			$moderation->delete_post($pid);
$plist[] = $pid;
$deletecount++;

			$moderation->delete_post($pid);
$plist[] = $pid;
$deletecount++;

		}

		}


// If we have multiple threads, we must be coming from the search
if(!empty($tids))


// If we have multiple threads, we must be coming from the search
if(!empty($tids))

		{

		{

			foreach($tids as $tid)

			foreach($tids as $tid)

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

			}
}
// Otherwise we're just deleting from showthread.php

			}
}
// Otherwise we're just deleting from showthread.php

Zeile 2062Zeile 2181
			$query = $db->simple_select("posts", "pid", "tid = $tid");
$numposts = $db->num_rows($query);
if(!$numposts)

			$query = $db->simple_select("posts", "pid", "tid = $tid");
$numposts = $db->num_rows($query);
if(!$numposts)

			{

			{

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

Zeile 2082Zeile 2201
	// Merge posts - Inline moderation
case "multimergeposts":
add_breadcrumb($lang->nav_multi_mergeposts);

	// Merge posts - Inline moderation
case "multimergeposts":
add_breadcrumb($lang->nav_multi_mergeposts);


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


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

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

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

Zeile 2161Zeile 2280
		else
{
clearinline($tid, 'thread');

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

		}

		}


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



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


Zeile 2171Zeile 2290

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


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


Zeile 2187Zeile 2306
		}

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

		}

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

		{
error_no_permission();
}

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

		{
error_no_permission();
}

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


mark_reports($postlist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);


mark_reports($postlist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);

Zeile 2201Zeile 2320
	// 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
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin)
GROUP BY p.tid, p.pid
");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)
{
$pcheck2[] = $tcheck['tid'];
}
}
if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting
error($lang->error_cantsplitall);
}

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



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
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin)
GROUP BY p.tid, p.pid
");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)
{
$pcheck2[] = $tcheck['tid'];
}
}
if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting
error($lang->error_cantsplitall);
}

$inlineids = implode("|", $posts);
if($mybb->get_input('inlinetype') == 'search')
{
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'));

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

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

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

Zeile 2303Zeile 2422

// Ensure all posts exist
$posts = array();


// Ensure all posts exist
$posts = array();

		if(!empty($plist))

		if(!empty($plist))

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

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

Zeile 2329Zeile 2448
			GROUP BY p.tid, p.pid
");
$pcheck = array();

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

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

Zeile 2349Zeile 2468
		");
$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'];

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

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

		}

		}


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


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

Zeile 2413Zeile 2532

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


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

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

		$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

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

Zeile 2472Zeile 2591

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

 

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


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

Zeile 2801Zeile 2922
		require_once MYBB_ROOT."inc/functions_user.php";

$groups = explode(",", $mybb->settings['purgespammergroups']);

		require_once MYBB_ROOT."inc/functions_user.php";

$groups = explode(",", $mybb->settings['purgespammergroups']);

		if(!in_array($mybb->user['usergroup'], $groups))

		if(!is_member($groups))

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 2956Zeile 3077
				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')
{