Vergleich moderation.php - 1.8.6 - 1.8.17

  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';
$templatelist .= ',moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_threadnotes,moderation_getip_modoptions,moderation_getip,moderation_getpmip,moderation_merge';
$templatelist .= ',moderation_split_post,moderation_split,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts,moderation_threadnotes_modaction_error';
$templatelist .= ',moderation_inline_splitposts,forumjump_bit,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password,moderation_inline_moveposts,moderation_delayedmodaction_error,moderation_purgespammer,moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month';





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


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 34Zeile 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 105Zeile 110
	check_forum_password($forum['fid']);
}


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

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





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

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

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

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

{

{

	error_no_permission();
}


	error_no_permission();
}


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

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

		}

		}


$plugins->run_hooks('moderation_cancel_delayedmoderation');



$plugins->run_hooks('moderation_cancel_delayedmoderation');


Zeile 145Zeile 168
	case "delayedmoderation":
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

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


if(!$mybb->get_input('date_day', MyBB::INPUT_INT))
{
$mybb->input['date_day'] = date('d', TIME_NOW);
}



		
$localized_time_offset = $mybb->user['timezone']*3600 + $mybb->user['dst']*3600;

if(!$mybb->get_input('date_day', MyBB::INPUT_INT))
{
$mybb->input['date_day'] = gmdate('d', TIME_NOW + $localized_time_offset);
}

		if(!$mybb->get_input('date_month', MyBB::INPUT_INT))
{

		if(!$mybb->get_input('date_month', MyBB::INPUT_INT))
{

			$mybb->input['date_month'] = date('m', TIME_NOW);

			$mybb->input['date_month'] = gmdate('m', TIME_NOW + $localized_time_offset);

		}

// Assume in-line moderation if TID is not set

		}

// Assume in-line moderation if TID is not set

Zeile 161Zeile 186
			$mybb->input['tids'] = $tid;
}
else

			$mybb->input['tids'] = $tid;
}
else

		{

		{

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

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

			{

			{

				$fid = $mybb->get_input('fid', MyBB::INPUT_INT);
$tids = getids($fid, "forum");
}

				$fid = $mybb->get_input('fid', MyBB::INPUT_INT);
$tids = getids($fid, "forum");
}

Zeile 177Zeile 202
			}

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

			}

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

		}

		}


add_breadcrumb($lang->delayed_moderation);



add_breadcrumb($lang->delayed_moderation);


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


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


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

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

switch($db->type)



















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

if(is_moderator($fid, "canopenclosethreads"))
{
$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"))

		{

		{

			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[] = "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'])
{
$checked = "checked=\"checked\"";
}

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
















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


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



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


Zeile 225Zeile 281
			{
$mybb->input['type'] = '';
$errors[] = $lang->error_delayedmoderation_unsupported_type;

			{
$mybb->input['type'] = '';
$errors[] = $lang->error_delayedmoderation_unsupported_type;

			}


			}


			if($mybb->input['type'] == 'move' && (!isset($mybb->input['delayedmoderation']['method']) || !in_array($mybb->input['delayedmoderation']['method'], array('move', 'redirect', 'copy'))))
{
$mybb->input['delayedmoderation']['method'] = '';
$errors[] = $lang->error_delayedmoderation_unsupported_method;
}

			if($mybb->input['type'] == 'move' && (!isset($mybb->input['delayedmoderation']['method']) || !in_array($mybb->input['delayedmoderation']['method'], array('move', 'redirect', 'copy'))))
{
$mybb->input['delayedmoderation']['method'] = '';
$errors[] = $lang->error_delayedmoderation_unsupported_method;
}





			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'] != '')
{
$errors[] = $lang->error_invalidforum;

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

				}
}

if($mybb->input['date_day'] > 31 || $mybb->input['date_day'] < 1)
{







				}

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

if($mybb->input['date_day'] > 31 || $mybb->input['date_day'] < 1)
{

				$errors[] = $lang->error_delayedmoderation_invalid_date_day;
}


				$errors[] = $lang->error_delayedmoderation_invalid_date_day;
}


Zeile 252Zeile 323
				$errors[] = $lang->error_delayedmoderation_invalid_date_month;
}


				$errors[] = $lang->error_delayedmoderation_invalid_date_month;
}


			if($mybb->input['date_year'] < gmdate('Y', TIME_NOW))

			if($mybb->input['date_year'] < gmdate('Y', TIME_NOW + $localized_time_offset))

			{
$errors[] = $lang->error_delayedmoderation_invalid_date_year;

			{
$errors[] = $lang->error_delayedmoderation_invalid_date_year;

			}


			}


			$date_time = explode(' ', $mybb->get_input('date_time'));
