Vergleich moderation.php - 1.8.5 - 1.8.29

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'moderation.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'moderation.php');


$templatelist = 'changeuserbox,loginbox,moderation_delayedmoderation_custommodtool,moderation_delayedmodaction_notes,moderation_delayedmoderation_merge,moderation_delayedmoderation_move';
$templatelist .= ',moderation_delayedmoderation,moderation_deletethread,moderation_deletepoll,moderation_mergeposts_post,moderation_viewthreadnotes,moderation_confirmation';
$templatelist .= ',moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_threadnotes,moderation_getip_modoptions,moderation_getip,moderation_getpmip,moderation_merge';
$templatelist .= ',moderation_split_post,moderation_split,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts,moderation_threadnotes_modaction_error';
$templatelist .= ',moderation_inline_splitposts,forumjump_bit,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password,moderation_inline_moveposts,moderation_delayedmodaction_error,moderation_purgespammer,moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month';





$templatelist = "changeuserbox,loginbox,moderation_delayedmoderation_custommodtool,moderation_delayedmodaction_notes,moderation_delayedmoderation_merge,moderation_delayedmoderation_move,moderation_threadnotes";
$templatelist .= ",moderation_delayedmoderation,moderation_deletethread,moderation_deletepoll,moderation_mergeposts_post,moderation_viewthreadnotes,moderation_confirmation,moderation_purgespammer,forumjump_bit";
$templatelist .= ",moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_getip_modoptions,moderation_getip,moderation_getpmip,moderation_getpmip_modal";
$templatelist .= ",moderation_split_post,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts,moderation_threadnotes_modaction_error";
$templatelist .= ",moderation_inline_splitposts,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password,moderation_inline_moveposts,moderation_delayedmodaction_error";
$templatelist .= ",moderation_delayedmodaction_notes_thread_single,moderation_delayedmodaction_notes_thread_multiple,moderation_delayedmodaction_notes_forum,moderation_delayedmodaction_notes_new_forum";
$templatelist .= ",moderation_delayedmodaction_notes_redirect,moderation_delayedmodaction_notes_merge,moderation_delayedmoderation_thread,moderation_threadnotes_modaction_thread,moderation_getip_modal";
$templatelist .= ",moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month,moderation_threadnotes_modaction_post,moderation_merge,moderation_split,moderation_threadnotes_modaction_forum";
$templatelist .= ",moderation_delayedmoderation_openclose,moderation_delayedmoderation_softdeleterestore,moderation_delayedmoderation_delete,moderation_delayedmoderation_stick,moderation_delayedmoderation_approve";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

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

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

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


if($pid)
{
$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'];
}

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

Zeile 50Zeile 55
	$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'];
}

Zeile 75Zeile 80

if(!$pm)
{


if(!$pm)
{

		error($lang->error_invalidpm);

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

	}
}


	}
}


Zeile 105Zeile 110
	check_forum_password($forum['fid']);
}


	check_forum_password($forum['fid']);
}


 
$log_multithreads_actions = array("do_multideletethreads", "multiclosethreads", "multiopenthreads", "multiapprovethreads", "multiunapprovethreads", "multirestorethreads", "multisoftdeletethreads","multistickthreads", "multiunstickthreads", "do_multimovethreads");
if(in_array($mybb->input['action'], $log_multithreads_actions))
{
if(!empty($mybb->input['searchid']))
{
$tids = getids($mybb->get_input('searchid'), 'search');
}
else
{
$tids = getids($fid, 'forum');
}

$modlogdata['tids'] = (array)$tids;

unset($tids);
}

$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);

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

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





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

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

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

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

{

{

	error_no_permission();
}


	error_no_permission();
}


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

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

		}

$plugins->run_hooks('moderation_cancel_delayedmoderation');

		}

$plugins->run_hooks('moderation_cancel_delayedmoderation');


$db->delete_query("delayedmoderation", "did='".$mybb->get_input('did', MyBB::INPUT_INT)."'");



