Vergleich admin/moderate.php - 1.2.0 - 1.2.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

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

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

 *

 *

 * $Id: moderate.php 2154 2006-08-27 16:52:47Z Tikitiki $

 * $Id: moderate.php 3399 2007-10-22 06:07:30Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 71Zeile 71
			$db->update_query(TABLE_PREFIX."attachments", $sql_array, "aid IN ({$aids})");
}
}

			$db->update_query(TABLE_PREFIX."attachments", $sql_array, "aid IN ({$aids})");
}
}

	cpmessage($lang->attachments_moderated);

	cpredirect("moderate.php?".SID."&action=attachments", $lang->attachments_moderated);

}

if($mybb->input['action'] == "do_threads" || $mybb->input['action'] == "do_posts" || $mybb->input['action'] == "do_threadsposts")
{

}

if($mybb->input['action'] == "do_threads" || $mybb->input['action'] == "do_posts" || $mybb->input['action'] == "do_threadsposts")
{

 
	$forum_cache = $cache->read("forums");


	$plugins->run_hooks("admin_moderate_do_threadsposts");
if(is_array($mybb->input['threadvalidate']) && $mybb->input['action'] != "do_posts")
{
foreach($mybb->input['threadvalidate'] as $tid => $val)
{
$tid = intval($tid);

	$plugins->run_hooks("admin_moderate_do_threadsposts");
if(is_array($mybb->input['threadvalidate']) && $mybb->input['action'] != "do_posts")
{
foreach($mybb->input['threadvalidate'] as $tid => $val)
{
$tid = intval($tid);

			$query = $db->simple_select(TABLE_PREFIX."threads", "subject, fid", "tid='$tid'");

			$query = $db->simple_select(TABLE_PREFIX."threads", "subject, fid, dateline, uid", "tid='$tid'");

			$thread = $db->fetch_array($query);
if($mybb->input['threaddelete'][$tid] == "yes")
{
delete_thread($tid);

			$thread = $db->fetch_array($query);
if($mybb->input['threaddelete'][$tid] == "yes")
{
delete_thread($tid);

				$update_forum_count[$thread['fid']] = 1;

 
			}
else
{

			}
else
{

Zeile 97Zeile 98
					$message = $db->escape_string($mybb->input['threadmessage'][$tid]);

$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='1', subject='{$subject}', unapprovedposts=unapprovedposts-1 WHERE tid = '".$tid."'");

					$message = $db->escape_string($mybb->input['threadmessage'][$tid]);

$db->query("UPDATE ".TABLE_PREFIX."threads SET visible='1', subject='{$subject}', unapprovedposts=unapprovedposts-1 WHERE tid = '".$tid."'");

 

$forum = $forum_cache[$thread['fid']];
if($forum['usepostcounts'] != "no")
{
$queryadd = ",postnum=postnum+1";
}
else
{
$queryadd = '';
}
$db->query("UPDATE ".TABLE_PREFIX."users SET lastpost='{$thread['dateline']}' {$queryadd} WHERE uid='{$thread['uid']}'");
$done_firstposts[$thread['firstpost']] = 1;


					
$sql_array = array(
"message" => $message,

					
$sql_array = array(
"message" => $message,

Zeile 104Zeile 118
						"visible" => 1
);
$db->update_query(TABLE_PREFIX."posts", $sql_array, "tid = '".$tid."'");

						"visible" => 1
);
$db->update_query(TABLE_PREFIX."posts", $sql_array, "tid = '".$tid."'");

					$update_forum_count[$thread['fid']] = 1;

 

// Update unapproved thread count


// Update unapproved thread count

					$db->query("UPDATE ".TABLE_PREFIX."forums SET unapprovedthreads=unapprovedthreads-1,unapprovedposts=unapprovedposts-1 WHERE fid='{$thread['fid']}'");

					$db->query("UPDATE ".TABLE_PREFIX."forums SET unapprovedthreads=unapprovedthreads-1,unapprovedposts=unapprovedposts-1,threads=threads+1, posts=posts+1 WHERE fid='{$thread['fid']}'");

				}
}
}

				}
}
}

Zeile 118Zeile 131
		foreach($mybb->input['postvalidate'] as $pid => $val)
{
$pid = intval($pid);

		foreach($mybb->input['postvalidate'] as $pid => $val)
{
$pid = intval($pid);

			$query = $db->simple_select(TABLE_PREFIX."posts", "tid", "pid='$pid'");

			$query = $db->simple_select(TABLE_PREFIX."posts", "tid, uid, dateline", "pid='$pid'");

			$post = $db->fetch_array($query);
$query = $db->simple_select(TABLE_PREFIX."threads", "fid", "tid='$post[tid]'");
$thread = $db->fetch_array($query);
if($mybb->input['postdelete'][$pid] == "yes")
{
delete_post($pid);

			$post = $db->fetch_array($query);
$query = $db->simple_select(TABLE_PREFIX."threads", "fid", "tid='$post[tid]'");
$thread = $db->fetch_array($query);
if($mybb->input['postdelete'][$pid] == "yes")
{
delete_post($pid);

				$update_thread_count[$post['tid']] = 1;
$update_forum_count[$thread['fid']] = 1;

 
			}
else
{

			}
else
{

Zeile 141Zeile 152
						"subject" => $subject
);
$db->update_query(TABLE_PREFIX."posts", $sql_array, "pid = '".$pid."'");

						"subject" => $subject
);
$db->update_query(TABLE_PREFIX."posts", $sql_array, "pid = '".$pid."'");

					$update_thread_count[$post['tid']] = 1;
$update_forum_count[$thread['fid']] = 1;
















$forum = $forum_cache[$thread['fid']];
if(!$done_firstposts[$post['pid']])
{
if($forum['usepostcounts'] != "no")
{
$queryadd = ",postnum=postnum+1";
}
else
{
$queryadd = '';
}
$db->query("UPDATE ".TABLE_PREFIX."users SET lastpost='{$post['dateline']}' {$queryadd} WHERE uid='{$post['uid']}'");
}


// Update unapproved thread count


// Update unapproved thread count

					$db->query("UPDATE ".TABLE_PREFIX."threads SET unapprovedposts=unapprovedposts-1 WHERE tid='$post[tid]'");


					$db->query("UPDATE ".TABLE_PREFIX."threads SET unapprovedposts=unapprovedposts-1, replies=replies+1 WHERE tid='$post[tid]'");					
$db->query("UPDATE ".TABLE_PREFIX."forums SET posts=posts+1 WHERE fid='$post[fid]'");

				}
}
}
}

				}
}
}
}

	if(is_array($update_thread_count)) 
{
foreach($update_thread_count as $tid => $val)
{
update_thread_count($tid);
}
}
if(is_array($update_forum_count))
{
foreach($update_forum_count as $fid => $val)
{
update_forum_count($fid);
}
}
cpmessage($lang->threadsposts_moderated);

	cpredirect("moderate.php?".SID."&action=".str_replace('do_', '', $mybb->input['action']), $lang->threadsposts_moderated);















}
if($mybb->input['action'] == "attachments")
{

}
if($mybb->input['action'] == "attachments")
{

Zeile 229Zeile 240
	$done = 0;

$query = $db->query("

	$done = 0;

$query = $db->query("

		SELECT t.tid, t.fid, t.subject, p.message AS postmessage, p.pid AS postpid, f.name AS forumname, u.username AS username
FROM (".TABLE_PREFIX."threads t, ".TABLE_PREFIX."posts p)


		SELECT t.tid, t.fid, t.subject, p.message AS postmessage, p.pid AS postpid, f.name AS forumname, u.username AS username, u.uid
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.tid=t.tid)

		LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

		LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

		WHERE t.visible='0' AND p.tid=t.tid

		WHERE t.visible='0'

		ORDER BY t.lastpost DESC
");
$tcount = $db->num_rows($query);

		ORDER BY t.lastpost DESC
");
$tcount = $db->num_rows($query);

Zeile 284Zeile 296
		"order_dir" => "DESC"
);
$query = $db->query("

		"order_dir" => "DESC"
);
$query = $db->query("

		SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, f.name AS forumname, u.username AS username

		SELECT p.pid, p.subject, p.message, t.subject AS threadsubject, t.tid, f.name AS forumname, u.username AS username, u.uid

		FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)

		FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)

