Vergleich moderation.php - 1.8.15 - 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)
{
$post = get_post($pid);
if(!$post)


if($pid)
{
$post = get_post($pid);
if(!$post)

	{
error($lang->error_invalidpost);
}

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

	$tid = $post['tid'];
}

if($tid)

	$tid = $post['tid'];
}

if($tid)

{

{

	$thread = get_thread($tid);
if(!$thread)
{

	$thread = get_thread($tid);
if(!$thread)
{

		error($lang->error_invalidthread);

		error($lang->error_invalidthread, $lang->error);

	}
$fid = $thread['fid'];

	}
$fid = $thread['fid'];

}

}


if($fid)
{


if($fid)
{

Zeile 80Zeile 86

if(!$pm)
{


if(!$pm)
{

		error($lang->error_invalidpm);

		error($lang->error_invalidpm, $lang->error);

	}
}

// Get some navigation if we need it
$mybb->input['action'] = $mybb->get_input('action');

	}
}

// Get some navigation if we need it
$mybb->input['action'] = $mybb->get_input('action');

switch($mybb->input['action'])
{

switch($mybb->input['action'])
{

	case "reports":
add_breadcrumb($lang->reported_posts);
break;

	case "reports":
add_breadcrumb($lang->reported_posts);
break;

Zeile 198Zeile 204
			}
if(count($tids) < 1)
{

			}
if(count($tids) < 1)
{

				error($lang->error_inline_nothreadsselected);

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

			}

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

			}

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

Zeile 237Zeile 243
		}

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

		}

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

		{

		{

			$allowed_types[] = "approveunapprovethread";
}


			$allowed_types[] = "approveunapprovethread";
}


Zeile 249Zeile 255
			{
case "pgsql":
case "sqlite":

			{
case "pgsql":
case "sqlite":

					$query = $db->simple_select("modtools", 'tid, name, groups', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");

					$query = $db->simple_select("modtools", 'tid, name, `groups`', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");

					break;
default:

					break;
default:

					$query = $db->simple_select("modtools", 'tid, name, groups', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");

					$query = $db->simple_select("modtools", 'tid, name, `groups`', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");

			}
while($tool = $db->fetch_array($query))
{

			}
while($tool = $db->fetch_array($query))
{

Zeile 337Zeile 343
				if($date_time[0] >= 24)
{
$date_time[0] = '00';

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

				}
}


				}
}


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

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

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 440Zeile 446
		$actions = array(
'openclosethread' => $lang->open_close_thread,
'softdeleterestorethread' => $lang->softdelete_restore_thread,

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

			'deletethread' => $lang->delete_thread,
'move' => $lang->move_copy_thread,
'stick' => $lang->stick_unstick_thread,
'merge' => $lang->merge_threads,
'removeredirects' => $lang->remove_redirects,
'removesubscriptions' => $lang->remove_subscriptions,
'approveunapprovethread' => $lang->approve_unapprove_thread
);

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

			'deletethread' => $lang->delete_thread,
'move' => $lang->move_copy_thread,
'stick' => $lang->stick_unstick_thread,
'merge' => $lang->merge_threads,
'removeredirects' => $lang->remove_redirects,
'removesubscriptions' => $lang->remove_subscriptions,
'approveunapprovethread' => $lang->approve_unapprove_thread
);

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

		}

$delayedmods = '';

		}

$delayedmods = '';

Zeile 473Zeile 479
				$tids = getids($mybb->get_input('searchid'), 'search');
}
else

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

			{

			{

				$tids = getids($fid, "forum");
}
$where_array = array();

				$tids = getids($fid, "forum");
}
$where_array = array();

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

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

					foreach($tids as $like)
{
$where_array[] = "','||d.tids||',' LIKE '%,".$db->escape_string($like).",%'";

					foreach($tids as $like)
{
$where_array[] = "','||d.tids||',' LIKE '%,".$db->escape_string($like).",%'";

Zeile 510Zeile 516
			{
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},%'

Zeile 532Zeile 538
					");
}
}

					");
}
}

		



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

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

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

			$delayedmod['dateline'] = my_date('normal', $delayedmod['delaydateline'], "", 2);

			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];

			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];

Zeile 546Zeile 552
				$delayed_thread['link'] = get_thread_link($delayed_thread['tid']);