$db->delete_query("delayedmoderation", "did='".$mybb->get_input('did', MyBB::INPUT_INT)."'");


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

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

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


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


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

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


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


		// Assume in-line moderation if TID is not set
if(!empty($mybb->input['tid']))
{

		// Assume in-line moderation if TID is not set
if(!empty($mybb->input['tid']))
{

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

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

			{

			{

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

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

				error($lang->error_inline_nothreadsselected);

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

			}

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

			}

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

		}


		}


		add_breadcrumb($lang->delayed_moderation);

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

		add_breadcrumb($lang->delayed_moderation);

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

		{

		{

			error_no_permission();

			error_no_permission();

		}


		}


		$errors = array();

		$errors = array();

		$customthreadtools = "";

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

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

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

$tool['name'] = htmlspecialchars_uni($tool['name']);

$checked = "";
if($mybb->input['type'] == "modtool_".$tool['tid'])
{
$checked = "checked=\"checked\"";
}

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

































		$customthreadtools = "";

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

if(is_moderator($fid, "canopenclosethreads"))
{
$allowed_types[] = "openclosethread";
}

if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads"))
{
$allowed_types[] = "softdeleterestorethread";
}

if(is_moderator($fid, "candeletethreads"))
{
$allowed_types[] = "deletethread";
}

if(is_moderator($fid, "canstickunstickthreads"))
{
$allowed_types[] = "stick";
}

if(is_moderator($fid, "canapproveunapprovethreads"))
{
$allowed_types[] = "approveunapprovethread";
}

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

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

$tool['name'] = htmlspecialchars_uni($tool['name']);

$checked = "";
if($mybb->input['type'] == "modtool_".$tool['tid'])
{
$checked = "checked=\"checked\"";
}

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


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

if($mybb->input['action'] == "do_delayedmoderation" && $mybb->request_method == "post")

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

if($mybb->input['action'] == "do_delayedmoderation" && $mybb->request_method == "post")

Zeile 235Zeile 291

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


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

				$newforum = get_forum($fid);










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

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

$newforum = get_forum($newfid);

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

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

				{

				{

					$errors[] = $lang->error_invalidforum;

					$errors[] = $lang->error_invalidforum;

 
				}

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

				}
}


				}
}


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


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


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

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

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

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

Zeile 269Zeile 340
				}
}


				}
}


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

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


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


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

					$mybb->input['tids'] = implode(',' , $mybb->input['tids']);

					$mybb->input['tids'] = implode(',', $mybb->input['tids']);

				}

$did = $db->insert_query("delayedmoderation", array(

				}

$did = $db->insert_query("delayedmoderation", array(

Zeile 306Zeile 377
					else
{
moderation_redirect(get_forum_link($fid), $lang->sprintf($lang->redirect_delayed_moderation_forum, $rundate_format));

					else
{
moderation_redirect(get_forum_link($fid), $lang->sprintf($lang->redirect_delayed_moderation_forum, $rundate_format));

					}

					}

				}
}
else

				}
}
else

Zeile 336Zeile 407
				$mybb->input['delayedmoderation']['threadurl'] = htmlspecialchars_uni($mybb->input['delayedmoderation']['threadurl']);

$forumselect = build_forum_jump("", $mybb->input['delayedmoderation']['new_forum'], 1, '', 0, true, '', "delayedmoderation[new_forum]");

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

$forumselect = build_forum_jump("", $mybb->input['delayedmoderation']['new_forum'], 1, '', 0, true, '', "delayedmoderation[new_forum]");

			}

			}

		}
else
{

		}
else
{

Zeile 353Zeile 424
			$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]");

		}

		}


