Vergleich inc/class_moderation.php - 1.6.1 - 1.6.6

  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 5623 2011-10-01 02:46:09Z ralgith $

 */

class Moderation

 */

class Moderation

Zeile 453Zeile 453
	{
global $db, $cache, $plugins;


	{
global $db, $cache, $plugins;


		$plugins->run_hooks_by_ref("class_moderation_delete_post_start", $pid);

		$pid = $plugins->run_hooks("class_moderation_delete_post_start", $pid);

		// Get pid, uid, fid, tid, visibility, forum post count status of post
$pid = intval($pid);
$query = $db->query("

		// Get pid, uid, fid, tid, visibility, forum post count status of post
$pid = intval($pid);
$query = $db->query("

Zeile 605Zeile 605
				}
}
}

				}
}
}


// Get lastpost pid to check if we're merging a post that is on the lastpost info
$query = $db->simple_select("posts", "pid", "tid = '{$post['tid']}'", array('order_by' => 'dateline', 'order_dir' => 'desc', 'limit' => '1'));
$lastpostpid = $db->fetch_field($query, 'pid');

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

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

Zeile 765Zeile 761
					"replies" => 0,
"closed" => "moved|$tid",
"sticky" => $thread['sticky'],

					"replies" => 0,
"closed" => "moved|$tid",
"sticky" => $thread['sticky'],

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

					"visible" => intval($thread['visible']),

					"notes" => ''
);
$redirect_tid = $db->insert_query("threads", $threadarray);
if($redirect_expire)
{
$this->expire_thread($redirect_tid, $redirect_expire);

					"notes" => ''
);
$redirect_tid = $db->insert_query("threads", $threadarray);
if($redirect_expire)
{
$this->expire_thread($redirect_tid, $redirect_expire);

				}

// If we're moving back to a forum where we left a redirect, delete the rediect

				}

// If we're moving back to a forum where we left a redirect, delete the rediect

				$query = $db->simple_select("threads", "tid", "closed LIKE 'moved|".intval($tid)."' AND fid='".intval($new_fid)."'");
while($movedthread = $db->fetch_array($query))
{

				$query = $db->simple_select("threads", "tid", "closed LIKE 'moved|".intval($tid)."' AND fid='".intval($new_fid)."'");
while($movedthread = $db->fetch_array($query))
{

Zeile 798Zeile 794
					"replies" => $thread['replies'],
"closed" => $thread['closed'],
"sticky" => $thread['sticky'],

					"replies" => $thread['replies'],
"closed" => $thread['closed'],
"sticky" => $thread['sticky'],

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

					"visible" => intval($thread['visible']),

					"unapprovedposts" => $thread['unapprovedposts'],
"attachmentcount" => $thread['attachmentcount'],
"prefix" => $thread['prefix'],

					"unapprovedposts" => $thread['unapprovedposts'],
"attachmentcount" => $thread['attachmentcount'],
"prefix" => $thread['prefix'],

Zeile 858Zeile 854

$query = $db->simple_select("pollvotes", "*", "pid = '{$poll['pid']}'");
while($pollvote = $db->fetch_array($query))


$query = $db->simple_select("pollvotes", "*", "pid = '{$poll['pid']}'");
while($pollvote = $db->fetch_array($query))

					{

					{

						$pollvote_array = array(
'pid' => $new_pid,
'uid' => $pollvote['uid'],

						$pollvote_array = array(
'pid' => $new_pid,
'uid' => $pollvote['uid'],

Zeile 869Zeile 865
					}

$db->update_query("threads", array('poll' => $new_pid), "tid='{$newtid}'");

					}

$db->update_query("threads", array('poll' => $new_pid), "tid='{$newtid}'");

				}

				}


$query = $db->simple_select("posts", "*", "tid = '{$thread['tid']}'");
while($post = $db->fetch_array($query))


$query = $db->simple_select("posts", "*", "tid = '{$thread['tid']}'");
while($post = $db->fetch_array($query))

Zeile 940Zeile 936
					$num_posts = $thread['replies']+1;
}
else

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

				{

				{

					$num_unapproved_threads++;
// Implied forum unapproved count for unapproved threads
$num_unapproved_posts = $thread['replies']+1;

					$num_unapproved_threads++;
// Implied forum unapproved count for unapproved threads
$num_unapproved_posts = $thread['replies']+1;

Zeile 1251Zeile 1247
		$pids_list = implode(',', $pids);

// Get the icon for the first split post

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

// 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 1263Zeile 1262
			$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" => intval($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 1529Zeile 1537
			}

$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 1565Zeile 1573
		$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(