Vergleich inc/class_moderation.php - 1.8.7 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 323Zeile 323
		// Update forum count
update_forum_counters($thread['fid'], $updated_counters);
update_forum_lastpost($thread['fid']);

		// Update forum count
update_forum_counters($thread['fid'], $updated_counters);
update_forum_lastpost($thread['fid']);

 
		mark_reports($tid, 'thread');


$plugins->run_hooks("class_moderation_delete_thread", $tid);



$plugins->run_hooks("class_moderation_delete_thread", $tid);


Zeile 754Zeile 755
	 * @param int $tid Thread ID (Set to 0 if posts from multiple threads are selected)
* @return int ID of the post into which all other posts are merged
*/

	 * @param int $tid Thread ID (Set to 0 if posts from multiple threads are selected)
* @return int ID of the post into which all other posts are merged
*/

	function merge_posts($pids, $tid=0, $sep="new_line")

	function merge_posts($pids=array(), $tid=0, $sep="new_line")

	{
global $db, $plugins;


	{
global $db, $plugins;


Zeile 801Zeile 802
				$fid = $post['fid'];
$mastertid = $post['tid'];
$first = 0;

				$fid = $post['fid'];
$mastertid = $post['tid'];
$first = 0;

 
				$visible = $post['visible'];

			}
else
{

			}
else
{

Zeile 844Zeile 846
					{
--$user_counters[$post['uid']]['num_threads'];
}

					{
--$user_counters[$post['uid']]['num_threads'];
}

 
					$thread_counters[$post['tid']]['attachmentcount'] -= $post['attachmentcount'];

				}
elseif($post['visible'] == 0)
{

				}
elseif($post['visible'] == 0)
{

Zeile 855Zeile 858
					// Subtract 1 deleted post from post's thread
--$thread_counters[$post['tid']]['deletedposts'];
}

					// Subtract 1 deleted post from post's thread
--$thread_counters[$post['tid']]['deletedposts'];
}

				$thread_counters[$post['tid']]['attachmentcount'] -= $post['attachmentcount'];

 

// Subtract 1 post from post's forum
if($post['threadvisible'] == 1 && $post['visible'] == 1)


// Subtract 1 post from post's forum
if($post['threadvisible'] == 1 && $post['visible'] == 1)

Zeile 869Zeile 871
				else
{
--$forum_counters[$post['fid']]['deletedposts'];

				else
{
--$forum_counters[$post['fid']]['deletedposts'];

 
				}

// Add attachment count to thread
if($visible == 1)
{
$thread_counters[$mastertid]['attachmentcount'] += $post['attachmentcount'];

				}
}
}

				}
}
}

Zeile 936Zeile 944
					);
}
++$user_counters[$new_firstpost['uid']]['num_threads'];

					);
}
++$user_counters[$new_firstpost['uid']]['num_threads'];

			}

			}

			update_first_post($thread['tid']);
}


			update_first_post($thread['tid']);
}


Zeile 1044Zeile 1052
				$plugins->run_hooks("class_moderation_move_thread_redirect", $arguments);

$query = $db->simple_select('threads', 'tid', "closed='moved|$tid' AND fid='$new_fid'");

				$plugins->run_hooks("class_moderation_move_thread_redirect", $arguments);

