Vergleich moderation.php - 1.8.8 - 1.8.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19
$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";

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

 
$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 106Zeile 107
{
// Check if this forum is password protected and we have a valid password
check_forum_password($forum['fid']);

{
// Check if this forum is password protected and we have a valid password
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']);

}

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

Zeile 180Zeile 198
			if(count($tids) < 1)
{
error($lang->error_inline_nothreadsselected);

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

			}


			}


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

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

		}

add_breadcrumb($lang->delayed_moderation);

		}

add_breadcrumb($lang->delayed_moderation);


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


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

Zeile 195Zeile 213
		$errors = array();
$customthreadtools = "";


		$errors = array();
$customthreadtools = "";


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

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





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
























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





		switch($db->type)



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

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

		{

		{

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

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






			{

			{

				$checked = "checked=\"checked\"";
}










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



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

		}

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

		}

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

Zeile 261Zeile 310
			if($mybb->input['date_year'] < gmdate('Y', TIME_NOW + $localized_time_offset))
{
$errors[] = $lang->error_delayedmoderation_invalid_date_year;

			if($mybb->input['date_year'] < gmdate('Y', TIME_NOW + $localized_time_offset))
{
$errors[] = $lang->error_delayedmoderation_invalid_date_year;

			}


			}


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

if(stristr($mybb->input['date_time'], 'pm'))

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

if(stristr($mybb->input['date_time'], 'pm'))

			{

			{

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

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

				}

				}

			}

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

			}

$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 300Zeile 349
				$lang->redirect_delayed_moderation_thread = $lang->sprintf($lang->redirect_delayed_moderation_thread, $rundate_format);

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

				$lang->redirect_delayed_moderation_thread = $lang->sprintf($lang->redirect_delayed_moderation_thread, $rundate_format);

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

				{

				{

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

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

Zeile 403Zeile 452
		if($tid == 0)
{
// Inline thread moderation is used

		if($tid == 0)
{
// Inline thread moderation is used

			if($mybb->get_input('inlinetype') == 'search')
{
$tids = getids($mybb->get_input('searchid'), 'search');
}
else
{
$tids = getids($fid, "forum");
}
$where_array = array();
switch($db->type)

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






			{

			{

				case "pgsql":
case "sqlite":






				$tids = getids($fid, "forum");
}
$where_array = array();
switch($db->type)
{
case "pgsql":
case "sqlite":

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

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

					}
$where_statement = implode(" OR ", $where_array);

					}
$where_statement = implode(" OR ", $where_array);

					break;
default:
foreach($tids as $like)

					break;
default:
foreach($tids as $like)

Zeile 445Zeile 494
			{
case "pgsql":
case "sqlite":

			{
case "pgsql":
case "sqlite":

					$query = $db->query("
SELECT d.*, u.username, f.name AS fname
FROM ".TABLE_PREFIX."delayedmoderation d

					$query = $db->query("
SELECT d.*, u.username, f.name AS fname
FROM ".TABLE_PREFIX."delayedmoderation d

						LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=d.uid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=d.fid)
WHERE ','||d.tids||',' LIKE '%,{$tid},%'

						LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=d.uid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=d.fid)
WHERE ','||d.tids||',' LIKE '%,{$tid},%'

Zeile 520Zeile 569
				$delayedmod['subject'] = htmlspecialchars_uni($delayedmod['inputs']['subject']);
$delayedmod['threadurl'] = htmlspecialchars_uni($delayedmod['inputs']['threadurl']);
eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_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")."\";");

		}


		}


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

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

Zeile 557Zeile 606

$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');
eval("\$moderation_delayedmoderation_move = \"".$templates->get("moderation_delayedmoderation_move")."\";");


		$mybb->input['redirect_expire'] = $mybb->get_input('redirect_expire');
eval("\$moderation_delayedmoderation_move = \"".$templates->get("moderation_delayedmoderation_move")."\";");


Zeile 569Zeile 618
			if($mybb->get_input('date_day', MyBB::INPUT_INT) == $day)
{
$selected = ' selected="selected"';

			if($mybb->get_input('date_day', MyBB::INPUT_INT) == $day)
{
$selected = ' selected="selected"';

			}

			}

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

			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 588Zeile 637

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


$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 630Zeile 709
		verify_post_check($mybb->get_input('my_post_key'));

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

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

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

		{
error_no_permission();
}

$plugins->run_hooks("moderation_stick");

		{
error_no_permission();
}

$plugins->run_hooks("moderation_stick");


if($thread['sticky'] == 1)
{


if($thread['sticky'] == 1)
{

Zeile 643Zeile 722
			$moderation->unstick_threads($tid);
}
else

			$moderation->unstick_threads($tid);
}
else

		{

		{

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

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


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

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

		}

$plugins->run_hooks("moderation_removeredirects");


		}

$plugins->run_hooks("moderation_removeredirects");


		$moderation->remove_redirects($tid);

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

		$moderation->remove_redirects($tid);

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

		break;

		break;


// Delete thread confirmation page
case "deletethread":


// Delete thread confirmation page
case "deletethread":





		add_breadcrumb($lang->nav_deletethread);

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

		add_breadcrumb($lang->nav_deletethread);

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

Zeile 701Zeile 780
		verify_post_check($mybb->get_input('my_post_key'));

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

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

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

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

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

			}
}


			}
}