$date_time = explode(':', (string)$date_time[0]);

if(stristr($mybb->input['date_time'], 'pm'))

			$date_time = explode(' ', $mybb->get_input('date_time'));
$date_time = explode(':', (string)$date_time[0]);

if(stristr($mybb->input['date_time'], 'pm'))

			{

			{

				$date_time[0] = 12+$date_time[0];
if($date_time[0] >= 24)
{
$date_time[0] = '00';

				$date_time[0] = 12+$date_time[0];
if($date_time[0] >= 24)
{
$date_time[0] = '00';

				}

				}

			}


			}


			$rundate = mktime((int)$date_time[0], (int)$date_time[1], date('s', TIME_NOW), $mybb->get_input('date_month', MyBB::INPUT_INT), $mybb->get_input('date_day', MyBB::INPUT_INT), $mybb->get_input('date_year', MyBB::INPUT_INT));

			$rundate = gmmktime((int)$date_time[0], (int)$date_time[1], date('s', TIME_NOW), $mybb->get_input('date_month', MyBB::INPUT_INT), $mybb->get_input('date_day', MyBB::INPUT_INT), $mybb->get_input('date_year', MyBB::INPUT_INT)) - $localized_time_offset;


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


if(!$errors)
{
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 289Zeile 360
				));

$plugins->run_hooks('moderation_do_delayedmoderation');

				));

$plugins->run_hooks('moderation_do_delayedmoderation');





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


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


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

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

			}
}
while($delayedmod = $db->fetch_array($query))
{
$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);



			}
}

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

			$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];
$info = '';
if(strpos($delayedmod['tids'], ',') === false)

			$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];
