Vergleich moderation.php - 1.8.4 - 1.8.12

  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";
$templatelist .= ",moderation_delayedmoderation,moderation_deletethread,moderation_deletepoll,moderation_mergeposts_post,moderation_viewthreadnotes,moderation_confirmation,moderation_purgespammer";
$templatelist .= ",moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_threadnotes,moderation_getip_modoptions,moderation_getip,moderation_getpmip";
$templatelist .= ",moderation_split_post,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts,moderation_threadnotes_modaction_error";
$templatelist .= ",moderation_inline_splitposts,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password,moderation_inline_moveposts,moderation_delayedmodaction_error";
$templatelist .= ",moderation_delayedmodaction_notes_thread_single,moderation_delayedmodaction_notes_thread_multiple,moderation_delayedmodaction_notes_forum,moderation_delayedmodaction_notes_new_forum";
$templatelist .= ",moderation_delayedmodaction_notes_redirect,moderation_delayedmodaction_notes_merge,moderation_delayedmoderation_thread,moderation_threadnotes_modaction_thread,forumjump_bit";
$templatelist .= ",moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month,moderation_threadnotes_modaction_post,moderation_merge,moderation_split,moderation_threadnotes_modaction_forum";


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 105Zeile 108
	check_forum_password($forum['fid']);
}


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


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

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

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

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

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

Zeile 145Zeile 149
	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);

			$mybb->input['date_day'] = gmdate('d', TIME_NOW + $localized_time_offset);

		}
if(!$mybb->get_input('date_month', MyBB::INPUT_INT))
{

		}
if(!$mybb->get_input('date_month', MyBB::INPUT_INT))
{

			$mybb->input['date_month'] = date('m', TIME_NOW);

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

		{

		{

			$mybb->input['tids'] = $tid;
}
else
{
if($mybb->get_input('inlinetype') == 'search')

			$mybb->input['tids'] = $tid;
}
else
{
if($mybb->get_input('inlinetype') == 'search')

			{

			{

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

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

Zeile 177Zeile 183
			}

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

			}

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

		}

add_breadcrumb($lang->delayed_moderation);


		}

add_breadcrumb($lang->delayed_moderation);


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

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

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

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

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

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


switch($db->type)


switch($db->type)

		{
case "pgsql":
case "sqlite":

		{
case "pgsql":
case "sqlite":

Zeile 205Zeile 211
		while($tool = $db->fetch_array($query))
{
$allowed_types[] = "modtool_".$tool['tid'];

		while($tool = $db->fetch_array($query))
{
$allowed_types[] = "modtool_".$tool['tid'];





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

$checked = "";

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

$checked = "";

Zeile 216Zeile 222

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


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")
{
if(!in_array($mybb->input['type'], $allowed_types))

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

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

			{

			{

				$mybb->input['type'] = '';
$errors[] = $lang->error_delayedmoderation_unsupported_type;
}

if($mybb->input['type'] == 'move' && (!isset($mybb->input['delayedmoderation']['method']) || !in_array($mybb->input['delayedmoderation']['method'], array('move', 'redirect', 'copy'))))

				$mybb->input['type'] = '';
$errors[] = $lang->error_delayedmoderation_unsupported_type;
}

if($mybb->input['type'] == 'move' && (!isset($mybb->input['delayedmoderation']['method']) || !in_array($mybb->input['delayedmoderation']['method'], array('move', 'redirect', 'copy'))))

			{

			{

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

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

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

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

				}

				}

			}

if($mybb->input['date_day'] > 31 || $mybb->input['date_day'] < 1)

			}

if($mybb->input['date_day'] > 31 || $mybb->input['date_day'] < 1)

Zeile 252Zeile 258
				$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 275
				}
}


				}
}


			$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(!$errors)
{

Zeile 334Zeile 340
				$mybb->input['delayedmoderation']['new_forum'] = (int)$mybb->input['delayedmoderation']['new_forum'];
$mybb->input['delayedmoderation']['subject'] = htmlspecialchars_uni($mybb->input['delayedmoderation']['subject']);
$mybb->input['delayedmoderation']['threadurl'] = htmlspecialchars_uni($mybb->input['delayedmoderation']['threadurl']);

				$mybb->input['delayedmoderation']['new_forum'] = (int)$mybb->input['delayedmoderation']['new_forum'];
$mybb->input['delayedmoderation']['subject'] = htmlspecialchars_uni($mybb->input['delayedmoderation']['subject']);
$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]");
}
}

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

