Vergleich moderation.php - 1.04 - 1.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 917Zeile 917
			}
markreports($post['pid'], "post");
}

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

 
		        // Update the subject of the first post in the new thread
$query = $db->query("SELECT pid FROM ".TABLE_PREFIX."posts WHERE tid='$newtid' ORDER BY dateline ASC LIMIT 1");
$newthread = $db->fetch_array($query);
$db->query("UPDATE ".TABLE_PREFIX."posts SET subject='$newsubject' WHERE pid='$newthread[pid]' LIMIT 1");

// Update the subject of the first post in the old thread
$query = $db->query("SELECT pid FROM ".TABLE_PREFIX."posts WHERE tid='$tid' ORDER BY dateline ASC LIMIT 1");
$oldthread = $db->fetch_array($query);
$db->query("UPDATE ".TABLE_PREFIX."posts SET subject='$thread[subject]' WHERE pid='$oldthread[pid]' LIMIT 1");

		update_first_post($newtid);
update_first_post($tid);
logmod($modlogdata, $lang->thread_split);
updatethreadcount($tid);
updatethreadcount($newtid);
if($moveto != $fid)

		update_first_post($newtid);
update_first_post($tid);
logmod($modlogdata, $lang->thread_split);
updatethreadcount($tid);
updatethreadcount($newtid);
if($moveto != $fid)

		{

		{

			updateforumcount($moveto);
}
updateforumcount($fid);

			updateforumcount($moveto);
}
updateforumcount($fid);

Zeile 933Zeile 942
	// Delete Threads - Inline moderation
case "multideletethreads":
addnav($lang->nav_multi_deletethreads);

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

		if(ismod($fid, "candeleteposts") != "yes")
{
if($permissions['candeletethreads'] != "yes" || $mybb->user['uid'] != $thread['uid'])
{
nopermission();
}

		if(ismod($fid, "candeleteposts") != "yes")
{
if($permissions['candeletethreads'] != "yes" || $mybb->user['uid'] != $thread['uid'])
{
nopermission();
}

		}
$threads = getids($fid, "forum");
if(!is_array($threads))

		}
$threads = getids($fid, "forum");
if(!is_array($threads))

Zeile 976Zeile 985

// Open threads - Inline moderation
case "multiopenthreads":