$info = '';
if(strpos($delayedmod['tids'], ',') === false)

			{

			{

				$delayed_thread = get_thread($delayedmod['tids']);

				$delayed_thread = get_thread($delayedmod['tids']);

				$info .= "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($delayedmod['tids'])."\">".htmlspecialchars_uni($delayed_thread['subject'])."</a><br />";
}



				$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

			else

			{
$info .= "<strong>{$lang->thread}</strong> {$lang->multiple_threads}<br />";
}

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


if($delayedmod['fname'])
{


if($delayedmod['fname'])
{

				$info .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($delayedmod['fid'])."\">".htmlspecialchars_uni($delayedmod['fname'])."</a><br />";



				$delayedmod['link'] = get_forum_link($delayedmod['fid']);
$delayedmod['fname'] = htmlspecialchars_uni($delayedmod['fname']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_forum")."\";");

			}
$delayedmod['inputs'] = my_unserialize($delayedmod['inputs']);

			}
$delayedmod['inputs'] = my_unserialize($delayedmod['inputs']);





			if($delayedmod['type'] == 'move')
{

			if($delayedmod['type'] == 'move')
{

				$info .= "<strong>{$lang->new_forum}</strong>  <a href=\"".get_forum_link($delayedmod['inputs']['new_forum'])."\">".htmlspecialchars_uni($forum_cache[$delayedmod['inputs']['new_forum']]['name'])."</a><br />";




				$delayedmod['link'] = get_forum_link($delayedmod['inputs']['new_forum']);
$delayedmod['name'] = htmlspecialchars_uni($forum_cache[$delayedmod['inputs']['new_forum']]['name']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_new_forum")."\";");


				if($delayedmod['inputs']['method'] == "redirect")
{
if((int)$delayedmod['inputs']['redirect_expire'] == 0)

				if($delayedmod['inputs']['method'] == "redirect")
{
if((int)$delayedmod['inputs']['redirect_expire'] == 0)

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

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

					$info .= "<strong>{$lang->leave_redirect_for}</strong> {$redirect_expire_bit}<br />";



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

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

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

				$info .= "<strong>{$lang->new_subject}</strong> ".htmlspecialchars_uni($delayedmod['inputs']['subject'])."<br />";
$info .= "<strong>{$lang->thread_to_merge_with}</strong> <a href=\"".htmlspecialchars_uni($delayedmod['inputs']['threadurl'])."\">".htmlspecialchars_uni($delayedmod['inputs']['threadurl'])."</a><br />";


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

			}

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

			}

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

Zeile 512Zeile 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;

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

			$threads = "<a href=\"".get_thread_link($tid)."\">{$thread['subject']}</a>";




			$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")."\";");
}
else

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

Zeile 540Zeile 625
			$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 568Zeile 653

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



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


		$dateyear = gmdate('Y', TIME_NOW);
$datetime = gmdate('g:i a', TIME_NOW);































		$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 587Zeile 702
		}

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

		}

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

		{

		{

			$openclose = $lang->opened;
$redirect = $lang->redirect_openthread;
$moderation->open_threads($tid);

			$openclose = $lang->opened;
$redirect = $lang->redirect_openthread;
$moderation->open_threads($tid);

Zeile 597Zeile 712
			$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);

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

		}

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

// Stick or unstick that post to the top bab!
case "stick":

		break;

// Stick or unstick that post to the top bab!
case "stick":

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


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

		}

		}


$plugins->run_hooks("moderation_stick");



$plugins->run_hooks("moderation_stick");


Zeile 630Zeile 745
			$redirect = $lang->redirect_stickthread;
$moderation->stick_threads($tid);
}

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





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

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

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

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

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

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

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

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

		{
error_no_permission();
}

$plugins->run_hooks("moderation_removeredirects");

		{
error_no_permission();
}

$plugins->run_hooks("moderation_removeredirects");


$moderation->remove_redirects($tid);



$moderation->remove_redirects($tid);


Zeile 659Zeile 774

// Delete thread confirmation page
case "deletethread":


// Delete thread confirmation page
case "deletethread":





		add_breadcrumb($lang->nav_deletethread);

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

		add_breadcrumb($lang->nav_deletethread);

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

Zeile 670Zeile 785
			}
}


			}
}


		$plugins->run_hooks("moderation_deletethread");

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

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

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

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

$plugins->run_hooks("moderation_do_deletethread");

		$plugins->run_hooks("moderation_deletethread");

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

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

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

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

$plugins->run_hooks("moderation_do_deletethread");


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


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

Zeile 715Zeile 830
			{
error_no_permission();
}

			{
error_no_permission();
}

		}

$plugins->run_hooks("moderation_deletepoll");

		}

$plugins->run_hooks("moderation_deletepoll");


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


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

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


	case "do_deletepoll":

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


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

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

		}

		}

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

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

Zeile 752Zeile 867
		if(!$poll)
{
error($lang->error_invalidpoll);

		if(!$poll)
{
error($lang->error_invalidpoll);

		}

		}


$plugins->run_hooks("moderation_do_deletepoll");



$plugins->run_hooks("moderation_do_deletepoll");


Zeile 767Zeile 882
	// 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 788Zeile 903

// 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 804Zeile 919
		log_moderator_action($modlogdata, $lang->thread_unapproved);

$moderation->unapprove_threads($tid);

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

$moderation->unapprove_threads($tid);





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


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