$delayed_thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($delayed_thread['subject']));
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_single")."\";");

				$delayed_thread['link'] = get_thread_link($delayed_thread['tid']);
$delayed_thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($delayed_thread['subject']));
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_single")."\";");

			}

			}

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

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

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

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





				if($delayedmod['inputs']['method'] == "redirect")
{
if((int)$delayedmod['inputs']['redirect_expire'] == 0)
{
$redirect_expire_bit = $lang->redirect_forever;

				if($delayedmod['inputs']['method'] == "redirect")
{
if((int)$delayedmod['inputs']['redirect_expire'] == 0)
{
$redirect_expire_bit = $lang->redirect_forever;

					}

					}

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

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

Zeile 580Zeile 586
					eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";");
}
}

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

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

			elseif($delayedmod['type'] == 'merge')

			{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);

			{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);

Zeile 601Zeile 607
		{
$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 616Zeile 624
				$tids = getids($fid, "forum");
}
if(count($tids) < 1)

				$tids = getids($fid, "forum");
}
if(count($tids) < 1)

			{
error($lang->error_inline_nothreadsselected);
}


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


			$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 640Zeile 648

$datemonth = array();
foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month)


$datemonth = array();
foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month)

		{

		{

			$datemonth[$month] = '';
if($mybb->get_input('date_month', MyBB::INPUT_INT) == (int)$month)
{
$datemonth[$month] = ' selected="selected"';
}

			$datemonth[$month] = '';
if($mybb->get_input('date_month', MyBB::INPUT_INT) == (int)$month)
{
$datemonth[$month] = ' selected="selected"';
}

		}

		}

		

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

		

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

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

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

		}


		}


		$softdeleterestorethread = '';
if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads"))
{

		$softdeleterestorethread = '';
if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads"))
{

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

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

		}


		}


		$stickunstickthread = '';
if(is_moderator($fid, "canstickunstickthreads"))
{

		$stickunstickthread = '';
if(is_moderator($fid, "canstickunstickthreads"))
{

Zeile 697Zeile 705
		if(!is_moderator($fid, "canopenclosethreads"))
{
error_no_permission();

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

		}






		}

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


if($thread['closed'] == 1)
{
$openclose = $lang->opened;
$redirect = $lang->redirect_openthread;
$moderation->open_threads($tid);


if($thread['closed'] == 1)
{
$openclose = $lang->opened;
$redirect = $lang->redirect_openthread;
$moderation->open_threads($tid);

		}

		}

		else
{
$openclose = $lang->closed;

		else
{
$openclose = $lang->closed;

Zeile 721Zeile 734

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


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

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


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


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

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

		{
error_no_permission();
}

$plugins->run_hooks("moderation_stick");







		{
error_no_permission();
}

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

$plugins->run_hooks("moderation_stick");


		if($thread['sticky'] == 1)
{
$stuckunstuck = $lang->unstuck;
$redirect = $lang->redirect_unstickthread;
$moderation->unstick_threads($tid);

		if($thread['sticky'] == 1)
{
$stuckunstuck = $lang->unstuck;
$redirect = $lang->redirect_unstickthread;
$moderation->unstick_threads($tid);

		}

		}

		else
{
$stuckunstuck = $lang->stuck;
$redirect = $lang->redirect_stickthread;
$moderation->stick_threads($tid);

		else
{
$stuckunstuck = $lang->stuck;
$redirect = $lang->redirect_stickthread;
$moderation->stick_threads($tid);

		}


		}


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

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





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

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

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

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

		break;


		break;


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

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

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

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





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

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

		{

		{

			error_no_permission();

			error_no_permission();

 
		}

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

		}

$plugins->run_hooks("moderation_removeredirects");

		}

$plugins->run_hooks("moderation_removeredirects");

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

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





	// Delete thread confirmation page
case "deletethread":

	// Delete thread confirmation page
case "deletethread":





		add_breadcrumb($lang->nav_deletethread);

		add_breadcrumb($lang->nav_deletethread);


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


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

			}
}


			}
}


Zeile 791Zeile 814

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


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





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

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

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

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

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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

Zeile 821Zeile 844
	// Delete the poll from a thread confirmation page
case "deletepoll":
add_breadcrumb($lang->nav_deletepoll);

	// Delete the poll from a thread confirmation page