Zeile 461Zeile 467
					");
}
}

					");
}
}

 
		

		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("jS M Y, {$mybb->settings['timeformat']}", $delayedmod['delaydateline']);
$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 />";
}



				$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

			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((int)$delayedmod['inputs']['redirect_expire'] == 0)

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

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

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

					$info .= "<strong>{$lang->leave_redirect_for}</strong> {$redirect_expire_bit}<br />";



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

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

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


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

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

Zeile 516Zeile 533

$url = '';
if($mybb->get_input('tid', MyBB::INPUT_INT))


$url = '';
if($mybb->get_input('tid', MyBB::INPUT_INT))

		{

		{

			$lang->threads = $lang->thread;

			$lang->threads = $lang->thread;

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


			$thread['link'] = get_thread_link($tid);
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

Zeile 526Zeile 544
			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');

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

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

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

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

Zeile 568Zeile 586

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


$plugins->run_hooks("moderation_delayedmoderation");



$plugins->run_hooks("moderation_delayedmoderation");


Zeile 659Zeile 677

// Delete thread confirmation page
case "deletethread":


// Delete thread confirmation page
case "deletethread":


add_breadcrumb($lang->nav_deletethread);

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


add_breadcrumb($lang->nav_deletethread);

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

			}
}


			}
}


Zeile 677Zeile 695
		break;

// Delete the actual thread here

		break;

// Delete the actual thread here

	case "do_deletethread":


	case "do_deletethread":


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


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


Zeile 689Zeile 707
				error_no_permission();
}
}

				error_no_permission();
}
}





		$plugins->run_hooks("moderation_do_deletethread");

// Log the subject of the deleted thread

		$plugins->run_hooks("moderation_do_deletethread");

// Log the subject of the deleted thread

Zeile 708Zeile 726
	// 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'])
{


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

				error_no_permission();
}
}

				error_no_permission();
}
}

Zeile 825Zeile 843
		$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);


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

		$moderation->restore_threads($tid);


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


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

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

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

		}

$plugins->run_hooks('moderation_do_move');


		}

$plugins->run_hooks('moderation_do_move');


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

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

		}


		}


		$the_thread = $tid;

		$the_thread = $tid;





		$newtid = $moderation->move_thread($tid, $moveto, $method, $expire);

switch($method)

		$newtid = $moderation->move_thread($tid, $moveto, $method, $expire);

switch($method)

		{

		{

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

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

Zeile 944Zeile 962
		$plugins->run_hooks('moderation_viewthreadnotes');

$lang->view_notes_for = $lang->sprintf($lang->view_notes_for, $thread['subject']);

		$plugins->run_hooks('moderation_viewthreadnotes');

$lang->view_notes_for = $lang->sprintf($lang->view_notes_for, $thread['subject']);





		$thread['notes'] = nl2br(htmlspecialchars_uni($thread['notes']));

eval("\$viewthreadnotes = \"".$templates->get("moderation_viewthreadnotes", 1, 0)."\";");
echo $viewthreadnotes;

		$thread['notes'] = nl2br(htmlspecialchars_uni($thread['notes']));

eval("\$viewthreadnotes = \"".$templates->get("moderation_viewthreadnotes", 1, 0)."\";");
echo $viewthreadnotes;

		break;

		break;


// Thread notes editor
case "threadnotes":
add_breadcrumb($lang->nav_threadnotes);
if(!is_moderator($fid, "canmanagethreads"))


// Thread notes editor
case "threadnotes":
add_breadcrumb($lang->nav_threadnotes);
if(!is_moderator($fid, "canmanagethreads"))

		{

		{

			error_no_permission();
}
$thread['notes'] = htmlspecialchars_uni($parser->parse_badwords($thread['notes']));

			error_no_permission();
}
$thread['notes'] = htmlspecialchars_uni($parser->parse_badwords($thread['notes']));

Zeile 978Zeile 996
			while($modaction = $db->fetch_array($query))
{
$modaction['dateline'] = my_date("jS M Y, G:i", $modaction['dateline']);

			while($modaction = $db->fetch_array($query))
{
$modaction['dateline'] = my_date("jS M Y, G:i", $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")."\";");
$trow = alt_trow();
}
if(!$modactions)

				}

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

			{

			{

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

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

Zeile 1060Zeile 1086
		while($delayedmod = $db->fetch_array($query))
{
$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);

		while($delayedmod = $db->fetch_array($query))
{
$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);

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

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


				$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 1139Zeile 1183
		$post['ipaddress'] = my_inet_ntop($db->unescape_binary($post['ipaddress']));
$hostname = @gethostbyaddr($post['ipaddress']);
if(!$hostname || $hostname == $post['ipaddress'])

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

		{
$hostname = $lang->resolve_fail;
}

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



		{
$hostname = $lang->resolve_fail;
}

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


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

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

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

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

		}

$plugins->run_hooks('moderation_getip');

		}

$plugins->run_hooks('moderation_getip');

Zeile 1162Zeile 1207
	// 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);
}
add_breadcrumb($lang->nav_pms, "private.php");

			error($lang->error_invalidpm);
}
add_breadcrumb($lang->nav_pms, "private.php");

