Vergleich moderation.php - 1.8.26 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 39Zeile 39
$fid = $mybb->get_input('fid', MyBB::INPUT_INT);
$pmid = $mybb->get_input('pmid', MyBB::INPUT_INT);
$modal = $mybb->get_input('modal', 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($mybb->user['uid'] == 0)
{
error_no_permission();
}



if($pid)
{


if($pid)
{

Zeile 71Zeile 77
	// Get our permissions all nice and setup
$permissions = forum_permissions($fid);
}

	// Get our permissions all nice and setup
$permissions = forum_permissions($fid);
}





if($pmid > 0)
{
$query = $db->simple_select('privatemessages', 'uid, subject, ipaddress, fromid', "pmid = $pmid");

if($pmid > 0)
{
$query = $db->simple_select('privatemessages', 'uid, subject, ipaddress, fromid', "pmid = $pmid");

Zeile 81Zeile 87
	if(!$pm)
{
error($lang->error_invalidpm, $lang->error);

	if(!$pm)
{
error($lang->error_invalidpm, $lang->error);

	}

	}

}

// Get some navigation if we need it

}

// Get some navigation if we need it

Zeile 202Zeile 208
			}

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

			}

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

		}

add_breadcrumb($lang->delayed_moderation);


		}

add_breadcrumb($lang->delayed_moderation);


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

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

Zeile 287Zeile 293
			{
$mybb->input['delayedmoderation']['method'] = '';
$errors[] = $lang->error_delayedmoderation_unsupported_method;

			{
$mybb->input['delayedmoderation']['method'] = '';
$errors[] = $lang->error_delayedmoderation_unsupported_method;

			}


			}


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

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

Zeile 298Zeile 304
				if($newperms['canview'] == 0 || !is_moderator($newfid, 'canmovetononmodforum'))
{
$errors[] = $lang->error_movetononmodforum;

				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;

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

				}

				}


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


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

Zeile 330Zeile 336

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


$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(stristr($mybb->input['date_time'], 'pm'))
{
$date_time[0] = 12+$date_time[0];

Zeile 341Zeile 347
			}

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

			}

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

Zeile 371Zeile 377
				else
{
if($mybb->get_input('inlinetype') == 'search')

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

					{

					{

						moderation_redirect(get_forum_link($fid), $lang->sprintf($lang->redirect_delayed_moderation_search, $rundate_format));
}
else

						moderation_redirect(get_forum_link($fid), $lang->sprintf($lang->redirect_delayed_moderation_search, $rundate_format));
}
else

Zeile 420Zeile 426
			$method_selected = array('move' => 'checked="checked"', 'redirect' => '', 'copy' => '');

$mybb->input['delayedmoderation']['redirect_expire'] = '';

			$method_selected = array('move' => 'checked="checked"', 'redirect' => '', 'copy' => '');

$mybb->input['delayedmoderation']['redirect_expire'] = '';

			$mybb->input['delayedmoderation']['subject'] = $thread['subject'];

			$mybb->input['delayedmoderation']['subject'] = isset($thread['subject']) ? $thread['subject'] : '';

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

$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "delayedmoderation[new_forum]");

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

$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "delayedmoderation[new_forum]");

Zeile 493Zeile 499
						$where_array[] = "CONCAT(',',d.tids,',') LIKE  '%,".$db->escape_string($like).",%'";
}
$where_statement = implode(" OR ", $where_array);

						$where_array[] = "CONCAT(',',d.tids,',') LIKE  '%,".$db->escape_string($like).",%'";
}
$where_statement = implode(" OR ", $where_array);

			}

			}

			$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

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

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

		}

		}

		else
{
switch($db->type)
{
case "pgsql":
case "sqlite":

		else
{
switch($db->type)
{
case "pgsql":
case "sqlite":

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

					$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."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:
$query = $db->query("

					break;
default:
$query = $db->query("

Zeile 534Zeile 540
		}

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

		}

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

		{

		{

			$delayedmod['dateline'] = my_date('normal', $delayedmod['delaydateline'], "", 2);
$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);

			$delayedmod['dateline'] = my_date('normal', $delayedmod['delaydateline'], "", 2);
$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);

Zeile 697Zeile 703
		verify_post_check($mybb->get_input('my_post_key'));

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

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

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

		{
error_no_permission();
}

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

		{
error_no_permission();
}

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

		}

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

		}

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

Zeile 785Zeile 791

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


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

		break;


		break;


	// Delete thread confirmation page
case "deletethread":

add_breadcrumb($lang->nav_deletethread);

	// Delete thread confirmation page
case "deletethread":

add_breadcrumb($lang->nav_deletethread);


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


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

		}

$plugins->run_hooks("moderation_deletethread");

		}