if(isset($errors) && count($errors) > 0)
{


if(isset($errors) && count($errors) > 0)
{

Zeile 362Zeile 433
		else
{
$display_errors = '';

		else
{
$display_errors = '';

		}

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


		}

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


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

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

Zeile 377Zeile 448
			'removesubscriptions' => $lang->remove_subscriptions,
'approveunapprovethread' => $lang->approve_unapprove_thread
);

			'removesubscriptions' => $lang->remove_subscriptions,
'approveunapprovethread' => $lang->approve_unapprove_thread
);





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

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

Zeile 400Zeile 471
			if($mybb->get_input('inlinetype') == 'search')
{
$tids = getids($mybb->get_input('searchid'), 'search');

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

			}

			}

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

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

			switch($db->type)
{
case "pgsql":
case "sqlite":
foreach($tids as $like)
{

			switch($db->type)
{
case "pgsql":
case "sqlite":
foreach($tids as $like)
{

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

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

Zeile 445Zeile 516
						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:
$query = $db->query("

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

Zeile 461Zeile 532
					");
}
}

					");
}
}

 


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

		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']];
$info = '';
if(strpos($delayedmod['tids'], ',') === false)
{
$delayed_thread = get_thread($delayedmod['tids']);

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

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

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

if($delayedmod['type'] == 'move')
{
$info .= "<strong>{$lang->new_forum}</strong> <a href=\"".get_forum_link($delayedmod['inputs']['new_forum'])."\">".htmlspecialchars_uni($forum_cache[$delayedmod['inputs']['new_forum']]['name'])."</a><br />";
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}";
}
$info .= "<strong>{$lang->leave_redirect_for}</strong> {$redirect_expire_bit}<br />";
}
}
else if($delayedmod['type'] == 'merge')
{
$info .= "<strong>{$lang->new_subject}</strong> ".htmlspecialchars_uni($delayedmod['inputs']['subject'])."<br />";
$info .= "<strong>{$lang->thread_to_merge_with}</strong> <a href=\"".htmlspecialchars_uni($delayedmod['inputs']['threadurl'])."\">".htmlspecialchars_uni($delayedmod['inputs']['threadurl'])."</a><br />";
}










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

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

if($delayedmod['type'] == 'move')
{
$delayedmod['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;
}
else
{
$redirect_expire_bit = (int)$delayedmod['inputs']['redirect_expire']." {$lang->days}";
}

eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_redirect")."\";");
}
}
elseif($delayedmod['type'] == 'merge')
{
$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_merge")."\";");
}


eval("\$delayedmods .= \"".$templates->get("moderation_delayedmodaction_notes")."\";");
$trow = alt_trow();
}
if(!$delayedmods)


eval("\$delayedmods .= \"".$templates->get("moderation_delayedmodaction_notes")."\";");
$trow = alt_trow();
}
if(!$delayedmods)

		{

		{

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

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

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

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

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




			$thread['link'] = get_thread_link($tid);
$delayedmoderation_subject = $mybb->input['delayedmoderation']['subject'];
$delayedmoderation_threadurl = $mybb->input['delayedmoderation']['threadurl'];
eval("\$threads = \"".$templates->get("moderation_delayedmoderation_thread")."\";");

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

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

		{

		{

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

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

Zeile 533Zeile 618
				$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 553Zeile 638
				$selected = ' selected="selected"';
}
eval('$dateday .= "'.$templates->get('moderation_delayedmoderation_date_day').'";');

				$selected = ' selected="selected"';
}
eval('$dateday .= "'.$templates->get('moderation_delayedmoderation_date_day').'";');

		}

		}


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

Zeile 565Zeile 650
			}
}


			}
}






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


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


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































		$dateyear = gmdate('Y', TIME_NOW  + $localized_time_offset);
$datetime = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset);

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

$softdeleterestorethread = '';
if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads"))
{
eval('$softdeleterestorethread = "'.$templates->get('moderation_delayedmoderation_softdeleterestore').'";');
}

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

$stickunstickthread = '';
if(is_moderator($fid, "canstickunstickthreads"))
{
eval('$stickunstickthread = "'.$templates->get('moderation_delayedmoderation_stick').'";');
}