case "deletepoll":
add_breadcrumb($lang->nav_deletepoll);


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


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

		}

		}





		$plugins->run_hooks("moderation_deletepoll");

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

		$plugins->run_hooks("moderation_deletepoll");

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

		$poll = $db->fetch_array($query);
if(!$poll)

		$poll = $db->fetch_array($query);
if(!$poll)

		{

		{

			error($lang->error_invalidpoll);

			error($lang->error_invalidpoll, $lang->error);

		}

eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";");
output_page($deletepoll);

		}

eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";");
output_page($deletepoll);

		break;


		break;


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

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

	// 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']))
{
error($lang->redirect_pollnotdeleted);
}
if(!is_moderator($fid, "canmanagepolls"))

		if(!isset($mybb->input['delete']))
{
error($lang->redirect_pollnotdeleted);
}
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 864Zeile 892
		$poll = $db->fetch_array($query);
if(!$poll)
{

		$poll = $db->fetch_array($query);
if(!$poll)
{

			error($lang->error_invalidpoll);

			error($lang->error_invalidpoll, $lang->error);

		}

$plugins->run_hooks("moderation_do_deletepoll");

		}

$plugins->run_hooks("moderation_do_deletepoll");





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


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


Zeile 880Zeile 908
	// Approve a thread
case "approvethread":


	// Approve a thread
case "approvethread":


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

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








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

$thread = get_thread($tid);


		$plugins->run_hooks("moderation_approvethread");

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

		$plugins->run_hooks("moderation_approvethread");

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





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

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





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

// Unapprove a thread

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

// Unapprove a thread

	case "unapprovethread":


	case "unapprovethread":


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

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

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

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

		{

		{

			error_no_permission();
}

			error_no_permission();
}

 

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


		$thread = get_thread($tid);

$plugins->run_hooks("moderation_unapprovethread");

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_unapprovethread");

Zeile 928Zeile 968
		verify_post_check($mybb->get_input('my_post_key'));

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

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

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

		{
error_no_permission();
}
$thread = get_thread($tid);


		{
error_no_permission();
}
$thread = get_thread($tid);


		$plugins->run_hooks("moderation_restorethread");

		$plugins->run_hooks("moderation_restorethread");





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

$moderation->restore_threads($tid);

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

$moderation->restore_threads($tid);





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

// Soft delete a thread
case "softdeletethread":

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

// Soft delete a thread
case "softdeletethread":





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

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

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

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

		{
error_no_permission();
}

		{
error_no_permission();
}

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_softdeletethread");

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_softdeletethread");

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

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

 
		}

if($thread['visible'] == -1)
{
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 983Zeile 1028
	// Let's get this thing moving!
case "do_move":


	// Let's get this thing moving!
case "do_move":


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


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

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





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

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

		{
error_no_permission();

		{
error_no_permission();

		}

		}

 


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

		// 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($lang->error_thread_deleted, $lang->error);
}


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

			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'] != '')
{

			error($lang->error_invalidforum);

			error($lang->error_invalidforum, $lang->error);

		}
if($method != "copy" && $thread['fid'] == $moveto)
{

		}
if($method != "copy" && $thread['fid'] == $moveto)
{

			error($lang->error_movetosameforum);

			error($lang->error_movetosameforum, $lang->error);

		}

$plugins->run_hooks('moderation_do_move');

		}

$plugins->run_hooks('moderation_do_move');

Zeile 1051Zeile 1103
		// Make sure we are looking at a real thread here.
if(!$thread)
{

		// Make sure we are looking at a real thread here.
if(!$thread)
{

			error($lang->error_nomember);

			error($lang->error_nomember, $lang->error);

		}

$plugins->run_hooks('moderation_viewthreadnotes');

		}

$plugins->run_hooks('moderation_viewthreadnotes');

Zeile 1090Zeile 1142
			$modactions = '';
while($modaction = $db->fetch_array($query))
{

			$modactions = '';
while($modaction = $db->fetch_array($query))
{

				$modaction['dateline'] = my_date("jS M Y, G:i", $modaction['dateline']);

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

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

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

Zeile 1180Zeile 1232
		$delayedmods = '';
while($delayedmod = $db->fetch_array($query))
{

		$delayedmods = '';
while($delayedmod = $db->fetch_array($query))
{

			$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);

			$delayedmod['dateline'] = my_date('normal', $delayedmod['delaydateline'], "", 2);

			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];

			$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];

Zeile 1224Zeile 1276
					eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";");
}
}

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

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

			elseif($delayedmod['type'] == 'merge')

			{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);

			{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);