Zeile 815Zeile 930
		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);


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

		$plugins->run_hooks("moderation_restorethread");

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

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

		break;


		break;


	// Soft delete a thread
case "softdeletethread":


	// Soft delete a thread
case "softdeletethread":


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

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

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

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

		{
error_no_permission();
}

		{
error_no_permission();
}

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_softdeletethread");

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_softdeletethread");

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

$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 877Zeile 992
		$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"))

Zeile 888Zeile 1003
		$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 942Zeile 1057
		}

$plugins->run_hooks('moderation_viewthreadnotes');

		}

$plugins->run_hooks('moderation_viewthreadnotes');





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

$thread['notes'] = nl2br(htmlspecialchars_uni($thread['notes']));

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

$thread['notes'] = nl2br(htmlspecialchars_uni($thread['notes']));

Zeile 978Zeile 1093
			while($modaction = $db->fetch_array($query))
{
$modaction['dateline'] = my_date("jS M Y, G:i", $modaction['dateline']);

			while($modaction = $db->fetch_array($query))
{
$modaction['dateline'] = my_date("jS M Y, G:i", $modaction['dateline']);

 
				$modaction['username'] = htmlspecialchars_uni($modaction['username']);

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

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

				{
$info .= "<strong>$lang->thread</strong> <a href=\"".get_thread_link($modaction['tid'])."\">".htmlspecialchars_uni($modaction['tsubject'])."</a><br />";



				{
$modaction['tsubject'] = htmlspecialchars_uni($parser->parse_badwords($modaction['tsubject']));
$modaction['threadlink'] = get_thread_link($modaction['tid']);
eval("\$info .= \"".$templates->get("moderation_threadnotes_modaction_thread")."\";");

				}
if($modaction['fname'])
{

				}
if($modaction['fname'])
{

					$info .= "<strong>$lang->forum</strong> <a href=\"".get_forum_link($modaction['fid'])."\">".htmlspecialchars_uni($modaction['fname'])."</a><br />";



					$modaction['fname'] = htmlspecialchars_uni($modaction['fname']);
$modaction['forumlink'] = get_forum_link($modaction['fid']);
eval("\$info .= \"".$templates->get("moderation_threadnotes_modaction_forum")."\";");

				}
if($modaction['psubject'])
{

				}
if($modaction['psubject'])
{

					$info .= "<strong>$lang->post</strong> <a href=\"".get_post_link($modaction['pid'])."#pid".$modaction['pid']."\">".htmlspecialchars_uni($modaction['psubject'])."</a>";





$modaction['psubject'] = htmlspecialchars_uni($parser->parse_badwords($modaction['psubject']));
$modaction['postlink'] = get_post_link($modaction['pid']);
eval("\$info .= \"".$templates->get("moderation_threadnotes_modaction_post")."\";");

				}

eval("\$modactions .= \"".$templates->get("moderation_threadnotes_modaction")."\";");
$trow = alt_trow();

				}

eval("\$modactions .= \"".$templates->get("moderation_threadnotes_modaction")."\";");
$trow = alt_trow();

			}

			}

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

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

		}

		}


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


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

Zeile 1026Zeile 1149
		while($tool = $db->fetch_array($query))
{
$actions['modtool_'.$tool['tid']] = htmlspecialchars_uni($tool['name']);

		while($tool = $db->fetch_array($query))
{
$actions['modtool_'.$tool['tid']] = htmlspecialchars_uni($tool['name']);

		}


		}


		$forum_cache = $cache->read("forums");

$trow = alt_trow(1);
switch($db->type)

		$forum_cache = $cache->read("forums");