Zeile 295Zeile 307
	$count = $db->num_rows($query);
if(!$tcount && !$count && $mybb->input['action'] == "threadsposts")
{

	$count = $db->num_rows($query);
if(!$tcount && !$count && $mybb->input['action'] == "threadsposts")
{

	  endform();

	  	endform();

		cpmessage($lang->no_threadsposts);
}


		cpmessage($lang->no_threadsposts);
}


Zeile 319Zeile 331
	while($post = $db->fetch_array($query))
{
if(!$donepid[$post['pid']])

	while($post = $db->fetch_array($query))
{
if(!$donepid[$post['pid']])

		{ // so we dont show new threads main post again


		{ 
// so we dont show new threads main post again

			$done = 1;
$thread['subject'] = htmlspecialchars_uni(stripslashes($thread['subject']));
makeinputcode($lang->post_subject, "postsubject[$post[pid]]", "$post[subject]");

			$done = 1;
$thread['subject'] = htmlspecialchars_uni(stripslashes($thread['subject']));
makeinputcode($lang->post_subject, "postsubject[$post[pid]]", "$post[subject]");

Zeile 330Zeile 343
			makeyesnocode($lang->validate_post, "postvalidate[$post[pid]]");
makeyesnocode($lang->delete_post, "postdelete[$post[pid]]", "no");
echo "<tr>\n<td class=\"subheader\" align=\"center\" colspan=\"2\" height=\"2\"><img src=\"pixel.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\n</tr>\n";

			makeyesnocode($lang->validate_post, "postvalidate[$post[pid]]");
makeyesnocode($lang->delete_post, "postdelete[$post[pid]]", "no");
echo "<tr>\n<td class=\"subheader\" align=\"center\" colspan=\"2\" height=\"2\"><img src=\"pixel.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\n</tr>\n";

		  ++$postscount;
}

		  	++$postscount;
}

	}
if($postscount < 1)
{

	}
if($postscount < 1)
{

    echo "<tr>\n";

    	echo "<tr>\n";

		echo "<td class=\"$bgcolor\" colspan=\"1\">".$lang->no_posts."</td>\n";
echo "</tr>\n";

		echo "<td class=\"$bgcolor\" colspan=\"1\">".$lang->no_posts."</td>\n";
echo "</tr>\n";

  }

  	}

	if($count >= 1)
{
endtable();

	if($count >= 1)
{
endtable();