Zeile 1299Zeile 1351
		{
eval("\$getip = \"".$templates->get("moderation_getip_modal", 1, 0)."\";");
echo $getip;

		{
eval("\$getip = \"".$templates->get("moderation_getip_modal", 1, 0)."\";");
echo $getip;

			exit;
}

			exit;
}

		else
{
eval("\$getip = \"".$templates->get("moderation_getip")."\";");

		else
{
eval("\$getip = \"".$templates->get("moderation_getip")."\";");

Zeile 1312Zeile 1364
	case "getpmip":
if($pmid <= 0)
{

	case "getpmip":
if($pmid <= 0)
{

			error($lang->error_invalidpm);

			error($lang->error_invalidpm, $lang->error);

		}
add_breadcrumb($lang->nav_pms, "private.php");
$pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));

		}
add_breadcrumb($lang->nav_pms, "private.php");
$pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));

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

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

 
		}

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

		}

$plugins->run_hooks("moderation_merge");

		}

$plugins->run_hooks("moderation_merge");

Zeile 1369Zeile 1426
		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 1379Zeile 1436
		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();

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

 
		}

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

		}

$plugins->run_hooks("moderation_do_merge");

		}

$plugins->run_hooks("moderation_do_merge");

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

if($threadmatch[1])

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

if($threadmatch[1])

			{

			{

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

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

				$parameters['tid'] = $threadmatch[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']);
$temp = explode("&", my_substr($splitloc[1], 1));

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

Zeile 1431Zeile 1493
			$mergetid = (int)$post['tid'];
}
elseif(!empty($parameters['tid']))

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

		{

		{

			$mergetid = (int)$parameters['tid'];
}
else

			$mergetid = (int)$parameters['tid'];
}
else

Zeile 1441Zeile 1503
		$mergethread = get_thread($mergetid);
if(!$mergethread)
{

		$mergethread = get_thread($mergetid);
if(!$mergethread)
{

			error($lang->error_badmergeurl);

			error($lang->error_badmergeurl, $lang->error);

		}
if($mergetid == $tid)
{ // sanity check

		}
if($mergetid == $tid)
{ // sanity check

			error($lang->error_mergewithself);
}

			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 1458Zeile 1520
		else
{
$subject = $thread['subject'];

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

		}


		}


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

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

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

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

Zeile 1474Zeile 1536
		{
error_no_permission();
}

		{
error_no_permission();
}

 

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


		$query = $db->query("
SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE tid='$tid'

		$query = $db->query("
SELECT p.*, u.*
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);
if($numposts <= 1)
{

		$numposts = $db->num_rows($query);
if($numposts <= 1)
{

			error($lang->error_cantsplitonepost);

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

		}

$altbg = "trow1";

		}

$altbg = "trow1";

Zeile 1532Zeile 1601
			error_no_permission();
}


			error_no_permission();
}


		$plugins->run_hooks("moderation_do_split");






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

$plugins->run_hooks("moderation_do_split");


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


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

		{
error($lang->error_nosplitposts);

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





		if($count['totalposts'] == 1)
{

		if($count['totalposts'] == 1)
{

			error($lang->error_cantsplitonepost);
}

if($count['totalposts'] == count($mybb->input['splitpost']))
{
error($lang->error_cantsplitall);

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

if($count['totalposts'] == count($mybb->input['splitpost']))
{
error($lang->error_cantsplitall, $lang->error);

		}

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

		}

if(!empty($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'] != '')

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

		{
error($lang->error_invalidforum);
}

$pids = array();


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

$pids = array();


		// move the selected posts over
$query = $db->simple_select("posts", "pid", "tid='$tid'");
while($post = $db->fetch_array($query))

		// move the selected posts over
$query = $db->simple_select("posts", "pid", "tid='$tid'");
while($post = $db->fetch_array($query))

Zeile 1578Zeile 1652
				$pids[] = $post['pid'];
}
mark_reports($post['pid'], "post");

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

		}

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


		}

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


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

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

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

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

Zeile 1594Zeile 1668
        verify_post_check($mybb->get_input('my_post_key'));

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

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

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

		{

		{

			error_no_permission();
}

			error_no_permission();
}









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


		$plugins->run_hooks("moderation_removesubscriptions");

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

		$plugins->run_hooks("moderation_removesubscriptions");

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





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

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

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

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

Zeile 1616Zeile 1695
			// 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();
}
}
else

			{
error_no_permission();
}
}
else

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

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