$plugins->run_hooks("moderation_deletethread");

Zeile 807Zeile 813
		break;

// Delete the actual thread here

		break;

// Delete the actual thread here

	case "do_deletethread":

	case "do_deletethread":


// 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 827Zeile 833

$thread['subject'] = $db->escape_string($thread['subject']);
$lang->thread_deleted = $lang->sprintf($lang->thread_deleted, $thread['subject']);


$thread['subject'] = $db->escape_string($thread['subject']);
$lang->thread_deleted = $lang->sprintf($lang->thread_deleted, $thread['subject']);

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


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


		$moderation->delete_thread($tid);

mark_reports($tid, "thread");

		$moderation->delete_thread($tid);

mark_reports($tid, "thread");

Zeile 840Zeile 846
		add_breadcrumb($lang->nav_deletepoll);

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

		add_breadcrumb($lang->nav_deletepoll);

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

		{

		{

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

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

Zeile 848Zeile 854
		}

$plugins->run_hooks("moderation_deletepoll");

		}

$plugins->run_hooks("moderation_deletepoll");





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

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

Zeile 863Zeile 869
	// Delete the actual poll here!
case "do_deletepoll":


	// Delete the actual poll here!
case "do_deletepoll":


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

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

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

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

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

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

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

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

Zeile 881Zeile 887
			{
error_no_permission();
}

			{
error_no_permission();
}

		}

		}

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

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

Zeile 901Zeile 907

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

if($thread['visible'] == -1)
{


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

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

if($thread['visible'] == -1)
{

			error($lang->error_thread_deleted, $lang->error);
}


			error($lang->error_thread_deleted, $lang->error);
}


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


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


		$moderation->soft_delete_threads($tid);


		$moderation->soft_delete_threads($tid);


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

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

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

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

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

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


if($thread['visible'] == -1)
{


if($thread['visible'] == -1)
{

			error($lang->error_thread_deleted, $lang->error);
}


			error($lang->error_thread_deleted, $lang->error);
}


		$plugins->run_hooks("moderation_move");


		$plugins->run_hooks("moderation_move");


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

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

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

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

Zeile 1035Zeile 1041

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


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

		{

		{

			error_no_permission();
}

if($thread['visible'] == -1)

			error_no_permission();
}

if($thread['visible'] == -1)

		{

		{

			error($lang->error_thread_deleted, $lang->error);
}


			error($lang->error_thread_deleted, $lang->error);
}


Zeile 1058Zeile 1064
		if($method != "copy" && $thread['fid'] == $moveto)
{
error($lang->error_movetosameforum, $lang->error);

		if($method != "copy" && $thread['fid'] == $moveto)
{
error($lang->error_movetosameforum, $lang->error);

		}

$plugins->run_hooks('moderation_do_move');

		}

$plugins->run_hooks('moderation_do_move');


$expire = 0;
if($mybb->get_input('redirect_expire', MyBB::INPUT_INT) > 0)


$expire = 0;
if($mybb->get_input('redirect_expire', MyBB::INPUT_INT) > 0)

