Vergleich moderation.php - 1.03 - 1.18

  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 963Zeile 972
		$threadlist = explode("|", $mybb->input['threads']);
foreach($threadlist as $tid)
{

		$threadlist = explode("|", $mybb->input['threads']);
foreach($threadlist as $tid)
{

 
			$tid = intval($tid);

			deletethread($tid);
$tlist[] = $tid;
}

			deletethread($tid);
$tlist[] = $tid;
}

Zeile 975Zeile 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 1142Zeile 1152
		$threadlist = explode("|", $mybb->input['threads']);
foreach($threadlist as $tid)
{

		$threadlist = explode("|", $mybb->input['threads']);
foreach($threadlist as $tid)
{

			$q .= " OR tid='$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();
}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."forums WHERE fid='$moveto'");

			nopermission();
}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."forums WHERE fid='$moveto'");

Zeile 1170Zeile 1180
		while($posters = $db->fetch_array($query))
{
if($method == "copy" && $newforum['usepostcounts'] != "no")

		while($posters = $db->fetch_array($query))
{
if($method == "copy" && $newforum['usepostcounts'] != "no")

			{
$pcount = "+$posters[posts]";
}

			{
$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 1194Zeile 1204
		if(ismod($fid, "candeleteposts") != "yes")
{
nopermission();

		if(ismod($fid, "candeleteposts") != "yes")
{
nopermission();

		}

		}

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

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

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

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

		clearinline($tid, "thread");

		clearinline($tid, "thread");


if(!is_array($posts))
{


if(!is_array($posts))
{

Zeile 1210Zeile 1220
		}
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)
{

 
			$pid = intval($pid);

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

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

Zeile 1250Zeile 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 1267Zeile 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)
{
$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 1286Zeile 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 1313Zeile 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 1329Zeile 1341
		}
foreach($posts as $pid)
{

		}
foreach($posts as $pid)
{

				$pidin .= "$comma'$pid'";
$comma = ",";


			$pid = intval($pid);
$pidin .= "$comma'$pid'";
$comma = ",";

		}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE pid NOT IN($pidin) AND tid='$tid'");
$num = $db->num_rows($query);

		}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE pid NOT IN($pidin) AND tid='$tid'");
$num = $db->num_rows($query);

Zeile 1347Zeile 1360

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


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

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

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

		$postlist = explode("|", $mybb->input['posts']);
foreach($postlist as $pid)
{

		$postlist = explode("|", $mybb->input['posts']);
foreach($postlist as $pid)
{

Zeile 1361Zeile 1374
		if($mybb->input['moveto'])
{
$moveto = intval($mybb->input['moveto']);

		if($mybb->input['moveto'])
{
$moveto = intval($mybb->input['moveto']);

		}

		}

		else
{
$moveto = $fid;

		else
{
$moveto = $fid;

Zeile 1394Zeile 1407
			}
$db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum$pcount WHERE uid='$posters[uid]'");
}

			}
$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 1493Zeile 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 = "'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();

Zeile 1560Zeile 1586
	{
if($id != "")
{

	{
if($id != "")
{

			$newids[] = $id;

			$newids[] = intval($id);

		}
}
return $newids;

		}
}
return $newids;