Zeile 1630Zeile 1709
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

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

		}

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

Zeile 1703Zeile 1782

if(count($threads) < 1)
{


if(count($threads) < 1)
{

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->open_threads($threads);

		}

$moderation->open_threads($threads);

Zeile 1721Zeile 1800
		break;

// Close threads - Inline moderation

		break;

// Close threads - Inline moderation

	case "multiclosethreads":

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

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

	case "multiclosethreads":












































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


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

Zeile 1772Zeile 1809
		{
// 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, 'canapproveunapprovethreads'))











































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

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

			{
error_no_permission();
}

Zeile 1787Zeile 1866
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

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

		}

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

Zeile 1812Zeile 1891
		verify_post_check($mybb->get_input('my_post_key'));

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

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

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

Zeile 1824Zeile 1903
		{
$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, $lang->error);
}


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

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

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

Zeile 1873Zeile 1952
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->restore_threads($threads);

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

		}

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

		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

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

// Soft delete threads - Inline moderation

	case "multisoftdeletethreads":


	case "multisoftdeletethreads":


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

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

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

			// 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 1915Zeile 1994
			}
}
if(count($threads) < 1)

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

		{
error($lang->error_inline_nothreadsselected);
}


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

		$moderation->soft_delete_threads($threads);

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

		}

		}

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

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

Zeile 1935Zeile 2014
		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();
}

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

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

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

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

			}

			}

		}

		}

		if(count($threads) < 1)

		if(count($threads) < 1)

		{
error($lang->error_inline_nothreadsselected);
}


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

		$moderation->stick_threads($threads);

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

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

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

		}
else
{

		}
else
{

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

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

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

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

Zeile 2001Zeile 2080
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->unstick_threads($threads);

		}

$moderation->unstick_threads($threads);

Zeile 2042Zeile 2121

if(count($threads) < 1)
{


if(count($threads) < 1)
{

			error($lang->error_inline_nothreadsselected);

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

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

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

Zeile 2066Zeile 2145
		verify_post_check($mybb->get_input('my_post_key'));

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

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

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

 
		$method = $mybb->get_input('method');


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

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

Zeile 2079Zeile 2160
		$newperms = forum_permissions($moveto);
if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))
{

		$newperms = forum_permissions($moveto);
if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum'))
{

			error($lang->error_movetononmodforum);

			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'] != '')
{

			error($lang->error_invalidforum);

			error($lang->error_invalidforum, $lang->error);

		}


		}


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

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










		$plugins->run_hooks('moderation_do_multimovethreads');

log_moderator_action($modlogdata, $lang->multi_moved_threads);
$expire = 0;
if($mybb->get_input('redirect_expire', MyBB::INPUT_INT) > 0)
{
$expire = TIME_NOW + ($mybb->get_input('redirect_expire', MyBB::INPUT_INT) * 86400);
}

foreach($tids as $tid) {
$moderation->move_thread($tid, $moveto, $method, $expire);
}


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


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

Zeile 2098Zeile 2188
	// 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')
{


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

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

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

		}

		}


if(count($posts) < 1)


if(count($posts) < 1)

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

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

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

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

		}

		}

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

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


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

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

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

			{

			{

				$tids[] = $threadid;
}
}

$deletecount = 0;
foreach($postlist as $pid)

				$tids[] = $threadid;
}
}

$deletecount = 0;
foreach($postlist as $pid)

		{

		{

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

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

		}


		}


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

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

			{
$moderation->delete_thread($tid);

			{
$moderation->delete_thread($tid);

				mark_reports($tid, "thread");
$url = get_forum_link($fid);
}

				mark_reports($tid, "thread");
$url = get_forum_link($fid);
}

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

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





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

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

Zeile 2233Zeile 2323

if(empty($posts))
{


if(empty($posts))
{

			error($lang->error_inline_nopostsselected);

			error($lang->error_inline_nopostsselected, $lang->error);

		}

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

		}

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