Zeile 1076Zeile 1082
		{
case "copy":
log_moderator_action($modlogdata, $lang->thread_copied);

		{
case "copy":
log_moderator_action($modlogdata, $lang->thread_copied);

				break;

				break;

			default:
case "move":
case "redirect":

			default:
case "move":
case "redirect":

Zeile 1199Zeile 1205

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


$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 1240Zeile 1246
			else
{
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_multiple")."\";");

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

			}


			}


			if($delayedmod['fname'])
{
$delayedmod['link'] = get_forum_link($delayedmod['fid']);

			if($delayedmod['fname'])
{
$delayedmod['link'] = get_forum_link($delayedmod['fid']);

Zeile 1365Zeile 1371
		add_breadcrumb($pm['subject'], "private.php?action=read&pmid={$pmid}");
add_breadcrumb($lang->nav_getpmip);
if(!$mybb->usergroup['issupermod'])

		add_breadcrumb($pm['subject'], "private.php?action=read&pmid={$pmid}");
add_breadcrumb($lang->nav_getpmip);
if(!$mybb->usergroup['issupermod'])

		{
error_no_permission();

		{
error_no_permission();

		}

$pm['ipaddress'] = my_inet_ntop($db->unescape_binary($pm['ipaddress']));

		}

$pm['ipaddress'] = my_inet_ntop($db->unescape_binary($pm['ipaddress']));

Zeile 1374Zeile 1380
		if(!$hostname || $hostname == $pm['ipaddress'])
{
$hostname = $lang->resolve_fail;

		if(!$hostname || $hostname == $pm['ipaddress'])
{
$hostname = $lang->resolve_fail;

		}

		}


$name = $db->fetch_field($db->simple_select('users', 'username', "uid = {$pm['fromid']}"), 'username');
$username = build_profile_link($name, $pm['fromid']);


$name = $db->fetch_field($db->simple_select('users', 'username', "uid = {$pm['fromid']}"), 'username');
$username = build_profile_link($name, $pm['fromid']);

Zeile 1394Zeile 1400
			eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";");
echo $getpmip;
exit;

			eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";");
echo $getpmip;
exit;

		}

		}

		else
{
eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";");

		else
{
eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";");

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

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


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

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


		$plugins->run_hooks("moderation_merge");

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

		$plugins->run_hooks("moderation_merge");

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

Zeile 1449Zeile 1455
			// 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];

			}

			}


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


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

			}

			}

		}
else
{

		}
else
{

Zeile 1473Zeile 1479
					$temp2 = explode("=", $temp[$i], 2);
$parameters[$temp2[0]] = $temp2[1];
}

					$temp2 = explode("=", $temp[$i], 2);
$parameters[$temp2[0]] = $temp2[1];
}

			}

			}

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

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

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

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

		}
else
{

		}
else
{

			$mergetid = 0;

			$mergetid = 0;

		}

		}

		$mergethread = get_thread($mergetid);
if(!$mergethread)
{
error($lang->error_badmergeurl, $lang->error);

		$mergethread = get_thread($mergetid);
if(!$mergethread)
{
error($lang->error_badmergeurl, $lang->error);

		}

		}

		if($mergetid == $tid)
{ // sanity check
error($lang->error_mergewithself, $lang->error);

		if($mergetid == $tid)
{ // sanity check
error($lang->error_mergewithself, $lang->error);

		}

		}

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

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

Zeile 1512Zeile 1518
			$subject = $mybb->get_input('subject');
}
else

			$subject = $mybb->get_input('subject');
}
else

		{

		{

			$subject = $thread['subject'];

			$subject = $thread['subject'];

		}

$moderation->merge_threads($mergetid, $tid, $subject);

		}

$moderation->merge_threads($mergetid, $tid, $subject);


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



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


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

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

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

if($thread['visible'] == -1)
{

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

if($thread['visible'] == -1)
{

			error($lang->error_thread_deleted, $lang->error);
}


			error($lang->error_thread_deleted, $lang->error);
}


Zeile 1541Zeile 1547
			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE tid='$tid'

			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE tid='$tid'

			ORDER BY dateline ASC

			ORDER BY dateline ASC, pid ASC

		");

$numposts = $db->num_rows($query);

		");

$numposts = $db->num_rows($query);

Zeile 1549Zeile 1555
		{
error($lang->error_cantsplitonepost, $lang->error);
}

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





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

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

Zeile 1573Zeile 1579
			$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();

		}


		}


		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 1598Zeile 1604
		if($thread['visible'] == -1)
{
error($lang->error_thread_deleted, $lang->error);

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

		}

$plugins->run_hooks("moderation_do_split");


		}

$plugins->run_hooks("moderation_do_split");


		$mybb->input['splitpost'] = $mybb->get_input('splitpost', MyBB::INPUT_ARRAY);
if(empty($mybb->input['splitpost']))
{
error($lang->error_nosplitposts, $lang->error);

		$mybb->input['splitpost'] = $mybb->get_input('splitpost', MyBB::INPUT_ARRAY);
if(empty($mybb->input['splitpost']))
{
error($lang->error_nosplitposts, $lang->error);

		}

		}

		$query = $db->simple_select("posts", "COUNT(*) AS totalposts", "tid='{$tid}'");
$count = $db->fetch_array($query);


		$query = $db->simple_select("posts", "COUNT(*) AS totalposts", "tid='{$tid}'");
