Vergleich inc/class_moderation.php - 1.6.0 - 1.6.3

  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 5380 2011-02-21 12:04:43Z 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 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);

		update_first_post($tid);

$arguments = array("mergetid" => $mergetid, "tid" => $tid, "subject" => $subject);