$trow = alt_trow(1);
switch($db->type)

		{

		{

			case "pgsql":
case "sqlite":

			case "pgsql":
case "sqlite":

				$query = $db->query("
SELECT d.*, u.username, f.name AS fname
FROM ".TABLE_PREFIX."delayedmoderation d

				$query = $db->query("
SELECT d.*, u.username, f.name AS fname
FROM ".TABLE_PREFIX."delayedmoderation d

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

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

					ORDER BY d.dateline DESC
LIMIT 0, 20

					ORDER BY d.dateline DESC
LIMIT 0, 20

				");
break;
default:

				");
break;
default:

Zeile 1060Zeile 1183
		while($delayedmod = $db->fetch_array($query))
{
$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);

		while($delayedmod = $db->fetch_array($query))
{
$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);

 
			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);

			$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];
$info = '';
if(strpos($delayedmod['tids'], ',') === false)
{

			$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];
$info = '';
if(strpos($delayedmod['tids'], ',') === false)
{

				$info .= "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($delayedmod['tids'])."\">{$thread['subject']}</a><br />";



				$delayed_thread['link'] = get_thread_link($delayedmod['tids']);
$delayed_thread['subject'] = htmlspecialchars_uni($thread['subject']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_single")."\";");

			}
else

			}
else

			{
$info .= "<strong>{$lang->thread}</strong> {$lang->multiple_threads}<br />";

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

			}

if($delayedmod['fname'])
{

			}

if($delayedmod['fname'])
{

				$info .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($delayedmod['fid'])."\">".htmlspecialchars_uni($delayedmod['fname'])."</a><br />";



				$delayedmod['link'] = get_forum_link($delayedmod['fid']);
$delayedmod['fname'] = htmlspecialchars_uni($delayedmod['fname']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_forum")."\";");

			}
$delayedmod['inputs'] = my_unserialize($delayedmod['inputs']);

if($delayedmod['type'] == 'move')
{

			}
$delayedmod['inputs'] = my_unserialize($delayedmod['inputs']);

if($delayedmod['type'] == 'move')
{

				$info .= "<strong>{$lang->new_forum}</strong>  <a href=\"".get_forum_link($delayedmod['inputs']['new_forum'])."\">".htmlspecialchars_uni($forum_cache[$delayedmod['inputs']['new_forum']]['name'])."</a><br />";




				$delayedmod['link'] = get_forum_link($delayedmod['inputs']['new_forum']);
$delayedmod['name'] = htmlspecialchars_uni($forum_cache[$delayedmod['inputs']['new_forum']]['name']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_new_forum")."\";");


				if($delayedmod['inputs']['method'] == "redirect")
{

				if($delayedmod['inputs']['method'] == "redirect")
{

					$info .= "<strong>{$lang->leave_redirect_for}</strong> ".(int)$delayedmod['inputs']['redirect_expire']." {$lang->days}<br />";










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

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

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

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

				$info .= "<strong>{$lang->new_subject}</strong> ".htmlspecialchars_uni($delayedmod['inputs']['subject'])."<br />";
$info .= "<strong>{$lang->thread_to_merge_with}</strong> <a href=\"".htmlspecialchars_uni($delayedmod['inputs']['threadurl'])."\">".htmlspecialchars_uni($delayedmod['inputs']['threadurl'])."</a><br />";


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

			}

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

			}

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

Zeile 1100Zeile 1241
			$cols = 4;
eval("\$delayedmods = \"".$templates->get("moderation_delayedmodaction_error")."\";");
}

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





		$plugins->run_hooks("moderation_threadnotes");

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

		$plugins->run_hooks("moderation_threadnotes");

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

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

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

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

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

		{
error_no_permission();

		{
error_no_permission();

		}

$plugins->run_hooks("moderation_do_threadnotes");

		}

$plugins->run_hooks("moderation_do_threadnotes");

Zeile 1134Zeile 1275
		if(!is_moderator($fid, "canviewips"))
{
error_no_permission();

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

		}


		}


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

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

Zeile 1143Zeile 1284
			$hostname = $lang->resolve_fail;
}


			$hostname = $lang->resolve_fail;
}


 
		$post['username'] = htmlspecialchars_uni($post['username']);

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