Zeile 1180Zeile 1225
		{
$hostname = $lang->resolve_fail;
}

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

		$plugins->run_hooks('moderation_getpmip');

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

		break;


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

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

		}

$plugins->run_hooks("moderation_merge");

		}

$plugins->run_hooks("moderation_merge");

Zeile 1214Zeile 1259

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


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





		// 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 1237Zeile 1282
			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['tid'] = $threadmatch[1];
}

if($postmatch[1])

			{

			{

				$parameters['pid'] = $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));

if(!empty($temp))

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

if(!empty($temp))

			{

			{

				for($i = 0; $i < count($temp); $i++)
{
$temp2 = explode("=", $temp[$i], 2);

				for($i = 0; $i < count($temp); $i++)
{
$temp2 = explode("=", $temp[$i], 2);

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

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

		}

		}

		else

		else

		{

		{

			$mergetid = 0;
}
$mergethread = get_thread($mergetid);

			$mergetid = 0;
}
$mergethread = get_thread($mergetid);

		if(!$mergethread)
{
error($lang->error_badmergeurl);

		if(!$mergethread)
{
error($lang->error_badmergeurl);

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

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

Zeile 1334Zeile 1379
		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'],


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

Zeile 1428Zeile 1474

// Delete Thread Subscriptions
case "removesubscriptions":


// Delete Thread Subscriptions
case "removesubscriptions":

 

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


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

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

		}

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





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


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


Zeile 1451Zeile 1501
			// 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
{
$threads = getids($fid, 'forum');

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

Zeile 1469Zeile 1519
		}

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

		}

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

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

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

			clearinline($fid, 'forum');
}
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

			clearinline($fid, 'forum');
}
$return_url = htmlspecialchars_uni($mybb->get_input('url'));

Zeile 1483Zeile 1533
		break;

// Actually delete the threads - Inline moderation

		break;

// Actually delete the threads - Inline moderation

	case "do_multideletethreads":

// Verify incoming POST request

	case "do_multideletethreads":

// Verify incoming POST request

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

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

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

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

		{

		{

			error_no_permission();
}
foreach($threadlist as $tid)

			error_no_permission();
}
foreach($threadlist as $tid)

Zeile 1501Zeile 1551
		}
log_moderator_action($modlogdata, $lang->multi_deleted_threads);
if($mybb->get_input('inlinetype') == 'search')

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

		{

		{

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

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

Zeile 1513Zeile 1563
		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']))

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

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

			{

			{

				error_no_permission();
}
}

				error_no_permission();
}
}

Zeile 1534Zeile 1584
			{
error_no_permission();
}

			{
error_no_permission();
}

		}

		}


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


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

		}


		}


		$moderation->open_threads($threads);

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

		$moderation->open_threads($threads);

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

		{

		{

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

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

Zeile 1556Zeile 1606
		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']))
{

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

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

			{
error_no_permission();
}
}
else
{

			{
error_no_permission();
}
}
else
{

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

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

Zeile 1581Zeile 1631
		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);

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

		$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($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else

Zeile 1598Zeile 1648
		break;

// Approve threads - Inline moderation

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

	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 1623Zeile 1673
		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);

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

		}

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


		}

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

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

		}

		}

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

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

