Vergleich moderation.php - 1.00 - 1.16

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

 * $Id$

 * $Id: moderation.php 920 2005-12-05 03:28:01Z chris $

 */

define("KILL_GLOBALS", 1);

 */

define("KILL_GLOBALS", 1);

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

		update_first_post($newtid);
update_first_post($tid);
logmod($modlogdata, $lang->thread_split);

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

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

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

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

		$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_invalidforum);
}
if($thread['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"))
{

			}
if($method != "copy" && ($newforum['usepostcounts'] != "no" && $forum['usepostcounts'] == "no"))
{

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

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

		}

		}

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

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

		if(!is_array($posts))

		if(!is_array($posts))

		{
error($lang->error_inline_nopostsselected);
}
$inlineids = implode("|", $posts);
//clearinline($pid, "post");

		{
error($lang->error_inline_nopostsselected);
}
$inlineids = implode("|", $posts);
//clearinline($pid, "post");

		clearinline($tid, "thread");

if(!is_array($posts))

		clearinline($tid, "thread");

if(!is_array($posts))

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

		{
error($lang->error_inline_nopostsselected);
}
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");

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

Zeile 1321Zeile 1333
		if($numposts <= "1")
{
error($lang->error_cantsplitonepost);

		if($numposts <= "1")
{
error($lang->error_cantsplitonepost);

		}

		}

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

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

		{

		{

			error($lang->error_inline_nopostsselected);
}
foreach($posts as $pid)

			error($lang->error_inline_nopostsselected);
}
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")
{

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

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

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

Zeile 1385Zeile 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]";
}
if($oldusepcounts == "no" && $newusepcounts == "yes")

				$pcount = "-$posters[posts]";
}
if($oldusepcounts == "no" && $newusepcounts == "yes")

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 1408Zeile 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)
{

		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

			$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");
while($post = $db->fetch_array($query))
{
if($post['replyto'] == 0)
{

		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE $q");
while($post = $db->fetch_array($query))
{
if($post['replyto'] == 0)
{

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

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

Zeile 1455Zeile 1477
		foreach($posts as $pid)
{
$q .= " OR pid='$pid'";

		foreach($posts as $pid)
{
$q .= " OR pid='$pid'";

		}

		}

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

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

Zeile 1482Zeile 1504
		}
$flist = "";
if($mybb->usergroup['issupermod'] != "yes")

		}
$flist = "";
if($mybb->usergroup['issupermod'] != "yes")

		{

		{

			$query = $db->query("SELECT * FROM ".TABLE_PREFIX."moderators WHERE uid='".$mybb->user[uid]."'");
while($forum = $db->fetch_array($query))
{
$flist .= ",'".$forum['fid']."'";
}

			$query = $db->query("SELECT * FROM ".TABLE_PREFIX."moderators WHERE uid='".$mybb->user[uid]."'");
while($forum = $db->fetch_array($query))
{
$flist .= ",'".$forum['fid']."'";
}

		}

		}

		if($flist)

		if($flist)

		{

		{

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