// Moderator options

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

// Moderator options

Zeile 1155Zeile 1297

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


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

Zeile 1194Zeile 1345

$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 1312Zeile 1472
	// 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"))
{

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

			error_no_permission();
}
$query = $db->query("

			error_no_permission();
}
$query = $db->query("

Zeile 1334Zeile 1494
		while($post = $db->fetch_array($query))
{
$postdate = my_date('relative', $post['dateline']);

		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'],


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

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

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

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



$plugins->run_hooks("moderation_split");


Zeile 1428Zeile 1591

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

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

		{
error_no_permission();
}

		{
error_no_permission();
}


$plugins->run_hooks("moderation_removesubscriptions");

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

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


$plugins->run_hooks("moderation_removesubscriptions");

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

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





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


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


Zeile 1451Zeile 1618
			// 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 1469Zeile 1636
		}

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

		}

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

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

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

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

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

Zeile 1484Zeile 1651

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


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


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



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


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

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

		}

		}

		foreach($threadlist as $tid)
{
$tid = (int)$tid;

		foreach($threadlist as $tid)
{
$tid = (int)$tid;

Zeile 1513Zeile 1680
		break;

// Open threads - Inline moderation

		break;

// Open threads - Inline moderation

	case "multiopenthreads":

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

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

	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

			}
}
else

Zeile 1534Zeile 1701
			{
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->open_threads($threads);

		}

$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 1557Zeile 1724

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


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





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


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


Zeile 1566Zeile 1733
			// 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);

		}

$moderation->close_threads($threads);

		}

$moderation->close_threads($threads);

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

		}

		}

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

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





	// Approve threads - Inline moderation

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

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

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

Zeile 1633Zeile 1800
			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();

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

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

			{
error_no_permission();
}
}

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

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

Zeile 1676Zeile 1843
			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();

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

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

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

			{
error_no_permission();
}
}
else
{

			{
error_no_permission();
}
}
else
{

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

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

		if(count($threads) < 1)

		if(count($threads) < 1)

		{
error($lang->error_inline_nothreadsselected);
}


		{
error($lang->error_inline_nothreadsselected);
}


		$moderation->restore_threads($threads);

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

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

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

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

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

			{
error_no_permission();
}
}
else

			{
error_no_permission();
}
}
else

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

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

			{

			{

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

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

		{
error($lang->error_inline_nothreadsselected);
}


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

		$moderation->soft_delete_threads($threads);

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

		}
else

		}
else

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

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

Zeile 1770Zeile 1937
		break;

// Stick threads - Inline moderation

		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

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

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

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

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

		}


		}


		$moderation->stick_threads($threads);

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

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

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

Zeile 1826Zeile 1993
				error_no_permission();
}
}

				error_no_permission();
}
}

		else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canstickunstickthreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);

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





		}

		}







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


		$moderation->unstick_threads($threads);

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

		$moderation->unstick_threads($threads);

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

Zeile 1849Zeile 2016
		else
{
clearinline($fid, 'forum');

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

		}

		}

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


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


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

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

			{

			{

				error_no_permission();
}

				error_no_permission();
}

		}


		}


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

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

		}

		}

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

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

Zeile 1903Zeile 2070
		$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 1913Zeile 2080
		// 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);

		}

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

		}

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

		}

		}


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



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


Zeile 1929Zeile 2096

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


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





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

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


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


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


