Vergleich inc/class_moderation.php - 1.6.0 - 1.6.4

  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 5145 2010-07-30 21:30:51Z RyanGordon $

 * $Id: class_moderation.php 5523 2011-07-28 10:59:29Z Tomm $

 */

class Moderation

 */

class Moderation

Zeile 1088Zeile 1088
			"tid" => $tid,
"fid" => $thread['fid'],
"replyto" => 0,

			"tid" => $tid,
"fid" => $thread['fid'],
"replyto" => 0,

			"visible" => $mergethread['visible'],

 
		);
$db->update_query("posts", $sqlarray, "tid='{$mergetid}'");


		);
$db->update_query("posts", $sqlarray, "tid='{$mergetid}'");


Zeile 1101Zeile 1100
		$sqlarray = array(
"tid" => $tid,
);

		$sqlarray = array(
"tid" => $tid,
);

		$db->update_query("threadsubscriptions", $sqlarray, "tid='{$mergetid}'");
update_first_post($tid);




















































// Update the thread ratings
$new_numrating = $thread['numratings'] + $mergethread['numratings'];
$new_threadrating = $thread['totalratings'] + $mergethread['totalratings'];

$sqlarray = array(
"numratings" => $new_numrating,
"totalratings" => $new_threadrating
);

$db->update_query("threads", $sqlarray, "tid = '{$tid}'");

// Check if we have a thread subscription already for our new thread
$subscriptions = array(
$tid => array(),
$mergetid => array()
);

$query = $db->simple_select("threadsubscriptions", "tid, uid", "tid='{$mergetid}' OR tid='{$tid}'");
while($subscription = $db->fetch_array($query))
{
$subscriptions[$subscription['tid']][] = $subscription['uid'];
}

// Update any subscriptions for the merged thread
if(is_array($subscriptions[$mergetid]))
{
$update_users = array();
foreach($subscriptions[$mergetid] as $user)
{
if(!in_array($user, $subscriptions[$tid]))
{
// User doesn't have a $tid subscription
$update_users[] = $user;
}
}

if(!empty($update_users))
{
$update_array = array(
"tid" => $tid
);

$update_users = implode(",", $update_users);
$db->update_query("threadsubscriptions", $update_array, "tid = '{$mergetid}' AND uid IN ({$update_users})");
}
}

// Remove source thread subscriptions
$db->delete_query("threadsubscriptions", "tid = '{$mergetid}'");

update_first_post($tid);


$arguments = array("mergetid" => $mergetid, "tid" => $tid, "subject" => $subject);
$plugins->run_hooks("class_moderation_merge_threads", $arguments);


$arguments = array("mergetid" => $mergetid, "tid" => $tid, "subject" => $subject);
$plugins->run_hooks("class_moderation_merge_threads", $arguments);

Zeile 1117Zeile 1166
		{
$db->update_query("posts", array('visible' => $thread['visible']), "pid='{$new_firstpost['pid']}'");
$mergethread['visible'] = $thread['visible'];

		{
$db->update_query("posts", array('visible' => $thread['visible']), "pid='{$new_firstpost['pid']}'");
$mergethread['visible'] = $thread['visible'];

		}


		}


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

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

