Vergleich moderation.php - 1.8.8 - 1.8.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1474Zeile 1474

// Delete Thread Subscriptions
case "removesubscriptions":


// Delete Thread Subscriptions
case "removesubscriptions":

 

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


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

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

Zeile 1717Zeile 1721
		$moderation->unapprove_threads($threads, $fid);

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

		$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($fid, 'forum');

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

		}
$cache->update_stats();
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunapproved);

		}
$cache->update_stats();
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunapproved);

Zeile 1748Zeile 1752
		{
$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');

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

		}

		}

		else
{
clearinline($fid, 'forum');
}
$cache->update_stats();
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsrestored);

		else
{
clearinline($fid, 'forum');
}
$cache->update_stats();
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsrestored);

		break;


		break;


	// Soft delete threads - Inline moderation
case "multisoftdeletethreads":

	// Soft delete threads - Inline moderation
case "multisoftdeletethreads":





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


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


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

			{
error_no_permission();
}
}

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

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

Zeile 1816Zeile 1820
		break;

// Stick threads - Inline moderation

		break;

// Stick threads - Inline moderation

	case "multistickthreads":


	case "multistickthreads":


		// 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 1846Zeile 1850
		$moderation->stick_threads($threads);

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

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

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

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





	// Unstick threads - Inline moderaton

	// Unstick threads - Inline moderaton

	case "multiunstickthreads":

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

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

	case "multiunstickthreads":

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

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

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

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

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

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

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

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

		$moderation->unstick_threads($threads);

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

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

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


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


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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

		}
else
{

		}
else
{

Zeile 1972Zeile 1976
		$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);





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


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


Zeile 2201Zeile 2205
	// 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);



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

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

Zeile 2233Zeile 2237
			GROUP BY p.tid, p.pid
");
$threads = $pcheck = array();

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

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

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

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


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


Zeile 2251Zeile 2255
			WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin)
GROUP BY p.tid, p.pid
");

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

			{
$pcheck2[] = $tcheck['tid'];
}

			{
$pcheck2[] = $tcheck['tid'];
}

		}

		}

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

		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 2269Zeile 2273
		if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');

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

		}

		}

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

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

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

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

		}


		}


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

// Make sure that we are not splitting a thread with one post

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

// Make sure that we are not splitting a thread with one post

Zeile 2339Zeile 2343
		}

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

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

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

Zeile 2378Zeile 2382

$newsubject = $mybb->get_input('newsubject');
$newtid = $moderation->split_posts($posts, $tid, $moveto, $newsubject);


$newsubject = $mybb->get_input('newsubject');
$newtid = $moderation->split_posts($posts, $tid, $moveto, $newsubject);





		$pid_list = implode(', ', $posts);
$lang->split_selective_posts = $lang->sprintf($lang->split_selective_posts, $pid_list, $newtid);
log_moderator_action($modlogdata, $lang->split_selective_posts);

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

		$pid_list = implode(', ', $posts);
$lang->split_selective_posts = $lang->sprintf($lang->split_selective_posts, $pid_list, $newtid);
log_moderator_action($modlogdata, $lang->split_selective_posts);

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





	// Move posts - Inline moderation
case "multimoveposts":
add_breadcrumb($lang->nav_multi_moveposts);

	// Move posts - Inline moderation
case "multimoveposts":
add_breadcrumb($lang->nav_multi_moveposts);

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

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

		}
else

		}
else

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

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

Zeile 2472Zeile 2476

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