$query = $db->simple_select('threads', 'tid', "closed='moved|$tid' AND fid='$new_fid'");

				while($redirect_tid = $db->fetch_field($query, 'tid'))
{
$this->delete_thread($redirect_tid);

				while($redirect_tid = $db->fetch_field($query, 'tid'))
{
$this->delete_thread($redirect_tid);

				}
$changefid = array(
"fid" => $new_fid,

				}
$changefid = array(
"fid" => $new_fid,

Zeile 1163Zeile 1171
						'question' => $db->escape_string($poll['question']),
'dateline' => $poll['dateline'],
'options' => $db->escape_string($poll['options']),

						'question' => $db->escape_string($poll['question']),
'dateline' => $poll['dateline'],
'options' => $db->escape_string($poll['options']),

						'votes' => $poll['votes'],

						'votes' => $db->escape_string($poll['votes']),

						'numoptions' => $poll['numoptions'],
'numvotes' => $poll['numvotes'],
'timeout' => $poll['timeout'],

						'numoptions' => $poll['numoptions'],
'numvotes' => $poll['numvotes'],
'timeout' => $poll['timeout'],

Zeile 1559Zeile 1567
		if($new_firstpost['pid'] != $thread['firstpost'])
{
update_first_post($thread['tid']);

		if($new_firstpost['pid'] != $thread['firstpost'])
{
update_first_post($thread['tid']);

		}

// Subtract merged thread from user counter
if($mergethread['visible'] == 1 && $forum_cache[$mergethread['fid']]['usethreadcounts'] == 1)
{
if(!isset($user_posts[$mergethread['uid']]['threadnum']))
{
$user_posts[$mergethread['uid']]['threadnum'] = 0;
}
--$user_posts[$mergethread['uid']]['threadnum'];

 
		}

// Update thread count if thread has a new firstpost and is visible
if($thread['uid'] != $new_firstpost['uid'] && $thread['visible'] == 1 && $forum_cache[$thread['fid']]['usethreadcounts'] == 1)
{
if(!isset($user_posts[$thread['uid']]['threadnum']))

		}

// Update thread count if thread has a new firstpost and is visible
if($thread['uid'] != $new_firstpost['uid'] && $thread['visible'] == 1 && $forum_cache[$thread['fid']]['usethreadcounts'] == 1)
{
if(!isset($user_posts[$thread['uid']]['threadnum']))

			{

			{

				$user_posts[$thread['uid']]['threadnum'] = 0;
}
--$user_posts[$thread['uid']]['threadnum'];
if(!isset($user_posts[$new_firstpost['uid']]['threadnum']))

				$user_posts[$thread['uid']]['threadnum'] = 0;
}
--$user_posts[$thread['uid']]['threadnum'];
if(!isset($user_posts[$new_firstpost['uid']]['threadnum']))

			{

			{

				$user_posts[$new_firstpost['uid']]['threadnum'] = 0;
}
++$user_posts[$new_firstpost['uid']]['threadnum'];

				$user_posts[$new_firstpost['uid']]['threadnum'] = 0;
}
++$user_posts[$new_firstpost['uid']]['threadnum'];

Zeile 1751Zeile 1749
			"replies" => "+{$mergethread['replies']}",
"attachmentcount" => "+{$mergethread['attachmentcount']}",
"unapprovedposts" => "+{$mergethread['unapprovedposts']}",

			"replies" => "+{$mergethread['replies']}",
"attachmentcount" => "+{$mergethread['attachmentcount']}",
"unapprovedposts" => "+{$mergethread['unapprovedposts']}",

			"deletedposts" => "+{$mergethread['unapprovedposts']}",

 
			"deletedposts" => "+{$mergethread['deletedposts']}"
);
update_thread_counters($tid, $updated_stats);

			"deletedposts" => "+{$mergethread['deletedposts']}"
);
update_thread_counters($tid, $updated_stats);

Zeile 1841Zeile 1838
						'threadnum' => 0
);
}

						'threadnum' => 0
);
}

				// Subtract thread from old thread opener
--$user_counters[$newthread['uid']]['threadnum'];

				++$user_counters[$newthread['uid']]['threadnum'];


			}
elseif($visible == -1)
{

			}
elseif($visible == -1)
{

Zeile 1933Zeile 1929
				// Unapproved post
// Subtract 1 from the old thread's unapproved posts
--$thread_counters[$post['tid']]['unapprovedposts'];

				// Unapproved post
// Subtract 1 from the old thread's unapproved posts
--$thread_counters[$post['tid']]['unapprovedposts'];

			}
elseif($post['visible'] == -1)
{

			}
elseif($post['visible'] == -1)
{

				// Soft deleted post
// Subtract 1 from the old thread's deleted posts
--$thread_counters[$post['tid']]['deletedposts'];

				// Soft deleted post
// Subtract 1 from the old thread's deleted posts
--$thread_counters[$post['tid']]['deletedposts'];

Zeile 2023Zeile 2019
					{
++$thread_counters[$post['tid']]['unapprovedposts'];
++$forum_counters[$post['fid']]['unapprovedposts'];

					{
++$thread_counters[$post['tid']]['unapprovedposts'];
++$forum_counters[$post['fid']]['unapprovedposts'];

					}

					}

				}

// Update user thread counter if thread opener changes

				}

// Update user thread counter if thread opener changes