Zeile 1398Zeile 1477
			eval("\$posts .= \"".$templates->get("moderation_split_post")."\";");
$altbg = alt_trow();
}

			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 1421Zeile 1502

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

		}

		}

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

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





		if($count['totalposts'] == 1)
{
error($lang->error_cantsplitonepost);

		if($count['totalposts'] == 1)
{
error($lang->error_cantsplitonepost);

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

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

		}

		}


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


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

		{

		{

			$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
}
else
{
$moveto = $fid;

			$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
}
else
{
$moveto = $fid;

		}


		}


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

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

Zeile 1474Zeile 1555

// Delete Thread Subscriptions
case "removesubscriptions":


// Delete Thread Subscriptions
case "removesubscriptions":

 

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


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

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

Zeile 1491Zeile 1576
	// Delete Threads - Inline moderation
case "multideletethreads":
add_breadcrumb($lang->nav_multi_deletethreads);

	// Delete Threads - Inline moderation
case "multideletethreads":
add_breadcrumb($lang->nav_multi_deletethreads);


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


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

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

		{

		{

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

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

		}

		}

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

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

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

$inlineids = implode("|", $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 1565Zeile 1650
		verify_post_check($mybb->get_input('my_post_key'));

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

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

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

		{

		{

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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

		}
else

		}
else

		{

		{

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

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

		}

		}


if(count($threads) < 1)
{


if(count($threads) < 1)
{

Zeile 1588Zeile 1673
		}

$moderation->open_threads($threads);

		}

$moderation->open_threads($threads);





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

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

Zeile 1600Zeile 1685
		}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsopened);
break;

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





	// Close threads - Inline moderation
case "multiclosethreads":


	// Close threads - Inline moderation
case "multiclosethreads":


Zeile 1608Zeile 1693
		verify_post_check($mybb->get_input('my_post_key'));

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

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

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

		{

		{

			// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, '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 1620Zeile 1705
		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canopenclosethreads'))

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

		if(count($threads) < 1)

		if(count($threads) < 1)

		{
error($lang->error_inline_nothreadsselected);
}

$moderation->close_threads($threads);

		{
error($lang->error_inline_nothreadsselected);
}

$moderation->close_threads($threads);


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


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

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

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

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

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

		}

		}

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

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

Zeile 1645Zeile 1730

// Approve threads - Inline moderation
case "multiapprovethreads":