Zeile 1651Zeile 1701
			// 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 1711Zeile 1761
			error($lang->error_inline_nothreadsselected);
}


			error($lang->error_inline_nothreadsselected);
}


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

		$moderation->restore_threads($threads);


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


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

Zeile 1754Zeile 1804
			error($lang->error_inline_nothreadsselected);
}


			error($lang->error_inline_nothreadsselected);
}


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

		$moderation->soft_delete_threads($threads);


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


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

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

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

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

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

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

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

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

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

		}
if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting
error($lang->error_cantmoveall);

		}
if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting
error($lang->error_cantmoveall);

		}

		}


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


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

Zeile 2423Zeile 2473

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


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





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

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

 

$plugins->run_hooks("moderation_do_multimoveposts");


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


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

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

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

			}

			}

		}
else
{

		}
else
{

Zeile 2492Zeile 2544
		if($newtid == $tid)
{ // sanity check
error($lang->error_movetoself);

		if($newtid == $tid)
{ // sanity check
error($lang->error_movetoself);

		}

		}


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


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

Zeile 2578Zeile 2630

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


// 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(count($posts) < 1)
{
error($lang->error_inline_nopostsselected);

		}

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

		}

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

		}

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

		}

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

		}


		}


		$moderation->approve_posts($pids);

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

		$moderation->approve_posts($pids);

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

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

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

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

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

Zeile 2621Zeile 2673
		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
{













































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

// 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($tid, 'thread');
}



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

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

		$pids = array();

 




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

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

		{
error_no_permission();
}

		{
error_no_permission();
}

 

$pids = array();

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

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

		}

$moderation->restore_posts($pids);

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

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

		break;

		break;


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



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


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

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

 


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

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


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


		$pids = array();

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

			error_no_permission();
}

			error_no_permission();
}


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

$moderation->restore_posts($pids);

log_moderator_action($modlogdata, $lang->multi_restore_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_postsrestored);
break;

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

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

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

$moderation->soft_delete_posts($pids);
log_moderator_action($modlogdata, $lang->multi_soft_delete_posts);
























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

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

if(!is_moderator_by_pids($posts, "cansoftdeleteposts"))
{
error_no_permission();
}
foreach($posts as $pid)
{
$pids[] = (int)$pid;
}

$moderation->soft_delete_posts($pids);

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

Zeile 2748Zeile 2799
		else
{
clearinline($tid, 'thread');

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

		}

		}

		moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postssoftdeleted);
break;
case "do_purgespammer":

		moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postssoftdeleted);
break;
case "do_purgespammer":

Zeile 2769Zeile 2820
		}

if($mybb->input['action'] == "do_purgespammer")

		}

if($mybb->input['action'] == "do_purgespammer")

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

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


$user_deleted = false;



$user_deleted = false;


Zeile 2863Zeile 2914
		else if($mybb->input['action'] == "purgespammer")
{
$plugins->run_hooks("moderation_purgespammer_show");

		else if($mybb->input['action'] == "purgespammer")
{
$plugins->run_hooks("moderation_purgespammer_show");





			add_breadcrumb($lang->purgespammer);

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

			}

			}

			else
{
$lang->purgespammer_purge_desc = $lang->sprintf($lang->purgespammer_purge_desc, $lang->purgespammer_delete);

			else
{
$lang->purgespammer_purge_desc = $lang->sprintf($lang->purgespammer_purge_desc, $lang->purgespammer_delete);

Zeile 2886Zeile 2937
		{
// 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']))
{
error_no_permission();

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

if(!is_member($tool['groups']))
{
error_no_permission();

			}

			}


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


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

Zeile 2910Zeile 2961

output_page($page);
exit;


output_page($page);
exit;

			}


			}


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

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

Zeile 3009Zeile 3060
					'order_by' => 'dateline',
'order_dir' => 'asc'
);

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

				$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 3047Zeile 3098
		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)
{
global $mybb;

function getids($id, $type)
{
global $mybb;

Zeile 3079Zeile 3137
	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 3140Zeile 3204
	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 3230
 * 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 3202Zeile 3274
 * 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='')
{

Zeile 3242Zeile 3314

/**
* 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="")
{

 */
function moderation_redirect($url, $message="", $title="")
{