$approveunapprovethread = '';
if(is_moderator($fid, "canapproveunapprovethreads"))
{
eval('$approveunapprovethread = "'.$templates->get('moderation_delayedmoderation_approve').'";');
}


$plugins->run_hooks("moderation_delayedmoderation");



$plugins->run_hooks("moderation_delayedmoderation");


Zeile 584Zeile 699
		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 600Zeile 720
		}

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

		}

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


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

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



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

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


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

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






		{
error_no_permission();
}

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

		}

$plugins->run_hooks("moderation_stick");

		}

$plugins->run_hooks("moderation_stick");

Zeile 623Zeile 748
			$stuckunstuck = $lang->unstuck;
$redirect = $lang->redirect_unstickthread;
$moderation->unstick_threads($tid);

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

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





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

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





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


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

$plugins->run_hooks("moderation_removeredirects");







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

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

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

$plugins->run_hooks("moderation_removeredirects");


		$moderation->remove_redirects($tid);

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

		$moderation->remove_redirects($tid);

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

Zeile 723Zeile 853
		$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")."\";");

		}

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

Zeile 735Zeile 865

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


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


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

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

Zeile 774Zeile 909
		{
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_approvethread");

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_approvethread");

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


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


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


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


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

// Unapprove a thread
case "unapprovethread":

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

// Unapprove a thread
case "unapprovethread":


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



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


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

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

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








		{
error_no_permission();
}

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

$thread = get_thread($tid);


		$plugins->run_hooks("moderation_unapprovethread");

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


		$plugins->run_hooks("moderation_unapprovethread");

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


		$moderation->unapprove_threads($tid);


		$moderation->unapprove_threads($tid);


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

// Restore a thread

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

// Restore a thread

	case "restorethread":

	case "restorethread":


// 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 821Zeile 968
		$thread = get_thread($tid);

$plugins->run_hooks("moderation_restorethread");

		$thread = get_thread($tid);

$plugins->run_hooks("moderation_restorethread");





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


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


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

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

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

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

		{
error_no_permission();

		{
error_no_permission();

		}
$thread = get_thread($tid);


		}
$thread = get_thread($tid);


Zeile 850Zeile 997
		$moderation->soft_delete_threads($tid);

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

		$moderation->soft_delete_threads($tid);

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

		break;

		break;


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


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

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

$plugins->run_hooks("moderation_move");







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

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

$plugins->run_hooks("moderation_move");


		$forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto");
eval("\$movethread = \"".$templates->get("moderation_move")."\";");
output_page($movethread);

		$forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto");
eval("\$movethread = \"".$templates->get("moderation_move")."\";");
output_page($movethread);

Zeile 877Zeile 1029
		$method = $mybb->get_input('method');

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

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

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

		{
error_no_permission();
}


		{
error_no_permission();
}


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

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

		{

		{

			error_no_permission();
}

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

			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 938Zeile 1097
		// 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 977Zeile 1136
			$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']);
$info = '';
if($modaction['tsubject'])
{

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

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



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

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

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

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



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

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

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

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





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

				}

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

				}

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

Zeile 1059Zeile 1226
		$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']];
$info = '';
if(strpos($delayedmod['tids'], ',') === false)
{

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

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



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

			}
else
{

			}
else
{

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

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

			}

if($delayedmod['fname'])
{

			}

if($delayedmod['fname'])
{

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



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

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

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

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

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

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




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


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

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

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










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

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

				}
}

				}
}

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

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

			{

			{

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


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

			}

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

			}

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

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


			$hostname = $lang->resolve_fail;
}


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

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

// Moderator options

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

// Moderator options

Zeile 1155Zeile 1341

$plugins->run_hooks('moderation_getip');



$plugins->run_hooks('moderation_getip');


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










		if($modal)
{
eval("\$getip = \"".$templates->get("moderation_getip_modal", 1, 0)."\";");
echo $getip;
exit;
}
else
{
eval("\$getip = \"".$templates->get("moderation_getip")."\";");
output_page($getip);
break;
}


