Vergleich moderation.php - 1.8.13 - 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,moderation_purgespammer";
$templatelist .= ",moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_threadnotes,moderation_getip_modoptions,moderation_getip,moderation_getpmip";

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

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

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

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

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

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


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


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

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

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


if($pid)
{


if($pid)
{

Zeile 290Zeile 291

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


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

				$newforum = get_forum($fid);










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

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

$newforum = get_forum($newfid);

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

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

				{

				{

					$errors[] = $lang->error_invalidforum;

					$errors[] = $lang->error_invalidforum;

 
				}

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

				}
}


				}
}


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

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

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

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

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

Zeile 607Zeile 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 985Zeile 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 1237Zeile 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();
}

$plugins->run_hooks("moderation_do_threadnotes");

		{
error_no_permission();
}

$plugins->run_hooks("moderation_do_threadnotes");


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


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

Zeile 1249Zeile 1267
		);
$db->update_query("threads", $sqlarray, "tid='$tid'");
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadnotesupdated);

		);
$db->update_query("threads", $sqlarray, "tid='$tid'");
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadnotesupdated);

		break;


		break;


	// Let's look up the ip address of a post
case "getip":
add_breadcrumb($lang->nav_getip);
if(!is_moderator($fid, "canviewips"))

	// Let's look up the ip address of a post
case "getip":
add_breadcrumb($lang->nav_getip);
if(!is_moderator($fid, "canviewips"))

		{

		{

			error_no_permission();
}


			error_no_permission();
}


Zeile 1264Zeile 1282
		if(!$hostname || $hostname == $post['ipaddress'])
{
$hostname = $lang->resolve_fail;

		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 1274Zeile 1292
		if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canuseipsearch'] == 1)
{
$ipaddress = $post['ipaddress'];

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

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

$plugins->run_hooks('moderation_getip');

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










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

$plugins->run_hooks('moderation_getip');

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 1296Zeile 1323
		if(!$mybb->usergroup['issupermod'])
{
error_no_permission();

		if(!$mybb->usergroup['issupermod'])
{
error_no_permission();

		}


		}


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

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

Zeile 1318Zeile 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":
add_breadcrumb($lang->nav_merge);


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

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

$plugins->run_hooks("moderation_merge");

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

$plugins->run_hooks("moderation_merge");


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


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





	// Let's get those threads together baby! (Merge threads)
case "do_merge":


	// Let's get those threads together baby! (Merge threads)
case "do_merge":


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

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

			}


			}


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

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

Zeile 1560Zeile 1596
        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_removesubscriptions");

		{
error_no_permission();
}

$plugins->run_hooks("moderation_removesubscriptions");


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

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


$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 1582Zeile 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 1600Zeile 1636
		}

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

		}

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

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

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

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

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

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

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

		}

		}

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

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

		}

		}

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

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

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

if(count($threads) < 1)
{

	case "multiopenthreads":

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

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

if(count($threads) < 1)
{

			error($lang->error_inline_nothreadsselected);
}


			error($lang->error_inline_nothreadsselected);
}


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

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





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


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


Zeile 1713Zeile 1749
		{
error($lang->error_inline_nothreadsselected);
}

		{
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');
}
else
{
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)
{
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');
}
else
{
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)
{
error($lang->error_inline_nothreadsselected);
}


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

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

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

log_moderator_action($modlogdata, $lang->multi_approved_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 1790Zeile 1826
		{
$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);

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

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

log_moderator_action($modlogdata, $lang->multi_unapproved_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 1833Zeile 1869
		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canrestorethreads'))

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

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


			{
error_no_permission();
}
}
if(count($threads) < 1)
{
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 1876Zeile 1912
		{
$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($lang->error_inline_nothreadsselected);
}

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


$moderation->soft_delete_threads($threads);

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


$moderation->soft_delete_threads($threads);

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

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

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

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

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

Zeile 1901Zeile 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
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canstickunstickthreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);
}


	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)
{
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 1961Zeile 1997
		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canstickunstickthreads'))

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

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

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

		$moderation->unstick_threads($threads);

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

Zeile 1980Zeile 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 1993Zeile 2029
			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'canmanagethreads'))

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

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

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

