Vergleich inc/class_moderation.php - 1.6.6 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: class_moderation.php 5623 2011-10-01 02:46:09Z ralgith $

 * $Id$

 */

class Moderation

 */

class Moderation

Zeile 237Zeile 237
		$db->delete_query("polls", "tid='$tid'");
$db->delete_query("pollvotes", "pid='".$thread['poll']."'");
$db->delete_query("threadsread", "tid='$tid'");

		$db->delete_query("polls", "tid='$tid'");
$db->delete_query("pollvotes", "pid='".$thread['poll']."'");
$db->delete_query("threadsread", "tid='$tid'");

 
		$db->delete_query("threadratings", "tid='$tid'");


$updated_counters = array(
"posts" => "-{$num_approved_posts}",


$updated_counters = array(
"posts" => "-{$num_approved_posts}",

Zeile 545Zeile 546
		");
$num_unapproved_posts = $num_approved_posts = 0;
$message = '';

		");
$num_unapproved_posts = $num_approved_posts = 0;
$message = '';

 
		$threads = array();

		while($post = $db->fetch_array($query))
{

		while($post = $db->fetch_array($query))
{

 
			$threads[$post['tid']] = $post['tid'];

			if($first == 1)
{ // all posts will be merged into this one
$masterpid = $post['pid'];

			if($first == 1)
{ // all posts will be merged into this one
$masterpid = $post['pid'];

Zeile 605Zeile 608
				}
}
}

				}
}
}

		
$query2 = $db->simple_select("attachments", "COUNT(aid) as count", "pid IN({$pidin}) AND visible='1'");
$attachment_count = $db->fetch_field($query2, "count");

$db->update_query("threads", array("attachmentcount" => $attachment_count), "tid = '{$mastertid}'");

 