Zeile 2246Zeile 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 2297Zeile 2387
		$mergepost = $mybb->get_input('mergepost', MyBB::INPUT_ARRAY);
if(count($mergepost) <= 1)
{

		$mergepost = $mybb->get_input('mergepost', MyBB::INPUT_ARRAY);
if(count($mergepost) <= 1)
{

			error($lang->error_nomergeposts);

			error($lang->error_nomergeposts, $lang->error);

		}

foreach($mergepost as $pid => $yes)

		}

foreach($mergepost as $pid => $yes)

Zeile 2306Zeile 2396
		}

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

		}

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

		{
error_no_permission();
}

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


		{
error_no_permission();
}

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


		mark_reports($postlist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_post_link($masterpid)."#pid$masterpid", $lang->redirect_inline_postsmerged);
break;

		mark_reports($postlist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_post_link($masterpid)."#pid$masterpid", $lang->redirect_inline_postsmerged);
break;





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



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

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

Zeile 2381Zeile 2471
		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

			error($lang->error_cantsplitall);

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

		}

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

		}

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

Zeile 2433Zeile 2523

if(empty($posts))
{


if(empty($posts))
{

			error($lang->error_inline_nopostsselected);

			error($lang->error_inline_nopostsselected, $lang->error);

		}

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

		}

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

Zeile 2452Zeile 2542
		{
if((int)$tcheck['count'] <= 1)
{

		{
if((int)$tcheck['count'] <= 1)
{

				error($lang->error_cantsplitonepost);

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

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

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

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

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

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

Zeile 2477Zeile 2567
		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

			error($lang->error_cantsplitall);
}


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


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

Zeile 2491Zeile 2581

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

		{
error($lang->error_invalidforum);
}

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

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

		}

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

		}

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

		}

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

		}

if(!is_moderator_by_pids($posts, "canmanagethreads"))
{
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

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

		$query = $db->query("

			SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)

			SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)

Zeile 2544Zeile 2634
		{
if((int)$tcheck['count'] <= 1)
{

		{
if((int)$tcheck['count'] <= 1)
{

				error($lang->error_cantsplitonepost);

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

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

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

Zeile 2565Zeile 2655
			{
$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

			// One or more threads do not have posts after splitting

			error($lang->error_cantmoveall);
}

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


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


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

 

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

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

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

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

		$plugins->run_hooks("moderation_do_multimoveposts");

// explode at # sign in a url (indicates a name reference) and reassign to the url

Zeile 2605Zeile 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])
{
$parameters['tid'] = $threadmatch[1];
}

if($postmatch[1])

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

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

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

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

Zeile 2630Zeile 2723
				}
}
else

				}
}
else

			{

			{

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

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

Zeile 2653Zeile 2746
		$newtid = (int)$newtid;
$newthread = get_thread($newtid);
if(!$newthread)

		$newtid = (int)$newtid;
$newthread = get_thread($newtid);
if(!$newthread)

		{
error($lang->error_badmovepostsurl);
}

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

		if($newtid == $tid)
{ // sanity check

		if($newtid == $tid)
{ // sanity check

			error($lang->error_movetoself);

			error($lang->error_movetoself, $lang->error);

		}

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

		}

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

Zeile 2682Zeile 2775
			while($pid = $db->fetch_field($query, 'pid'))
{
$posts[] = $pid;

			while($pid = $db->fetch_field($query, 'pid'))
{
$posts[] = $pid;

			}
}


			}
}


		if(empty($posts))
{

		if(empty($posts))
{

			error($lang->error_inline_nopostsselected);

			error($lang->error_inline_nopostsselected, $lang->error);

		}

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

		}

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

Zeile 2705Zeile 2798
		while($tcheck = $db->fetch_array($query))
{
if((int)$tcheck['count'] <= 1)

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

			{
error($lang->error_cantsplitonepost);

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

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

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

Zeile 2731Zeile 2824
		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

		if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting

			error($lang->error_cantmoveall);

			error($lang->error_cantmoveall, $lang->error);

		}

		}





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

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

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

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





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

// Approve posts - Inline moderation
case "multiapproveposts":

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