if(count($posts) < 1)
{


if(count($posts) < 1)
{

Zeile 1960Zeile 2127
		{
clearinline($tid, 'thread');
}

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





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

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

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

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

Zeile 1969Zeile 2136

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

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

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

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

		{
error_no_permission();
}

		{
error_no_permission();
}

		$postlist = array_map('intval', $postlist);
$pids = implode(',', $postlist);


		$postlist = array_map('intval', $postlist);
$pids = implode(',', $postlist);


Zeile 1986Zeile 2153
		{
$query = $db->simple_select("threads", "tid", "firstpost IN({$pids})");
while($threadid = $db->fetch_field($query, "tid"))

		{
$query = $db->simple_select("threads", "tid", "firstpost IN({$pids})");
while($threadid = $db->fetch_field($query, "tid"))

			{

			{

				$tids[] = $threadid;
}
}

				$tids[] = $threadid;
}
}

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

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

		else
{

		else
{

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

Zeile 2026Zeile 2193
				mark_reports($plist, "posts");
$url = get_thread_link($thread['tid']);
}

				mark_reports($plist, "posts");
$url = get_thread_link($thread['tid']);
}

		}

		}


$lang->deleted_selective_posts = $lang->sprintf($lang->deleted_selective_posts, $deletecount);
log_moderator_action($modlogdata, $lang->deleted_selective_posts);


$lang->deleted_selective_posts = $lang->sprintf($lang->deleted_selective_posts, $deletecount);
log_moderator_action($modlogdata, $lang->deleted_selective_posts);

Zeile 2048Zeile 2215

// Add the selected posts from other threads
foreach($mybb->cookies as $key => $value)


// Add the selected posts from other threads
foreach($mybb->cookies as $key => $value)

		{

		{

			if(strpos($key, "inlinemod_thread") !== false && $key != "inlinemod_thread$tid")
{
$inlinepostlist = explode("|", $mybb->cookies[$key]);

			if(strpos($key, "inlinemod_thread") !== false && $key != "inlinemod_thread$tid")
{
$inlinepostlist = explode("|", $mybb->cookies[$key]);

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

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

		}


		}


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

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

		}

		}


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


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

Zeile 2083Zeile 2250
			LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE pid IN (".implode($posts, ",").")
ORDER BY dateline ASC

			LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE pid IN (".implode($posts, ",").")
ORDER BY dateline ASC

		");

		");

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

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

Zeile 2155Zeile 2322
	// 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


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


			error($lang->error_cantsplitall);
}


Zeile 2267Zeile 2434
		}

if(empty($posts))

		}

if(empty($posts))

		{
error($lang->error_inline_nopostsselected);

		{
error($lang->error_inline_nopostsselected);

		}

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

		}

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

Zeile 2293Zeile 2460
		}

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

		}

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

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

			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 2308Zeile 2475
			{
$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

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

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

		}
else
{

		}
else
{

			$moveto = $fid;
}


			$moveto = $fid;
}


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

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

Zeile 2356Zeile 2523
		if(count($posts) < 1)
{
error($lang->error_inline_nopostsselected);

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

		}

		}


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


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

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

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

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

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

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

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

Zeile 2426Zeile 2593

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


		$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 2864Zeile 3033
			$plugins->run_hooks("moderation_purgespammer_show");

add_breadcrumb($lang->purgespammer);

			$plugins->run_hooks("moderation_purgespammer_show");

add_breadcrumb($lang->purgespammer);

			$lang->purgespammer_purge = $lang->sprintf($lang->purgespammer_purge, $user['username']);

			$lang->purgespammer_purge = $lang->sprintf($lang->purgespammer_purge, htmlspecialchars_uni($user['username']));

			if($mybb->settings['purgespammerbandelete'] == "ban")
{
$lang->purgespammer_purge_desc = $lang->sprintf($lang->purgespammer_purge_desc, $lang->purgespammer_ban);

			if($mybb->settings['purgespammerbandelete'] == "ban")
{
$lang->purgespammer_purge_desc = $lang->sprintf($lang->purgespammer_purge_desc, $lang->purgespammer_ban);

Zeile 2899Zeile 3068

$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 2910Zeile 3080
				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 3008Zeile 3180
					'order_by' => 'dateline',
'order_dir' => 'asc'
);

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

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

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

				while($row = $db->fetch_array($query))
{
$tids[] = $row['tid'];

				while($row = $db->fetch_array($query))
{
$tids[] = $row['tid'];