// Update the message
$mergepost = array(


// Update the message
$mergepost = array(

Zeile 629Zeile 627
		// If the first post of a thread is merged out, the thread should be deleted
$query = $db->simple_select("threads", "tid, fid, visible", "firstpost IN({$pidin}) AND firstpost != '{$masterpid}'");
while($thread = $db->fetch_array($query))

		// If the first post of a thread is merged out, the thread should be deleted
$query = $db->simple_select("threads", "tid, fid, visible", "firstpost IN({$pidin}) AND firstpost != '{$masterpid}'");
while($thread = $db->fetch_array($query))

		{

		{

			$this->delete_thread($thread['tid']);
// Subtract 1 thread from the forum's stats
if($thread['visible'])

			$this->delete_thread($thread['tid']);
// Subtract 1 thread from the forum's stats
if($thread['visible'])

Zeile 658Zeile 656
			foreach($thread_counters as $tid => $counters)
{
$db->update_query("threads", $counters, "tid='{$tid}'");

			foreach($thread_counters as $tid => $counters)
{
$db->update_query("threads", $counters, "tid='{$tid}'");





				update_thread_data($tid);

				update_thread_data($tid);

			}
}


			}
}


		update_thread_data($mastertid);

		update_thread_data($mastertid);

		

		

		update_forum_lastpost($fid);

		update_forum_lastpost($fid);

 
		
foreach($threads as $tid)
{
$count = array();
// Attachment count
$query = $db->query("
SELECT COUNT(aid) AS attachment_count
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
WHERE p.tid='$tid'
");
$count['attachmentcount'] = $db->fetch_field($query, "attachment_count");

if(!$count['attachmentcount'])
{
$count['attachmentcount'] = 0;
}

update_thread_counters($tid, $count);
}


if(is_array($forum_counters))
{


if(is_array($forum_counters))
{

Zeile 804Zeile 822
				if($thread['visible'] == 1)
{
++$num_threads;

				if($thread['visible'] == 1)
{
++$num_threads;

					$num_posts = $thread['replies']+1;

					$num_posts = $thread['replies']+1;


// Fetch count of unapproved posts in this thread
$query = $db->simple_select("posts", "COUNT(pid) AS unapproved", "tid='{$thread['tid']}' AND visible=0");


// Fetch count of unapproved posts in this thread
$query = $db->simple_select("posts", "COUNT(pid) AS unapproved", "tid='{$thread['tid']}' AND visible=0");

Zeile 900Zeile 918
					{
$attachment_array = array(
'pid' => $pid,

					{
$attachment_array = array(
'pid' => $pid,

							'posthash' => $db->escape_string($attachment['posthash']),

 
							'uid' => $attachment['uid'],
'filename' => $db->escape_string($attachment['filename']),
'filetype' => $attachment['filetype'],

							'uid' => $attachment['uid'],
'filename' => $db->escape_string($attachment['filename']),
'filetype' => $attachment['filetype'],

Zeile 1195Zeile 1212
			{
$updated_stats = array(
"unapprovedposts" => '-'.($mergethread['replies']+1+$mergethread['unapprovedposts'])

			{
$updated_stats = array(
"unapprovedposts" => '-'.($mergethread['replies']+1+$mergethread['unapprovedposts'])

				);
}
else

				);
}
else

			{
$updated_stats = array(
"posts" => '-'.($mergethread['replies']+1),

			{
$updated_stats = array(
"posts" => '-'.($mergethread['replies']+1),

Zeile 1318Zeile 1335
			"replyto" => 0
);
$db->update_query("posts", $sqlarray, "pid IN ($pids_list)");

			"replyto" => 0
);
$db->update_query("posts", $sqlarray, "pid IN ($pids_list)");

 
		$db->update_query("reportedposts", array('tid' => $newtid), "pid IN ($pids_list)");


// Get posts being merged
while($post = $db->fetch_array($original_posts_query))


// Get posts being merged
while($post = $db->fetch_array($original_posts_query))

Zeile 1393Zeile 1411
					{
$forum_counters[$post['fid']]['unapprovedposts'] = $forum_cache[$post['fid']]['unapprovedposts'];
}

					{
$forum_counters[$post['fid']]['unapprovedposts'] = $forum_cache[$post['fid']]['unapprovedposts'];
}

					--$forum_counters[$post['fid']]['posts'];

					--$forum_counters[$post['fid']]['unapprovedposts'];

					// Add 1 to the new forum's unapproved posts
if(!isset($forum_counters[$moveto]['unapprovedposts']))
{

					// Add 1 to the new forum's unapproved posts
if(!isset($forum_counters[$moveto]['unapprovedposts']))
{

Zeile 1513Zeile 1531
		$newforum = get_forum($moveto);

$total_posts = $total_unapproved_posts = $total_threads = $total_unapproved_threads = 0;

		$newforum = get_forum($moveto);

$total_posts = $total_unapproved_posts = $total_threads = $total_unapproved_threads = 0;

		$query = $db->simple_select("threads", "fid, visible, replies, unapprovedposts, tid", "tid IN ($tid_list)");

		$query = $db->simple_select("threads", "fid, visible, replies, unapprovedposts, tid", "tid IN ($tid_list) AND closed NOT LIKE 'moved|%'");

		while($thread = $db->fetch_array($query))
{
$forum = get_forum($thread['fid']);

		while($thread = $db->fetch_array($query))
{
$forum = get_forum($thread['fid']);

Zeile 1541Zeile 1559
				FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.tid = '{$thread['tid']}'

				FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.tid = '{$thread['tid']}'

				GROUP BY u.uid

				GROUP BY p.visible, u.uid

				ORDER BY posts DESC
");
while($posters = $db->fetch_array($query1))

				ORDER BY posts DESC
");
while($posters = $db->fetch_array($query1))

Zeile 1889Zeile 1907
			$new_subject = array(
"subject" => $db->escape_string($subject)
);

			$new_subject = array(
"subject" => $db->escape_string($subject)
);

			$db->update_query("threads", $new_subject, "tid='{$thread['tid']}'", 1);
$db->update_query("posts", $new_subject, "tid='{$thread['tid']}' AND replyto='0'", 1);

			$db->update_query("threads", $new_subject, "tid='{$thread['tid']}'");
$db->update_query("posts", $new_subject, "tid='{$thread['tid']}' AND replyto='0'");

		}

$arguments = array("tids" => $tids, "format" => $format);

		}

$arguments = array("tids" => $tids, "format" => $format);

Zeile 2131Zeile 2149
		$tids = array_map('intval', $tids);
$tids_csv = implode(',', $tids);


		$tids = array_map('intval', $tids);
$tids_csv = implode(',', $tids);


		$update_thread = array('prefix' => $prefix);

		$update_thread = array('prefix' => intval($prefix));

		$db->update_query('threads', $update_thread, "tid IN ({$tids_csv})");

$arguments = array('tids' => $tids, 'prefix' => $prefix);

		$db->update_query('threads', $update_thread, "tid IN ({$tids_csv})");

$arguments = array('tids' => $tids, 'prefix' => $prefix);