// Approve posts - Inline moderation
case "multiapproveposts":


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

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


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

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

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

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

		}

		}

		if(count($posts) < 1)

		if(count($posts) < 1)

		{
error($lang->error_inline_nopostsselected);

		{
error($lang->error_inline_nopostsselected, $lang->error);

		}

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

		}

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

		{

		{

			error_no_permission();
}

$pids = array();
foreach($posts as $pid)

			error_no_permission();
}

$pids = array();
foreach($posts as $pid)

		{

		{

			$pids[] = (int)$pid;
}


			$pids[] = (int)$pid;
}


Zeile 2788Zeile 2881
		break;

// Unapprove posts - Inline moderation

		break;

// Unapprove posts - Inline moderation

	case "multiunapproveposts":

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

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);
}
$pids = array();

if(!is_moderator_by_pids($posts, "canapproveunapproveposts"))
{
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')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{
clearinline($tid, 'thread');
}
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsunapproved);
break;

// Restore posts - Inline moderation
case "multirestoreposts":

	case "multiunapproveposts":














































// 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 2845Zeile 2894
		{
$posts = getids($tid, 'thread');
}

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

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

if(!is_moderator_by_pids($posts, "canrestoreposts"))
{
error_no_permission();














































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

if(!is_moderator_by_pids($posts, "canapproveunapproveposts"))
{
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')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{
clearinline($tid, 'thread');
}
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsunapproved);
break;

// Restore posts - Inline moderation
case "multirestoreposts":

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

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

		}

$pids = array();

		}

$pids = array();

Zeile 2864Zeile 2957
		$moderation->restore_posts($pids);

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

		$moderation->restore_posts($pids);

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

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

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

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

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

		}

		}

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


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


Zeile 2891Zeile 2984

if(count($posts) < 1)
{


if(count($posts) < 1)
{

			error($lang->error_inline_nopostsselected);

			error($lang->error_inline_nopostsselected, $lang->error);

		}
$pids = array();

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

		}
$pids = array();

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

		{
error_no_permission();
}

		{
error_no_permission();
}

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

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

Zeile 2927Zeile 3020
			error_no_permission();
}


			error_no_permission();
}


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

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

		$user = get_user($uid);

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

					}
}

// Clear the profile
$userhandler->clear_profile($uid, $mybb->settings['purgespammerbangroup']);


					}
}

// Clear the profile
$userhandler->clear_profile($uid, $mybb->settings['purgespammerbangroup']);


				$cache->update_banned();

 
				$cache->update_bannedips();
$cache->update_awaitingactivation();


				$cache->update_bannedips();
$cache->update_awaitingactivation();


Zeile 3013Zeile 3108
			if(!empty($mybb->settings['purgespammerapikey']))
{
$sfs = @fetch_remote_file("http://stopforumspam.com/add.php?username=" . urlencode($user['username']) . "&ip_addr=" . urlencode(my_inet_ntop($db->unescape_binary($user['lastip']))) . "&email=" . urlencode($user['email']) . "&api_key=" . urlencode($mybb->settings['purgespammerapikey']));

			if(!empty($mybb->settings['purgespammerapikey']))
{
$sfs = @fetch_remote_file("http://stopforumspam.com/add.php?username=" . urlencode($user['username']) . "&ip_addr=" . urlencode(my_inet_ntop($db->unescape_binary($user['lastip']))) . "&email=" . urlencode($user['email']) . "&api_key=" . urlencode($mybb->settings['purgespammerapikey']));

			}


			}


			log_moderator_action(array('uid' => $uid, 'username' => $user['username']), $lang->purgespammer_modlog);