$count = $db->fetch_array($query);


Zeile 1616Zeile 1622
		}

if($count['totalposts'] == count($mybb->input['splitpost']))

		}

if($count['totalposts'] == count($mybb->input['splitpost']))

		{

		{

			error($lang->error_cantsplitall, $lang->error);
}


			error($lang->error_cantsplitall, $lang->error);
}


Zeile 1627Zeile 1633
		else
{
$moveto = $fid;

		else
{
$moveto = $fid;

		}

		}


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


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

Zeile 1647Zeile 1653
			}
mark_reports($post['pid'], "post");
}

			}
mark_reports($post['pid'], "post");
}





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

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

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

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

Zeile 1657Zeile 1663

// Delete Thread Subscriptions
case "removesubscriptions":


// Delete Thread Subscriptions
case "removesubscriptions":





        // 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 1676Zeile 1682
		$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 1697Zeile 1703
		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'candeletethreads'))

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

			{
error_no_permission();

			{
error_no_permission();

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

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

Zeile 1751Zeile 1757
		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, $lang->error);
}

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

Zeile 1789Zeile 1795
		else
{
clearinline($fid, 'forum');

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

		}

		}

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


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


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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

		}
if(count($threads) < 1)

		}
if(count($threads) < 1)

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


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


		$moderation->close_threads($threads);

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

		$moderation->close_threads($threads);

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

		}
else
{

		}
else
{

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

// Approve threads - Inline moderation

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

// Approve threads - Inline moderation

	case "multiapprovethreads":

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

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

	case "multiapprovethreads":

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

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

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

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

		}

		}

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

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

		}


		}


		$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 1879Zeile 1885
		break;

// Unapprove threads - Inline moderation

		break;

// Unapprove threads - Inline moderation

	case "multiunapprovethreads":

// 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 "multiunapprovethreads":

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

		}
else
{

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

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

		}

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

		}

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


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


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

Zeile 1922Zeile 1928
		break;

// Restore threads - Inline moderation

		break;

// Restore threads - Inline moderation

	case "multirestorethreads":

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

	case "multirestorethreads":

// 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, 'canrestorethreads'))

			if(!is_moderator_by_tids($threads, 'canrestorethreads'))

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

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

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

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

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

		}

$moderation->restore_threads($threads);

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

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

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

$moderation->soft_delete_threads($threads);

		}

$moderation->restore_threads($threads);
















































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

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

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

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

		moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadssoftdeleted);

		moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsrestored);

		break;


		break;


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

	// 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 2017Zeile 1980
		{
// From search page
$threads = getids($mybb->get_input('searchid'), 'search');

		{
// From search page
$threads = getids($mybb->get_input('searchid'), 'search');

			if(!is_moderator_by_tids($threads, 'canstickunstickthreads'))









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

			{
error_no_permission();
}

			{
error_no_permission();
}

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

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

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

			clearinline($fid, 'forum');





		}

		}

		if(count($threads) < 1)




























		$cache->update_stats();
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadssoftdeleted);
break;

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

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

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

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

$moderation->stick_threads($threads);

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

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

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

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

Zeile 2051Zeile 2057

// Unstick threads - Inline moderaton
case "multiunstickthreads":


// Unstick threads - Inline moderaton
case "multiunstickthreads":





		// 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 2068Zeile 2074
		{
$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_no_permission();
}
}
if(count($threads) < 1)

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

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

Zeile 2155Zeile 2161
		if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))
{
error($lang->error_movetononmodforum, $lang->error);

		if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))
{
error($lang->error_movetononmodforum, $lang->error);

		}

		}


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


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

Zeile 2237Zeile 2243
			while($threadid = $db->fetch_field($query, "tid"))
{
$tids[] = $threadid;

			while($threadid = $db->fetch_field($query, "tid"))
{
$tids[] = $threadid;

			}

			}

		}

$deletecount = 0;

		}

$deletecount = 0;

Zeile 2330Zeile 2336
			SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)

			SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)

			WHERE pid IN (".implode($posts, ",").")
ORDER BY dateline ASC

			WHERE pid IN (".implode(",", $posts).")
ORDER BY dateline ASC, pid ASC

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

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

Zeile 2356Zeile 2362
			$altbg = alt_trow();
}


			$altbg = alt_trow();
}


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


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


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

eval("\$multimerge = \"".$templates->get("moderation_inline_mergeposts")."\";");
output_page($multimerge);

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