Zeile 1131Zeile 1180
		{
// If new thread is unapproved, implied counter comes in to effect
if($thread['visible'] == 0 || $mergethread['visible'] == 0)

		{
// If new thread is unapproved, implied counter comes in to effect
if($thread['visible'] == 0 || $mergethread['visible'] == 0)

			{
$updated_stats = array(

			{
$updated_stats = array(

					"unapprovedposts" => '+'.($mergethread['replies']+1+$mergethread['unapprovedposts'])

					"unapprovedposts" => '+'.($mergethread['replies']+1+$mergethread['unapprovedposts'])

				);

				);

			}
else
{

			}
else
{

Zeile 1147Zeile 1196
			
// If old thread is unapproved, implied counter comes in to effect
if($mergethread['visible'] == 0)

			
// If old thread is unapproved, implied counter comes in to effect
if($mergethread['visible'] == 0)

			{

			{

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

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

Zeile 1192Zeile 1241
		// Get forum infos
$query = $db->simple_select("forums", "fid, usepostcounts, posts, threads, unapprovedposts, unapprovedthreads");
while($forum = $db->fetch_array($query))

		// Get forum infos
$query = $db->simple_select("forums", "fid, usepostcounts, posts, threads, unapprovedposts, unapprovedthreads");
while($forum = $db->fetch_array($query))

		{

		{

			$forum_cache[$forum['fid']] = $forum;
}

			$forum_cache[$forum['fid']] = $forum;
}





		// Make sure we only have valid values
$pids = array_map('intval', $pids);

		// Make sure we only have valid values
$pids = array_map('intval', $pids);





		$pids_list = implode(',', $pids);

		$pids_list = implode(',', $pids);





		// Get the icon for the first split post

		// Get the icon for the first split post

		$query = $db->simple_select("posts", "icon", "pid=".intval($pids[0]));
$icon = $db->fetch_array($query);




		$query = $db->simple_select("posts", "icon, visible", "pid=".intval($pids[0]));
$post_info = $db->fetch_array($query);

$icon = $post_info['icon'];
$visible = $post_info['visible'];


if($destination_tid == 0)
{


if($destination_tid == 0)
{

Zeile 1214Zeile 1266
			$query = array(
"fid" => $moveto,
"subject" => $newsubject,

			$query = array(
"fid" => $moveto,
"subject" => $newsubject,

				"icon" => intval($icon['icon']),

				"icon" => intval($icon),

				"uid" => intval($thread['uid']),
"username" => $db->escape_string($thread['username']),
"dateline" => intval($thread['dateline']),
"lastpost" => intval($thread['lastpost']),
"lastposter" => $db->escape_string($thread['lastposter']),
"replies" => count($pids)-1,

				"uid" => intval($thread['uid']),
"username" => $db->escape_string($thread['username']),
"dateline" => intval($thread['dateline']),
"lastpost" => intval($thread['lastpost']),
"lastposter" => $db->escape_string($thread['lastposter']),
"replies" => count($pids)-1,

				"visible" => 1,

				"visible" => $visible,

				"notes" => ''
);
$newtid = $db->insert_query("threads", $query);

$forum_counters[$moveto]['threads'] = $forum_cache[$moveto]['threads'];

				"notes" => ''
);
$newtid = $db->insert_query("threads", $query);

$forum_counters[$moveto]['threads'] = $forum_cache[$moveto]['threads'];

			++$forum_counters[$moveto]['threads'];










			$forum_counters[$moveto]['unapprovedthreads'] = $forum_cache[$moveto]['unapprovedthreads'];
if($visible)
{
++$forum_counters[$moveto]['threads'];
}
else
{
// Unapproved thread?
++$forum_counters[$moveto]['unapprovedthreads'];
}

		}

// Get attachment counts for each post

		}

// Get attachment counts for each post

Zeile 1480Zeile 1541
			}

$query1 = $db->query("

			}

$query1 = $db->query("

				SELECT COUNT(p.pid) AS posts, u.uid

				SELECT COUNT(p.pid) AS posts, p.visible, u.uid

				FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

				FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)

				WHERE tid='{$thread['tid']}'

				WHERE p.tid = '{$thread['tid']}'

				GROUP BY u.uid
ORDER BY posts DESC
");

				GROUP BY u.uid
ORDER BY posts DESC
");

Zeile 1516Zeile 1577
		$query = $db->simple_select("threads", "tid, prefix", "tid IN ($tid_list) AND prefix != 0");
while($thread = $db->fetch_array($query))
{

		$query = $db->simple_select("threads", "tid, prefix", "tid IN ($tid_list) AND prefix != 0");
while($thread = $db->fetch_array($query))
{

			$query = $db->simple_select("threadprefixes", "COUNT(*) as num_prefixes", "(CONCAT(',',forums,',') LIKE '%,$new_fid,%' OR forums='-1') AND pid='".$thread['prefix']."'");

			$query = $db->simple_select("threadprefixes", "COUNT(*) as num_prefixes", "(CONCAT(',',forums,',') LIKE '%,$moveto,%' OR forums='-1') AND pid='".$thread['prefix']."'");

			if($db->fetch_field($query, "num_prefixes") == 0)
{
$sqlarray = array(

			if($db->fetch_field($query, "num_prefixes") == 0)
{
$sqlarray = array(