if($user_deleted)
{
redirect($mybb->settings['bburl'], $lang->purgespammer_success);

			log_moderator_action(array('uid' => $uid, 'username' => $user['username']), $lang->purgespammer_modlog);

if($user_deleted)
{
redirect($mybb->settings['bburl'], $lang->purgespammer_success);

			}

			}

			else
{
redirect(get_profile_link($uid), $lang->purgespammer_success);

			else
{
redirect(get_profile_link($uid), $lang->purgespammer_success);

			}
}
else if($mybb->input['action'] == "purgespammer")

			}
}
elseif($mybb->input['action'] == "purgespammer")

		{
$plugins->run_hooks("moderation_purgespammer_show");


		{
$plugins->run_hooks("moderation_purgespammer_show");


Zeile 3052Zeile 3147
		{
// 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'));





			$options = my_unserialize($tool['threadoptions']);

if(!is_member($tool['groups']))

			$options = my_unserialize($tool['threadoptions']);

if(!is_member($tool['groups']))

			{

			{

				error_no_permission();

				error_no_permission();

 
			}

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

			}

if(!empty($options['confirmation']) && empty($mybb->input['confirm']))

			}

if(!empty($options['confirmation']) && empty($mybb->input['confirm']))

Zeile 3066Zeile 3166

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


				$modtype = $mybb->get_input('modtype');
$inlinetype = $mybb->get_input('inlinetype');
$searchid = $mybb->get_input('searchid');


				$action = $mybb->get_input('action', MyBB::INPUT_INT);
$modtype = htmlspecialchars_uni($mybb->get_input('modtype'));
$inlinetype = htmlspecialchars_uni($mybb->get_input('inlinetype'));
$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 3092Zeile 3193
				}
if(count($tids) < 1)
{

				}
if(count($tids) < 1)
{

					error($lang->error_inline_nopostsselected);

					error($lang->error_inline_nopostsselected, $lang->error);

				}
if(!is_moderator_by_tids($tids, "canusecustomtools"))
{

				}
if(!is_moderator_by_tids($tids, "canusecustomtools"))
{

Zeile 3102Zeile 3203
				$thread_options = my_unserialize($tool['threadoptions']);
if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")
{

				$thread_options = my_unserialize($tool['threadoptions']);
if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")
{

					error($lang->error_movetocategory);

					error($lang->error_movetocategory, $lang->error);

				}

$custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tids);

				}

$custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tids);

Zeile 3113Zeile 3214
					clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

					clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

					redirect($return_url, $lang->redirect_customtool_search);

					moderation_redirect($return_url, $lang->redirect_customtool_search);

				}
else
{

				}
else
{

Zeile 3133Zeile 3234
				$thread_options = my_unserialize($tool['threadoptions']);
if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")
{

				$thread_options = my_unserialize($tool['threadoptions']);
if($thread_options['movethread'] && $forum_cache[$thread_options['movethread']]['type'] != "f")
{

					error($lang->error_movetocategory);

					error($lang->error_movetocategory, $lang->error);

				}

$ret = $custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tid);

				}

$ret = $custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tid);

Zeile 3164Zeile 3265

if(count($pids) < 1)
{


if(count($pids) < 1)
{

					error($lang->error_inline_nopostsselected);

					error($lang->error_inline_nopostsselected, $lang->error);

				}
if(!is_moderator_by_pids($pids, "canusecustomtools"))
{

				}
if(!is_moderator_by_pids($pids, "canusecustomtools"))
{

Zeile 3174Zeile 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))

Zeile 3191Zeile 3291
					clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

					clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

					redirect($return_url, $lang->redirect_customtool_search);

					moderation_redirect($return_url, $lang->redirect_customtool_search);

				}
else
{

				}
else
{

Zeile 3293Zeile 3393
			$ids[] = $tid;
}
}

			$ids[] = $tid;
}
}

	else if($type == 'search')

	elseif($type == 'search')

	{
$query = $db->simple_select("searchlog", "resulttype, posts, threads", "sid='".$db->escape_string($id)."' AND uid='{$mybb->user['uid']}'", 1);
$searchlog = $db->fetch_array($query);

	{
$query = $db->simple_select("searchlog", "resulttype, posts, threads", "sid='".$db->escape_string($id)."' AND uid='{$mybb->user['uid']}'", 1);
$searchlog = $db->fetch_array($query);

Zeile 3440Zeile 3540
	global $mybb;
if(!empty($mybb->input['url']))
{

	global $mybb;
if(!empty($mybb->input['url']))
{

		redirect(htmlentities($mybb->input['url']), $message, $title);

		$url = htmlentities($mybb->input['url']);

	}

	}

 

if(my_strpos($url, $mybb->settings['bburl'].'/') !== 0)
{
if(my_strpos($url, '/') === 0)
{
$url = my_substr($url, 1);
}
$url_segments = explode('/', $url);
$url = $mybb->settings['bburl'].'/'.end($url_segments);
}


	redirect($url, $message, $title);
}

	redirect($url, $message, $title);
}