eval("\$multimerge = \"".$templates->get("moderation_inline_mergeposts")."\";");
output_page($multimerge);

		break;


		break;


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


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


Zeile 2404Zeile 2410
	// 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, $lang->error);
}

if(!is_moderator_by_pids($posts, "canmanagethreads"))
{
error_no_permission();
}
$posts = array_map('intval', $posts);
$pidin = implode(',', $posts);

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

// Make sure that we are not splitting all posts in the thread
// The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal)
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count


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

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

if(!is_moderator_by_pids($posts, "canmanagethreads"))
{
error_no_permission();
}
$posts = array_map('intval', $posts);
$pidin = implode(',', $posts);

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

// Make sure that we are not splitting all posts in the thread
// The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal)
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count

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

			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)

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


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

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

Zeile 2513Zeile 2519
			{
$posts[] = $pid;
}

			{
$posts[] = $pid;
}

		}


		}


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

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





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

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

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

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

		$query = $db->query("
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
");

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

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

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

Zeile 2567Zeile 2573
		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
{
$moveto = $fid;
}

		}
else
{
$moveto = $fid;
}


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


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

		}

		}


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

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

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





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

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

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

		$pidin = implode(',', $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


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

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

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

 

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


		eval("\$moveposts = \"".$templates->get("moderation_inline_moveposts")."\";");
output_page($moveposts);
break;

		eval("\$moveposts = \"".$templates->get("moderation_inline_moveposts")."\";");
output_page($moveposts);
break;





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


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


Zeile 2689Zeile 2698
			preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch);
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);


			preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch);
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);


			if($threadmatch[1])

			if(!empty($threadmatch[1]))

			{
$parameters['tid'] = $threadmatch[1];
}


			{
$parameters['tid'] = $threadmatch[1];
}


			if($postmatch[1])

			if(!empty($postmatch[1]))

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

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

Zeile 3013Zeile 3022

$uid = $mybb->get_input('uid', MyBB::INPUT_INT);
$user = get_user($uid);


$uid = $mybb->get_input('uid', MyBB::INPUT_INT);
$user = get_user($uid);

		if(!$user['uid'] || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid']))

		if(!$user || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid']))

		{
error($lang->purgespammer_invalid_user);
}

		{
error($lang->purgespammer_invalid_user);
}

Zeile 3063Zeile 3072
				}

// Add the IP's to the banfilters

				}

// Add the IP's to the banfilters

				foreach(array($user['regip'], $user['lastip']) as $ip)

				if($mybb->settings['purgespammerbanip'] == 1)

				{

				{

					$ip = my_inet_ntop($db->unescape_binary($ip));
$query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'");
if($db->num_rows($query) == 0)

					foreach(array($user['regip'], $user['lastip']) as $ip)



					{

					{

						$insert = array(
"filter" => $db->escape_string($ip),
"type" => 1,
"dateline" => TIME_NOW
);
$db->insert_query("banfilters", $insert);






						$ip = my_inet_ntop($db->unescape_binary($ip));
$query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'");
if($db->num_rows($query) == 0)
{
$insert = array(
"filter" => $db->escape_string($ip),
"type" => 1,
"dateline" => TIME_NOW
);
$db->insert_query("banfilters", $insert);
}

					}
}


					}
}


Zeile 3157Zeile 3169
				$action = $mybb->get_input('action', MyBB::INPUT_INT);
$modtype = htmlspecialchars_uni($mybb->get_input('modtype'));
$inlinetype = htmlspecialchars_uni($mybb->get_input('inlinetype'));

				$action = $mybb->get_input('action', MyBB::INPUT_INT);
$modtype = htmlspecialchars_uni($mybb->get_input('modtype'));
$inlinetype = htmlspecialchars_uni($mybb->get_input('inlinetype'));

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

				$searchid = htmlspecialchars_uni($mybb->get_input('searchid'));

				$url = htmlspecialchars_uni($mybb->get_input('url'));
$plugins->run_hooks('moderation_confirmation');


				$url = htmlspecialchars_uni($mybb->get_input('url'));
$plugins->run_hooks('moderation_confirmation');


Zeile 3263Zeile 3275
				// Get threads which are associated with the posts
$tids = array();
$options = array(

				// Get threads which are associated with the posts
$tids = array();
$options = array(

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

					'order_by' => 'dateline, pid',


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

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