// Let's look up the ip address of a PM
case "getpmip":
if($pmid <= 0)


// Let's look up the ip address of a PM
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 1179Zeile 1374
		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 1190Zeile 1385
		{
$ipaddress = $pm['ipaddress'];
eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");

		{
$ipaddress = $pm['ipaddress'];
eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");

		}

$plugins->run_hooks('moderation_getpmip');

eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";");
output_page($getpmip);
break;










		}

$plugins->run_hooks('moderation_getpmip');

if($modal)
{
eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";");
echo $getpmip;
exit;
}
else
{
eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";");
output_page($getpmip);
break;
}


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


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

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

$plugins->run_hooks("moderation_merge");






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

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

$plugins->run_hooks("moderation_merge");


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


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





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


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


Zeile 1221Zeile 1430
		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 1283Zeile 1497
		$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"))
{

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

Zeile 1316Zeile 1530
		{
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 1334Zeile 1555
		while($post = $db->fetch_array($query))
{
$postdate = my_date('relative', $post['dateline']);

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




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


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

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

Zeile 1347Zeile 1569
			{
$parser_options['allow_smilies'] = 0;
}

			{
$parser_options['allow_smilies'] = 0;
}





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

$plugins->run_hooks("moderation_split");

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

$plugins->run_hooks("moderation_split");

Zeile 1369Zeile 1593
		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_split");

		}

$plugins->run_hooks("moderation_do_split");

Zeile 1376Zeile 1605
		$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);

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

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

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

			error($lang->error_cantsplitonepost);

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

		}

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

		}

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

			error($lang->error_cantsplitall);

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

		}

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

		}

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

Zeile 1403Zeile 1632
		$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);

		}

$pids = array();

		}

$pids = array();

Zeile 1428Zeile 1657

// Delete Thread Subscriptions
case "removesubscriptions":


// Delete Thread Subscriptions
case "removesubscriptions":

 

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


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

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

		{

		{

			error_no_permission();

			error_no_permission();

 
		}

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

		}

$plugins->run_hooks("moderation_removesubscriptions");

		}

$plugins->run_hooks("moderation_removesubscriptions");





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

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

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

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

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

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

			{
error_no_permission();

			{
error_no_permission();

			}
}
else

			}
}
else

Zeile 1465Zeile 1703
		}
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 1513Zeile 1751
		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)
{
error($lang->error_inline_nothreadsselected);
}


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


		$moderation->open_threads($threads);

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

		$moderation->open_threads($threads);

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

Zeile 1580Zeile 1818
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->close_threads($threads);

		}

$moderation->close_threads($threads);

Zeile 1622Zeile 1860
		}
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);

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

		}

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

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

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

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

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

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

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

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

Zeile 1664Zeile 1902
			}
}
if(count($threads) < 1)

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

		{
error($lang->error_inline_nothreadsselected);

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

		}

		}





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

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

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

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

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

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

		}
else
{

		}
else
{

Zeile 1685Zeile 1923

// Restore threads - Inline moderation
case "multirestorethreads":


// Restore threads - Inline moderation
case "multirestorethreads":





		// 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 1702Zeile 1940
		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canrestorethreads'))

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

			{
error_no_permission();
}

			{
error_no_permission();
}

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

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->restore_threads($threads);

		}

$moderation->restore_threads($threads);

Zeile 1751Zeile 1989
		}
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);

		}

$moderation->soft_delete_threads($threads);

Zeile 1767Zeile 2005
		}
$cache->update_stats();
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadssoftdeleted);

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

		break;

		break;


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


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

Zeile 1794Zeile 2032
		}
if(count($threads) < 1)
{

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

			error($lang->error_inline_nothreadsselected);

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

		}

$moderation->stick_threads($threads);

		}

$moderation->stick_threads($threads);

Zeile 1830Zeile 2068
		{
$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);

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

		}