Zeile 2011Zeile 2047
			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 2024Zeile 2060
		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 2036Zeile 2072
		if(!is_moderator_by_tids($threadlist, 'canmanagethreads'))
{
error_no_permission();

		if(!is_moderator_by_tids($threadlist, 'canmanagethreads'))
{
error_no_permission();

		}

		}

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

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

		}

		}

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

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

		{
error_no_permission();
}

		{
error($lang->error_movetononmodforum);
}


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

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

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

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

Zeile 2064Zeile 2100
	// 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(count($posts) < 1)
{
error($lang->error_inline_nopostsselected);
}
if(!is_moderator_by_pids($posts, "candeleteposts"))
{
error_no_permission();


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

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

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

Zeile 2090Zeile 2126
		else
{
clearinline($tid, 'thread');

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

		}

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


		}

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


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

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





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


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


Zeile 2114Zeile 2150

$tids = array();
if($pids)


$tids = array();
if($pids)

		{

		{

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

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

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

		{

		{

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

$parser_options = array(

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

$parser_options = array(

Zeile 2286Zeile 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
error($lang->error_cantsplitall);
}

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


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

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

Zeile 2369Zeile 2405

// Actually split the posts - Inline moderation
case "do_multisplitposts":


// Actually split the posts - Inline moderation
case "do_multisplitposts":


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

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

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

// Ensure all posts exist
$posts = array();
if(!empty($plist))
{
$query = $db->simple_select('posts', 'pid', 'pid IN ('.implode(',', $plist).')');
while($pid = $db->fetch_field($query, 'pid'))
{
$posts[] = $pid;
}
}

if(empty($posts))
{


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

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

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

// Ensure all posts exist
$posts = array();
if(!empty($plist))
{
$query = $db->simple_select('posts', 'pid', 'pid IN ('.implode(',', $plist).')');
while($pid = $db->fetch_field($query, 'pid'))
{
$posts[] = $pid;
}
}

if(empty($posts))
{

			error($lang->error_inline_nopostsselected);
}


			error($lang->error_inline_nopostsselected);
}


Zeile 2424Zeile 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("
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))
{

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

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

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

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

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

// Make sure that we are not moving posts in a thread with one post
// Select number of posts in each thread that the moved post is in
$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 moving all posts in the thread
// The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal)
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin)
GROUP BY p.tid, p.pid
");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)

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

// Make sure that we are not moving posts in a thread with one post
// Select number of posts in each thread that the moved post is in
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin)
GROUP BY p.tid, p.pid
");
$threads = $pcheck = array();
while($tcheck = $db->fetch_array($query))
{
if((int)$tcheck['count'] <= 1)
{
error($lang->error_cantsplitonepost);
}
$threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below
}

// Make sure that we are not moving all posts in the thread
// The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal)
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin)
GROUP BY p.tid, p.pid
");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)

			{
$pcheck2[] = $tcheck['tid'];
}
}
if(count($pcheck2) != count($pcheck))

			{
$pcheck2[] = $tcheck['tid'];
}
}
if(count($pcheck2) != count($pcheck))

		{

		{

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

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

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

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

		{

		{

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

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

Zeile 2554Zeile 2590

// Actually split the posts - Inline moderation
case "do_multimoveposts":


// Actually split the posts - Inline moderation
case "do_multimoveposts":





		// 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 2570Zeile 2606
			// Get thread to merge's tid the SEO way
preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch);
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);

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





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

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

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

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

			}
}
else

			}
}
else

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

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

Zeile 2603Zeile 2639
		}

if(!empty($parameters['pid']) && empty($parameters['tid']))

		}

if(!empty($parameters['pid']) && empty($parameters['tid']))

		{

		{

			$query = $db->simple_select("posts", "tid", "pid='".(int)$parameters['pid']."'");
$post = $db->fetch_array($query);
$newtid = $post['tid'];

			$query = $db->simple_select("posts", "tid", "pid='".(int)$parameters['pid']."'");
$post = $db->fetch_array($query);
$newtid = $post['tid'];

Zeile 2613Zeile 2649
			$newtid = $parameters['tid'];
}
else

			$newtid = $parameters['tid'];
}
else

		{

		{

			$newtid = 0;
}
$newtid = (int)$newtid;

			$newtid = 0;
}
$newtid = (int)$newtid;

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

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

		}

		}


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



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


Zeile 2775Zeile 2811
		$pids = array();

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

		$pids = array();

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

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

$moderation->unapprove_posts($pids);


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

$moderation->unapprove_posts($pids);


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

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

Zeile 2893Zeile 2929
			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 3032Zeile 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 3043Zeile 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')
{