Zeile 2111Zeile 2107
		{
// If splitting into a new thread, subtract one from the thread's reply count to compensate for the original post
--$thread_counters[$newtid]['replies'];

		{
// If splitting into a new thread, subtract one from the thread's reply count to compensate for the original post
--$thread_counters[$newtid]['replies'];

		}

		}

		elseif($destination_tid == 0 && $newthread['visible'] == 0)

		elseif($destination_tid == 0 && $newthread['visible'] == 0)

		{

		{

			// If splitting into a new thread, subtract one from the thread's reply count to compensate for the original post
--$thread_counters[$newtid]['unapprovedposts'];
}
elseif($destination_tid == 0 && $newthread['visible'] == -1)

			// If splitting into a new thread, subtract one from the thread's reply count to compensate for the original post
--$thread_counters[$newtid]['unapprovedposts'];
}
elseif($destination_tid == 0 && $newthread['visible'] == -1)

		{

		{

			// If splitting into a new thread, subtract one from the thread's reply count to compensate for the original post
--$thread_counters[$newtid]['deletedposts'];
}

			// If splitting into a new thread, subtract one from the thread's reply count to compensate for the original post
--$thread_counters[$newtid]['deletedposts'];
}





		$arguments = array("pids" => $pids, "tid" => $tid, "moveto" => $moveto, "newsubject" => $newsubject, "destination_tid" => $destination_tid);
$plugins->run_hooks("class_moderation_split_posts", $arguments);


		$arguments = array("pids" => $pids, "tid" => $tid, "moveto" => $moveto, "newsubject" => $newsubject, "destination_tid" => $destination_tid);
$plugins->run_hooks("class_moderation_split_posts", $arguments);


Zeile 2130Zeile 2126
		if(!empty($user_counters))
{
foreach($user_counters as $uid => $counters)

		if(!empty($user_counters))
{
foreach($user_counters as $uid => $counters)

			{
foreach($counters as $key => $counter)
{
if($counter >= 0)

			{
foreach($counters as $key => $counter)
{
if($counter >= 0)

					{
$counters[$key] = "+{$counter}"; // add the addition operator for query
}

					{
$counters[$key] = "+{$counter}"; // add the addition operator for query
}

Zeile 2154Zeile 2150
					$newthread = $db->fetch_array($query);
$sqlarray = array(
"subject" => $newsubject,

					$newthread = $db->fetch_array($query);
$sqlarray = array(
"subject" => $newsubject,

						"replyto" => 0
);

						"replyto" => 0
);

					$db->update_query("posts", $sqlarray, "pid='{$newthread['pid']}'");
}
else

					$db->update_query("posts", $sqlarray, "pid='{$newthread['pid']}'");
}
else

Zeile 2175Zeile 2171
						"replyto" => 0
);
$db->update_query("posts", $sqlarray, "pid='{$oldthread['pid']}'");

						"replyto" => 0
);
$db->update_query("posts", $sqlarray, "pid='{$oldthread['pid']}'");

				}

foreach($counters as $key => $counter)

				}

foreach($counters as $key => $counter)

				{
if($counter >= 0)
{

				{
if($counter >= 0)
{

Zeile 2215Zeile 2211
	 * @param array $tids Thread IDs
* @param int $moveto Destination forum
* @return boolean

	 * @param array $tids Thread IDs
* @param int $moveto Destination forum
* @return boolean

 
	 *
* @deprecated Iterate over move_thread instead

	 */
function move_threads($tids, $moveto)
{

	 */
function move_threads($tids, $moveto)
{

Zeile 2253Zeile 2251
				);
}


				);
}


			if(!isset($user_counters[$thread['uid']]['num_threads']))

			if(!isset($user_counters[$thread['uid']]))

			{

			{

				$user_counters[$thread['uid']]['num_threads'] = 0;




				$user_counters[$thread['uid']] = array(
'num_posts' => 0,
'num_threads' => 0
);

			}

if($thread['visible'] == 1)

			}

if($thread['visible'] == 1)

Zeile 2289Zeile 2290
				");
while($posters = $db->fetch_array($query1))
{

				");
while($posters = $db->fetch_array($query1))
{

					if(!isset($user_counters[$posters['uid']]['num_posts']))

					if(!isset($user_counters[$posters['uid']]))

					{

					{

						$user_counters[$posters['uid']]['num_posts'] = 0;




						$user_counters[$posters['uid']] = array(
'num_posts' => 0,
'num_threads' => 0
);

					}

if($newforum['usepostcounts'] != 0 && $forum['usepostcounts'] == 0)

					}

if($newforum['usepostcounts'] != 0 && $forum['usepostcounts'] == 0)