$moderation->unstick_threads($threads);

		}

$moderation->unstick_threads($threads);

Zeile 1877Zeile 2115

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 1893Zeile 2131
		eval("\$movethread = \"".$templates->get("moderation_inline_movethreads")."\";");
output_page($movethread);
break;

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





	// Actually move the threads in Inline moderation
case "do_multimovethreads":


	// Actually move the threads in Inline moderation
case "do_multimovethreads":


Zeile 1901Zeile 2139
		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'))
{
error_no_permission();

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

		}

		}

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

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

Zeile 1914Zeile 2154
		$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_no_permission();
}

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

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







		}

		}


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








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

$plugins->run_hooks('moderation_do_multimovethreads');


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


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 1945Zeile 2194

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

		}
if(!is_moderator_by_pids($posts, "candeleteposts"))
{

Zeile 2068Zeile 2317

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 2081Zeile 2330
			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 2132Zeile 2381
		$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 2167Zeile 2416

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, "canmanagethreads"))

		}

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

Zeile 2191Zeile 2440
		{
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 2216Zeile 2465
		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 2268Zeile 2517

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 2287Zeile 2536
		{
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
}

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

Zeile 2312Zeile 2561
		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']))

		}

if(isset($mybb->input['moveto']))

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

		}

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

Zeile 2355Zeile 2604

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, "canmanagethreads"))

		}

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

Zeile 2379Zeile 2628
		{
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 2404Zeile 2653
		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);

		}

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

		}

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

Zeile 2426Zeile 2675

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


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

 

$plugins->run_hooks("moderation_do_multimoveposts");


// explode at # sign in a url (indicates a name reference) and reassign to the url
$realurl = explode("#", $mybb->get_input('threadurl'));
$mybb->input['threadurl'] = $realurl[0];


// explode at # sign in a url (indicates a name reference) and reassign to the url
$realurl = explode("#", $mybb->get_input('threadurl'));
$mybb->input['threadurl'] = $realurl[0];





		// Are we using an SEO URL?
if(substr($mybb->input['threadurl'], -4) == "html")
{

		// Are we using an SEO URL?
if(substr($mybb->input['threadurl'], -4) == "html")
{

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

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

			}
}
else

			}
}
else

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

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

Zeile 2487Zeile 2738
		$newthread = get_thread($newtid);
if(!$newthread)
{

		$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 2520Zeile 2771

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 2539Zeile 2790
		{
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 2564Zeile 2815
		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);

		}

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

Zeile 2578Zeile 2829

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


// 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')
{
$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, "canapproveunapproveposts"))
{


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

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

		}
else
{

		}
else
{

			clearinline($tid, 'thread');
}
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsapproved);

			clearinline($tid, 'thread');
}
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsapproved);

Zeile 2637Zeile 2888

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, "canapproveunapproveposts"))

		}
$pids = array();

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

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

$moderation->unapprove_posts($pids);

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

$moderation->unapprove_posts($pids);


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


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

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

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

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

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

Zeile 2665Zeile 2916
		break;

// Restore posts - Inline moderation

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

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

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


	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();
foreach($posts as $pid)
{
$pids[] = (int)$pid;
}


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

// Soft delete posts - Inline moderation
case "multisoftdeleteposts":

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

// Soft delete posts - Inline moderation
case "multisoftdeleteposts":



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

		}
$pids = array();

		}
$pids = array();





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

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

Zeile 2739Zeile 2989
		}

$moderation->soft_delete_posts($pids);

		}

$moderation->soft_delete_posts($pids);



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

		log_moderator_action($modlogdata, $lang->multi_soft_delete_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');
}
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postssoftdeleted);

			clearinline($tid, 'thread');
}
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postssoftdeleted);

Zeile 2756Zeile 3006
		require_once MYBB_ROOT."inc/functions_user.php";

$groups = explode(",", $mybb->settings['purgespammergroups']);

		require_once MYBB_ROOT."inc/functions_user.php";