// Open threads - Inline moderation
case "multiopenthreads":

		if(ismod($fid, "canopenclosethreads") != "yes")
{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{
error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";
foreach($threads as $tid)
{
$q .= " OR tid='$tid'";
}

		if(ismod($fid, "canopenclosethreads") != "yes")
{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{
error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";
foreach($threads as $tid)
{
$q .= " OR tid='$tid'";
}

		$db->query("UPDATE ".TABLE_PREFIX."threads SET closed='no' WHERE $q");
logmod($modlogdata, $lang->multi_opened_threads);
clearinline($fid, "forum");

		$db->query("UPDATE ".TABLE_PREFIX."threads SET closed='no' WHERE $q");
logmod($modlogdata, $lang->multi_opened_threads);
clearinline($fid, "forum");

Zeile 998Zeile 1007

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


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

		if(ismod($fid, "canmanagethreads") != "yes")
{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{
error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";
foreach($threads as $tid)

		if(ismod($fid, "canmanagethreads") != "yes")
{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{
error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";
foreach($threads as $tid)

		{
$q .= " OR tid='$tid'";
}

		{
$q .= " OR tid='$tid'";
}

Zeile 1016Zeile 1025
		logmod($modlogdata, $lang->multi_closed_threads);
clearinline($fid, "forum");
redirect("forumdisplay.php?fid=$fid", $lang->redirect_inline_threadsclosed);

		logmod($modlogdata, $lang->multi_closed_threads);
clearinline($fid, "forum");
redirect("forumdisplay.php?fid=$fid", $lang->redirect_inline_threadsclosed);

		break;


		break;


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

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

		if(ismod($fid, "canmanagethreads") != "yes")
{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{

		if(ismod($fid, "canmanagethreads") != "yes")
{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{

			error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";

			error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";

Zeile 1053Zeile 1062
		if(!is_array($threads))
{
error($lang->error_inline_nothreadsselected);

		if(!is_array($threads))
{
error($lang->error_inline_nothreadsselected);

		}

		}

		$q = "tid='-1'";
foreach($threads as $tid)
{

		$q = "tid='-1'";
foreach($threads as $tid)
{

Zeile 1062Zeile 1071
		$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='0' WHERE $q");
$db->query("UPDATE ".TABLE_PREFIX."posts SET visible='0' WHERE $q AND replyto='0'");
logmod($modlogdata, $lang->multi_unapproved_threads);

		$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='0' WHERE $q");
$db->query("UPDATE ".TABLE_PREFIX."posts SET visible='0' WHERE $q AND replyto='0'");
logmod($modlogdata, $lang->multi_unapproved_threads);

		clearinline($fid, "forum");

		clearinline($fid, "forum");

		$cache->updatestats();
updateforumcount($fid);
redirect("forumdisplay.php?fid=$fid", $lang->redirect_inline_threadsunapproved);

		$cache->updatestats();
updateforumcount($fid);
redirect("forumdisplay.php?fid=$fid", $lang->redirect_inline_threadsunapproved);

Zeile 1070Zeile 1079
	
// Stick threads - Inline moderation
case "multistickthreads":

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

		if(ismod($fid, "canopenclosethreads") != "yes")
{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{
error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";
foreach($threads as $tid)

		if(ismod($fid, "canopenclosethreads") != "yes")
{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{
error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";
foreach($threads as $tid)

		{
$q .= " OR tid='$tid'";
}

		{
$q .= " OR tid='$tid'";
}

Zeile 1088Zeile 1097
		logmod($modlogdata, $lang->multi_stuck_threads);
clearinline($fid, "forum");
redirect("forumdisplay.php?fid=$fid", $lang->redirect_inline_threadsstuck);

		logmod($modlogdata, $lang->multi_stuck_threads);
clearinline($fid, "forum");
redirect("forumdisplay.php?fid=$fid", $lang->redirect_inline_threadsstuck);

		break;


		break;


	// Unstick threads - Inline moderaton
case "multiunstickthreads":
if(ismod($fid, "canopenclosethreads") != "yes")

	// Unstick threads - Inline moderaton
case "multiunstickthreads":
if(ismod($fid, "canopenclosethreads") != "yes")

		{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{

		{
nopermission();
}
$threads = getids($fid, "forum");
if(!is_array($threads))
{

			error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";

			error($lang->error_inline_nothreadsselected);
}
$q = "tid='-1'";

Zeile 1134Zeile 1143

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


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

		if(ismod($fid, "canmanagethreads") != "yes")
{

		if(ismod($fid, "canmanagethreads") != "yes")
{

			nopermission();
}
$q = "tid='-1'";
$moveto = intval($mybb->input['moveto']);
$threadlist = explode("|", $mybb->input['threads']);
foreach($threadlist as $tid)

			nopermission();
}
$q = "tid='-1'";
$moveto = intval($mybb->input['moveto']);
$threadlist = explode("|", $mybb->input['threads']);
foreach($threadlist as $tid)

		{

		{

			$q .= " OR tid='".intval($tid)."'";

			$q .= " OR tid='".intval($tid)."'";

		}

		}

		if(ismod($moveto, "canmanagethreads") != "yes")

		if(ismod($moveto, "canmanagethreads") != "yes")

		{

		{

			nopermission();
}
$newperms = forum_permissions($moveto);
if($newperms['canview'] == "no")

			nopermission();
}
$newperms = forum_permissions($moveto);
if($newperms['canview'] == "no")

		{

		{

			nopermission();

			nopermission();

		}

		}

		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."forums WHERE fid='$moveto'");
$newforum = $db->fetch_array($query);
if($newforum['type'] != "f")
{
error($lang->error_invalidforum);

		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."forums WHERE fid='$moveto'");
$newforum = $db->fetch_array($query);
if($newforum['type'] != "f")
{
error($lang->error_invalidforum);

		}

		}

		if($thread['fid'] == $moveto)
{
error($lang->error_movetosameforum);

		if($thread['fid'] == $moveto)
{
error($lang->error_movetosameforum);

Zeile 1177Zeile 1186
			if($method != "copy" && ($newforum['usepostcounts'] != "no" && $forum['usepostcounts'] == "no"))
{
$pcount = "+$posters[posts]";

			if($method != "copy" && ($newforum['usepostcounts'] != "no" && $forum['usepostcounts'] == "no"))
{
$pcount = "+$posters[posts]";

			}

			}

			if($method != "copy" && ($newforum['usepostcounts'] == "no" && $forum['usepostcounts'] != "no"))
{
$pcount = "-$posters[posts]";

			if($method != "copy" && ($newforum['usepostcounts'] == "no" && $forum['usepostcounts'] != "no"))
{
$pcount = "-$posters[posts]";

Zeile 1203Zeile 1212
		}
$inlineids = implode("|", $posts);
//clearinline($pid, "post");

		}
$inlineids = implode("|", $posts);
//clearinline($pid, "post");

		clearinline($tid, "thread");

if(!is_array($posts))
{
error($lang->error_inline_nopostsselected);

		clearinline($tid, "thread");

if(!is_array($posts))
{
error($lang->error_inline_nopostsselected);

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

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

		break;

		break;


// Actually delete the posts in inline moderation
case "do_multideleteposts":


// Actually delete the posts in inline moderation
case "do_multideleteposts":

		if(ismod($fid, "candeleteposts") != "yes")
{
nopermission();
}
$postlist = explode("|", $mybb->input['posts']);

		if(ismod($fid, "candeleteposts") != "yes")
{
nopermission();
}
$postlist = explode("|", $mybb->input['posts']);

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

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

Zeile 1227Zeile 1236
			deletepost($pid);
$plist[] = $pid;
$deletecount++;

			deletepost($pid);
$plist[] = $pid;
$deletecount++;

		}

		}

		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE tid='$tid'");
$numposts = $db->num_rows($query);
if(!$numposts)

		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE tid='$tid'");
$numposts = $db->num_rows($query);
if(!$numposts)

Zeile 1235Zeile 1244
			deletethread($tid);
markreports($tid, "thread");
$url = "forumdisplay.php?fid=$fid";

			deletethread($tid);
markreports($tid, "thread");
$url = "forumdisplay.php?fid=$fid";

		}

		}

		else
{
updatethreadcount($tid);

		else
{
updatethreadcount($tid);

Zeile 1252Zeile 1261
	case "multimergeposts":
addnav($lang->nav_multi_mergeposts);
if(ismod($fid, "candeleteposts") != "yes")

	case "multimergeposts":
addnav($lang->nav_multi_mergeposts);
if(ismod($fid, "candeleteposts") != "yes")

		{

		{

			nopermission();
}
$posts = getids($tid, "thread");

			nopermission();
}
$posts = getids($tid, "thread");

Zeile 1269Zeile 1278

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


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

		if(ismod($fid, "canmanagethreads") != "yes")
{
nopermission();
}
$postlist = explode("|", $mybb->input['posts']);
foreach($postlist as $pid)
{
$pid = intval($pid);
$pidin .= "$comma'$pid'";
$comma = ",";
$plist[] = $pid;
}

		if(ismod($fid, "canmanagethreads") != "yes")
{
nopermission();
}
$postlist = explode("|", $mybb->input['posts']);
foreach($postlist as $pid)
{
$pid = intval($pid);
$pidin .= "$comma'$pid'";
$comma = ",";
$plist[] = $pid;
}

		$first = 1;
$query = $db->query("SELECT pid, message FROM ".TABLE_PREFIX."posts WHERE tid='$tid' AND pid IN($pidin) ORDER BY dateline ASC LIMIT 0, 1");
$master = $db->fetch_array($query);

		$first = 1;
$query = $db->query("SELECT pid, message FROM ".TABLE_PREFIX."posts WHERE tid='$tid' AND pid IN($pidin) ORDER BY dateline ASC LIMIT 0, 1");
$master = $db->fetch_array($query);

Zeile 1289Zeile 1298
		$db->query("UPDATE ".TABLE_PREFIX."attachments SET pid='$masterpid' WHERE pid IN($pidin)");
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE tid='$tid' AND pid IN($pidin) ORDER BY dateline ASC");
while($post = $db->fetch_array($query))

		$db->query("UPDATE ".TABLE_PREFIX."attachments SET pid='$masterpid' WHERE pid IN($pidin)");
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE tid='$tid' AND pid IN($pidin) ORDER BY dateline ASC");
while($post = $db->fetch_array($query))

		{

		{

			if($post['pid'] != $masterpid)
{ // these are the selected posts
if($mybb->input['sep'] == "new_line")

			if($post['pid'] != $masterpid)
{ // these are the selected posts
if($mybb->input['sep'] == "new_line")

Zeile 1316Zeile 1325
	case "multisplitposts":
addnav($lang->nav_multi_splitposts);
if(ismod($fid, "canmanagethreads") != "yes")

	case "multisplitposts":
addnav($lang->nav_multi_splitposts);
if(ismod($fid, "canmanagethreads") != "yes")

		{

		{

			nopermission();
}
$query = $db->query("SELECT p.*, u.* FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid) WHERE tid='$tid' ORDER BY dateline ASC");

			nopermission();
}
$query = $db->query("SELECT p.*, u.* FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid) WHERE tid='$tid' ORDER BY dateline ASC");

Zeile 1351Zeile 1360

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


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

		if(ismod($fid, "canmanagethreads") != "yes")
{

		if(ismod($fid, "canmanagethreads") != "yes")
{

			nopermission();
}
$postlist = explode("|", $mybb->input['posts']);

			nopermission();
}
$postlist = explode("|", $mybb->input['posts']);

Zeile 1374Zeile 1383
		if($db->num_rows($query) == 0)
{
error($lang->error_invalidforum);

		if($db->num_rows($query) == 0)
{
error($lang->error_invalidforum);

		}

		}

		$newsubject = addslashes($mybb->input['newsubject']);
$db->query("INSERT INTO ".TABLE_PREFIX."threads (fid,subject,icon,uid,username,dateline,lastpost,lastposter,replies,visible) VALUES ('$moveto','$newsubject','$thread[icon]','$thread[uid]','$thread[username]','$thread[dateline]','$thread[lastpost]','$thread[lastposter]','$numyes','1')");
$newtid = $db->insert_id();

		$newsubject = addslashes($mybb->input['newsubject']);
$db->query("INSERT INTO ".TABLE_PREFIX."threads (fid,subject,icon,uid,username,dateline,lastpost,lastposter,replies,visible) VALUES ('$moveto','$newsubject','$thread[icon]','$thread[uid]','$thread[username]','$thread[dateline]','$thread[lastpost]','$thread[lastposter]','$numyes','1')");
$newtid = $db->insert_id();

Zeile 1389Zeile 1398
		while($posters = $db->fetch_array($query))
{
if($oldusepcounts == "yes" && $newusepcounts == "no")

		while($posters = $db->fetch_array($query))
{
if($oldusepcounts == "yes" && $newusepcounts == "no")

			{

			{

				$pcount = "-$posters[posts]";

				$pcount = "-$posters[posts]";

			}

			}

			if($oldusepcounts == "no" && $newusepcounts == "yes")
{
$pcount = "+$posters[posts]";
}
$db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum$pcount WHERE uid='$posters[uid]'");

			if($oldusepcounts == "no" && $newusepcounts == "yes")
{
$pcount = "+$posters[posts]";
}
$db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum$pcount WHERE uid='$posters[uid]'");

		}










		}
// Update the subject of the first post in the new thread
$query = $db->query("SELECT pid FROM ".TABLE_PREFIX."posts WHERE tid='$newtid' ORDER BY dateline ASC LIMIT 1");
$newthread = $db->fetch_array($query);
$db->query("UPDATE ".TABLE_PREFIX."posts SET subject='$newsubject' WHERE pid='$newthread[pid]' LIMIT 1");

// Update the subject of the first post in the old thread
$query = $db->query("SELECT pid FROM ".TABLE_PREFIX."posts WHERE tid='$tid' ORDER BY dateline ASC LIMIT 1");
$oldthread = $db->fetch_array($query);
$db->query("UPDATE ".TABLE_PREFIX."posts SET subject='$thread[subject]' WHERE pid='$oldthread[pid]' LIMIT 1");

		logmod($modlogdata, $lang->thread_split);
markreports($plist, "posts");
updatethreadcount($tid);

		logmod($modlogdata, $lang->thread_split);
markreports($plist, "posts");
updatethreadcount($tid);

Zeile 1412Zeile 1430

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


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

		if(ismod($fid, "canmanagethreads") != "yes")
{
nopermission();
}
$posts = getids($tid, "thread");
if(!is_array($posts))
{
error($lang->error_inline_nopostsselected);
}
$q = "pid='-1'";
foreach($posts as $pid)
{
$q .= " OR pid='$pid'";
}

		if(ismod($fid, "canmanagethreads") != "yes")
{
nopermission();
}
$posts = getids($tid, "thread");
if(!is_array($posts))
{
error($lang->error_inline_nopostsselected);
}
$q = "pid='-1'";
foreach($posts as $pid)
{
$q .= " OR pid='$pid'";
}

		$db->query("UPDATE ".TABLE_PREFIX."posts SET visible='1' WHERE $q");
// If this is the first post of the thread, also approve the thread
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE $q");

		$db->query("UPDATE ".TABLE_PREFIX."posts SET visible='1' WHERE $q");
// If this is the first post of the thread, also approve the thread
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE $q");

Zeile 1434Zeile 1452
			if($post['replyto'] == 0)
{
$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='1' WHERE tid='$post[tid]'");

			if($post['replyto'] == 0)
{
$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='1' WHERE tid='$post[tid]'");

				$cache->updatestats();

				$cache->updatestats();

				updateforumcount($fid);
}
}

				updateforumcount($fid);
}
}

Zeile 1442Zeile 1460
		logmod($modlogdata, $lang->multi_approve_posts);
clearinline($tid, "thread");
redirect("showthread.php?tid=$tid", $lang->redirect_inline_postsapproved);

		logmod($modlogdata, $lang->multi_approve_posts);
clearinline($tid, "thread");
redirect("showthread.php?tid=$tid", $lang->redirect_inline_postsapproved);

		break;


		break;


	// Unapprove posts - Inline moderation
case "multiunapproveposts":
if(ismod($fid, "canmanagethreads") != "yes")

	// Unapprove posts - Inline moderation
case "multiunapproveposts":
if(ismod($fid, "canmanagethreads") != "yes")

Zeile 1452Zeile 1470
		}
$posts = getids($tid, "thread");
if(!is_array($posts))

		}
$posts = getids($tid, "thread");
if(!is_array($posts))

		{

		{

			error($lang->error_inline_nopostsselected);
}
$q = "pid='-1'";

			error($lang->error_inline_nopostsselected);
}
$q = "pid='-1'";

Zeile 1470Zeile 1488
				$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='0' WHERE tid='$post[tid]'");
$cache->updatestats();
updateforumcount($fid);

				$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='0' WHERE tid='$post[tid]'");
$cache->updatestats();
updateforumcount($fid);

			}

			}

		}
updatethreadcount($tid);
logmod($modlogdata, $lang->multi_unapprove_posts);

		}
updatethreadcount($tid);
logmod($modlogdata, $lang->multi_unapprove_posts);

Zeile 1497Zeile 1515
		{
$flist = "AND fid IN (0$flist)";
}

		{
$flist = "AND fid IN (0$flist)";
}

		if(!is_array($mybb->input['reports']))
{
error($lang->error_noselected_reports);
}
$rids = implode($mybb->input['reports'], "','");
$rids = addslashes("'0','$rids'");





        if(!is_array($mybb->input['reports']))
{
error($lang->error_noselected_reports);
}
foreach($mybb->input['reports'] as $rid)
{
$reports[] = intval($rid);
}
$rids = implode($reports, "','");
$rids = "'0','$rids'";





		$plugins->run_hooks("moderation_do_reports");

        $plugins->run_hooks("moderation_do_reports");

		
$db->query("UPDATE ".TABLE_PREFIX."reportedposts SET reportstatus='1' WHERE rid IN ($rids)");
$cache->updatereportedposts();

		
$db->query("UPDATE ".TABLE_PREFIX."reportedposts SET reportstatus='1' WHERE rid IN ($rids)");
$cache->updatereportedposts();