// Approve threads - Inline moderation
case "multiapprovethreads":


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

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


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

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

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

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

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

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

Zeile 1688Zeile 1773

// Unapprove threads - Inline moderation
case "multiunapprovethreads":


// Unapprove threads - Inline moderation
case "multiunapprovethreads":


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

if(!empty($mybb->input['searchid']))
{
// From search page
$threads = getids($mybb->get_input('searchid'), 'search');


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

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

			{
error_no_permission();
}
}

			{
error_no_permission();
}
}

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

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

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

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

		}


		}


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

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

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

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

		{

		{

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

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

Zeile 1731Zeile 1816

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





		if(!empty($mybb->input['searchid']))
{
// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'canrestorethreads'))

		if(!empty($mybb->input['searchid']))
{
// From search page
$threads = getids($mybb->get_input('searchid'), 'search');
if(!is_moderator_by_tids($threads, 'canrestorethreads'))

			{
error_no_permission();
}
}
else
{

			{
error_no_permission();
}
}
else
{

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

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

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

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

		}


		}


		$moderation->restore_threads($threads);

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

		$moderation->restore_threads($threads);

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

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

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

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

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

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

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

			{
error_no_permission();
}

			{
error_no_permission();
}

		}
else
{

		}
else
{

Zeile 1794Zeile 1879
			{
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->soft_delete_threads($threads);

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

		$moderation->soft_delete_threads($threads);

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

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

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

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

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

		}
else
{

		}
else
{

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

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

Zeile 1817Zeile 1902

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


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


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

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


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

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

			error($lang->error_inline_nothreadsselected);
}

$moderation->stick_threads($threads);

			error($lang->error_inline_nothreadsselected);
}

$moderation->stick_threads($threads);





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

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

Zeile 1853Zeile 1938
		else
{
clearinline($fid, 'forum');

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

		}

		}

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


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


Zeile 1872Zeile 1957
				error_no_permission();
}
}

				error_no_permission();
}
}

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

		else









		{

		{

			error($lang->error_inline_nothreadsselected);









			$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canstickunstickthreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);

		}

$moderation->unstick_threads($threads);

		}

$moderation->unstick_threads($threads);

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

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

		}
else

		}
else

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

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

Zeile 1918Zeile 2003
			if(!is_moderator($fid, 'canmanagethreads'))
{
error_no_permission();

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

			}
}

			}
}


if(count($threads) < 1)
{


if(count($threads) < 1)
{

Zeile 2177Zeile 2262

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

		}

		}


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


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

		{

		{

			$postlist[] = (int)$pid;

			$postlist[] = (int)$pid;

		}


		}


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

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

Zeile 2197Zeile 2282
		log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_post_link($masterpid)."#pid$masterpid", $lang->redirect_inline_postsmerged);
break;

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





	// Split posts - Inline moderation
case "multisplitposts":
add_breadcrumb($lang->nav_multi_splitposts);

	// Split posts - Inline moderation
case "multisplitposts":
add_breadcrumb($lang->nav_multi_splitposts);


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

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

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

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

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


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

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

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

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

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

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

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

Zeile 2320Zeile 2405
		$pidin = implode(',', $posts);

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

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

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

		// Select number of posts in each thread that the splitted post is in
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)

		// Select number of posts in each thread that the splitted post is in
$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)

			WHERE p.pid IN ($pidin)
GROUP BY p.tid, p.pid
");
$pcheck = array();

			WHERE p.pid IN ($pidin)
GROUP BY p.tid, p.pid
");
$pcheck = array();

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

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

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

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

			}

			}

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


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


Zeile 2359Zeile 2444
		{
// One or more threads do not have posts after splitting
error($lang->error_cantsplitall);

		{
// One or more threads do not have posts after splitting
error($lang->error_cantsplitall);

		}

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

		}

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

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

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

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

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

		}


		}


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


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


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

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

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


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


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

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

Zeile 2472Zeile 2557

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