$groups = explode(",", $mybb->settings['purgespammergroups']);

		if(!in_array($mybb->user['usergroup'], $groups))

		if(!is_member($groups))

		{
error_no_permission();

		{
error_no_permission();

		}

		}





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

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

		$user = get_user($uid);
if(!$user['uid'] || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid']))
{

		$user = get_user($uid);
if(!$user['uid'] || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid']))
{

Zeile 2789Zeile 3039
				// Next ban him (or update the banned reason, shouldn't happen)
$query = $db->simple_select("banned", "uid", "uid = '{$uid}'");
if($db->num_rows($query) > 0)

				// Next ban him (or update the banned reason, shouldn't happen)
$query = $db->simple_select("banned", "uid", "uid = '{$uid}'");
if($db->num_rows($query) > 0)

				{

				{

					$banupdate = array(
"reason" => $db->escape_string($mybb->settings['purgespammerbanreason'])
);

					$banupdate = array(
"reason" => $db->escape_string($mybb->settings['purgespammerbanreason'])
);

Zeile 2813Zeile 3063
				}

// 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 2847Zeile 3099
			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);



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


Zeile 2858Zeile 3110
			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");

add_breadcrumb($lang->purgespammer);

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

add_breadcrumb($lang->purgespammer);

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

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

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

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

Zeile 2886Zeile 3138
		{
// 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 2900Zeile 3157

$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 2911Zeile 3169
				output_page($page);
exit;
}

				output_page($page);
exit;
}

 

$tool['name'] = htmlspecialchars_uni($tool['name']);


if($tool['type'] == 't' && $mybb->get_input('modtype') == 'inlinethread')
{


if($tool['type'] == 't' && $mybb->get_input('modtype') == 'inlinethread')
{

Zeile 2924Zeile 3184
				}
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 2934Zeile 3194
				$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 2945Zeile 3205
					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 2965Zeile 3225
				$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 2996Zeile 3256

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 3006Zeile 3266
				// 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", "pid IN (".implode(',',$pids).")", $options);

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

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

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

Zeile 3023Zeile 3282
					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 3047Zeile 3306
		break;
}


		break;
}


// Some little handy functions for our inline moderation








/**
* Some little handy functions for our inline moderation
*
* @param int $id
* @param string $type
*
* @return array
*/

function getids($id, $type)

function getids($id, $type)

{
global $mybb;

{
global $mybb;


$newids = array();
$cookie = "inlinemod_".$type.$id;


$newids = array();
$cookie = "inlinemod_".$type.$id;

Zeile 3068Zeile 3334
			if($cookie_id == 'ALL')
{
$newids += getallids($id, $type);

			if($cookie_id == 'ALL')
{
$newids += getallids($id, $type);

			}

			}

			else
{
$newids[] = (int)$cookie_id;

			else
{
$newids[] = (int)$cookie_id;

Zeile 3079Zeile 3345
	return $newids;
}


	return $newids;
}


 
/**
* @param int $id
* @param string $type
*
* @return array
*/

function getallids($id, $type)
{
global $db, $mybb;

function getallids($id, $type)
{
global $db, $mybb;

Zeile 3095Zeile 3367
		if(!is_array($removed_ids))
{
$removed_ids = array();

		if(!is_array($removed_ids))
{
$removed_ids = array();

		}
}


		}
}


	// "Select all Threads in this forum" only supported by forumdisplay and search
if($type == 'forum')
{
$query = $db->simple_select("threads", "tid", "fid='".(int)$id."'");
while($tid = $db->fetch_field($query, "tid"))

	// "Select all Threads in this forum" only supported by forumdisplay and search
if($type == 'forum')
{
$query = $db->simple_select("threads", "tid", "fid='".(int)$id."'");
while($tid = $db->fetch_field($query, "tid"))

		{

		{

			if(in_array($tid, $removed_ids))
{
continue;

			if(in_array($tid, $removed_ids))
{
continue;

Zeile 3112Zeile 3384
			$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 3121Zeile 3393
			$ids = explode(',', $searchlog['posts']);
}
else

			$ids = explode(',', $searchlog['posts']);
}
else

		{

		{

			$ids = explode(',', $searchlog['threads']);
}


			$ids = explode(',', $searchlog['threads']);
}


Zeile 3138Zeile 3410
	}

return $ids;

	}

return $ids;

}






}

/**
* @param int $id
* @param string $type
*/

function clearinline($id, $type)
{
my_unsetcookie("inlinemod_".$type.$id);

function clearinline($id, $type)
{
my_unsetcookie("inlinemod_".$type.$id);

	my_unsetcookie("inlinemod_".$type.$id."_removed");

	my_unsetcookie("inlinemod_{$type}{$id}_removed");

}


}


 
/**
* @param int $id
* @param string $type
*/

function extendinline($id, $type)
{

function extendinline($id, $type)
{

	my_setcookie("inlinemod_$type$id", '', TIME_NOW+3600);
my_setcookie("inlinemod_$type$id_removed", '', TIME_NOW+3600);

	my_setcookie("inlinemod_{$type}{$id}", '', TIME_NOW+3600);
my_setcookie("inlinemod_{$type}{$id}_removed", '', TIME_NOW+3600);

}

/**

}

/**

Zeile 3158Zeile 3438
 * Note: If no posts are specified, this function will return true.  It is the
* responsibility of the calling script to error-check this case if necessary.
*

 * Note: If no posts are specified, this function will return true.  It is the
* responsibility of the calling script to error-check this case if necessary.
*

 * @param array Array of post IDs
* @param string Permission to check
* @returns bool True if moderator of all; false otherwise

 * @param array $posts Array of post IDs
* @param string $permission Permission to check
* @return bool True if moderator of all; false otherwise

 */
function is_moderator_by_pids($posts, $permission='')
{

 */
function is_moderator_by_pids($posts, $permission='')
{

Zeile 3198Zeile 3478

/**
* Checks if the current user is a moderator of all the threads specified


/**
* Checks if the current user is a moderator of all the threads specified

 *

 *

 * Note: If no threads are specified, this function will return true.  It is the
* responsibility of the calling script to error-check this case if necessary.
*

 * Note: If no threads are specified, this function will return true.  It is the
* responsibility of the calling script to error-check this case if necessary.
*

 * @param array Array of thread IDs
* @param string Permission to check
* @returns bool True if moderator of all; false otherwise

 * @param array $threads Array of thread IDs
* @param string $permission Permission to check
* @return bool True if moderator of all; false otherwise

 */
function is_moderator_by_tids($threads, $permission='')

 */
function is_moderator_by_tids($threads, $permission='')

{

{

	global $db, $mybb;

// Speedy determination for supermods/admins and guests

	global $db, $mybb;

// Speedy determination for supermods/admins and guests

Zeile 3231Zeile 3511
	$threads_string = implode(',', $threads);
$query = $db->simple_select("threads", "DISTINCT fid", "tid IN ($threads_string)");
while($forum = $db->fetch_array($query))

	$threads_string = implode(',', $threads);
$query = $db->simple_select("threads", "DISTINCT fid", "tid IN ($threads_string)");
while($forum = $db->fetch_array($query))

	{

	{

		if(!is_moderator($forum['fid'], $permission))
{
return false;

		if(!is_moderator($forum['fid'], $permission))
{
return false;

Zeile 3242Zeile 3522

/**
* Special redirect that takes a return URL into account


/**
* Special redirect that takes a return URL into account

 * @param string URL
* @param string Message
* @param string Title

 * @param string $url URL
* @param string $message Message
* @param string $title Title

 */
function moderation_redirect($url, $message="", $title="")
{
global $mybb;
if(!empty($mybb->input['url']))
{

 */
function moderation_redirect($url, $message="", $title="")
{
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);
}