Vergleich inc/class_custommoderation.php - 1.6.0 - 1.6.18

  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_custommoderation.php 5138 2010-07-28 18:31:24Z RyanGordon $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 35Zeile 35
		global $db;

// Get tool info

		global $db;

// Get tool info

		$query = $db->simple_select("modtools", 'tid, type, name, description', 'tid="'.intval($tool_id).'"');

		$query = $db->simple_select("modtools", "*", 'tid="'.intval($tool_id).'"');

		$tool = $db->fetch_array($query);
if(!$tool['tid'])
{

		$tool = $db->fetch_array($query);
if(!$tool['tid'])
{

Zeile 84Zeile 84
		// If the tool type is a post tool, then execute the post moderation
if($tool['type'] == 'p')
{

		// If the tool type is a post tool, then execute the post moderation
if($tool['type'] == 'p')
{

			$this->execute_post_moderation($post_options, $pids, $tids);

			$deleted_thread = $this->execute_post_moderation($post_options, $pids, $tids);

		}
// Always execute thead moderation
$this->execute_thread_moderation($thread_options, $tids);

// If the thread is deleted, indicate to the calling script to redirect to the forum, and not the nonexistant thread

		}
// Always execute thead moderation
$this->execute_thread_moderation($thread_options, $tids);

// If the thread is deleted, indicate to the calling script to redirect to the forum, and not the nonexistant thread

		if($thread_options['deletethread'] == 1)

		if($thread_options['deletethread'] == 1 || $deleted_thread === 1)

		{
return 'forum';
}

		{
return 'forum';
}

Zeile 125Zeile 125
			foreach($pids as $pid)
{
$this->delete_post($pid);

			foreach($pids as $pid)
{
$this->delete_post($pid);

 
			}

$delete_tids = array();
$imploded_pids = implode(",", array_map("intval", $pids));
$query = $db->simple_select("threads", "tid", "firstpost IN ({$imploded_pids})");
while($threadid = $db->fetch_field($query, "tid"))
{
$delete_tids[] = $threadid;
}
if(!empty($delete_tids))
{
foreach($delete_tids as $delete_tid)
{
$this->delete_thread($delete_tid);
mark_reports($delete_tid, "thread");
}
// return 1 here so the code in execute() above knows to redirect to the forum
return 1;

			}
}
else

			}
}
else

Zeile 132Zeile 150
			if($post_options['mergeposts'] == 1) // Merge posts
{
$this->merge_posts($pids);

			if($post_options['mergeposts'] == 1) // Merge posts
{
$this->merge_posts($pids);

			}


			}


			if($post_options['approveposts'] == 'approve') // Approve posts
{
$this->approve_posts($pids);

			if($post_options['approveposts'] == 'approve') // Approve posts
{
$this->approve_posts($pids);

			}

			}

			elseif($post_options['approveposts'] == 'unapprove') // Unapprove posts
{
$this->unapprove_posts($pids);

			elseif($post_options['approveposts'] == 'unapprove') // Unapprove posts
{
$this->unapprove_posts($pids);

Zeile 155Zeile 173
				if($count['totalposts'] == 1)
{
error($lang->error_cantsplitonepost);

				if($count['totalposts'] == 1)
{
error($lang->error_cantsplitonepost);

				}

				}


if($count['totalposts'] == count($pids))


if($count['totalposts'] == count($pids))

				{

				{

					error($lang->error_cantsplitall);
}


					error($lang->error_cantsplitall);
}


Zeile 169Zeile 187
				if(empty($post_options['splitpostsnewsubject']))
{
// Enter in a subject if a predefined one does not exist.

				if(empty($post_options['splitpostsnewsubject']))
{
// Enter in a subject if a predefined one does not exist.

					$post_options['splitpostsnewsubject'] = '[split] '.$thread['subject'];

					$post_options['splitpostsnewsubject'] = "{$lang->split_thread_subject} {$thread['subject']}";

				}
$new_subject = str_ireplace('{subject}', $thread['subject'], $post_options['splitpostsnewsubject']);
$new_tid = $this->split_posts($pids, $tid, $post_options['splitposts'], $new_subject);

				}
$new_subject = str_ireplace('{subject}', $thread['subject'], $post_options['splitpostsnewsubject']);
$new_tid = $this->split_posts($pids, $tid, $post_options['splitposts'], $new_subject);

Zeile 188Zeile 206
				if(!empty($post_options['splitpostsaddreply'])) // Add reply to new thread
{
require_once MYBB_ROOT."inc/datahandlers/post.php";

				if(!empty($post_options['splitpostsaddreply'])) // Add reply to new thread
{
require_once MYBB_ROOT."inc/datahandlers/post.php";

					$posthandler = new PostDataHandler("insert");


					$posthandler = new PostDataHandler("insert");


					if(empty($post_options['splitpostsreplysubject']))
{
$post_options['splitpostsreplysubject'] = 'RE: '.$new_subject;
}
else
{

					if(empty($post_options['splitpostsreplysubject']))
{
$post_options['splitpostsreplysubject'] = 'RE: '.$new_subject;
}
else
{

						$post_options['splitpostsreplysubject'] = str_ireplace('{username}', $mybb->user['username'], $thread_options['replysubject']);

						$post_options['splitpostsreplysubject'] = str_ireplace('{username}', $mybb->user['username'], $post_options['splitpostsreplysubject']);

						$post_options['splitpostsreplysubject'] = str_ireplace('{subject}', $new_subject, $post_options['splitpostsreplysubject']);
}


						$post_options['splitpostsreplysubject'] = str_ireplace('{subject}', $new_subject, $post_options['splitpostsreplysubject']);
}


Zeile 223Zeile 241
					{
$posthandler->insert_post($post);
}

					{
$posthandler->insert_post($post);
}

				}

				}

			}
}
return true;

			}
}
return true;

Zeile 246Zeile 264

// If deleting threads, only do that
if($thread_options['deletethread'] == 1)


// If deleting threads, only do that
if($thread_options['deletethread'] == 1)

		{

		{

			foreach($tids as $tid)
{
$this->delete_thread($tid);

			foreach($tids as $tid)
{
$this->delete_thread($tid);

Zeile 255Zeile 273
		else
{
if($thread_options['mergethreads'] == 1 && count($tids) > 1) // Merge Threads (ugly temp code until find better fix)

		else
{
if($thread_options['mergethreads'] == 1 && count($tids) > 1) // Merge Threads (ugly temp code until find better fix)

			{
$tid_list = implode(',', $tids);

			{
$tid_list = implode(',', $tids);

				$options = array('order_by' => 'dateline', 'order_dir' => 'DESC');
$query = $db->simple_select("threads", 'tid, subject', "tid IN ($tid_list)", $options); // Select threads from newest to oldest
$last_tid = 0;
while($tid = $db->fetch_array($query))

				$options = array('order_by' => 'dateline', 'order_dir' => 'DESC');
$query = $db->simple_select("threads", 'tid, subject', "tid IN ($tid_list)", $options); // Select threads from newest to oldest
$last_tid = 0;
while($tid = $db->fetch_array($query))

				{

				{

					if($last_tid != 0)
{
$this->merge_threads($last_tid, $tid['tid'], $tid['subject']); // And keep merging them until we get down to one thread.

					if($last_tid != 0)
{
$this->merge_threads($last_tid, $tid['tid'], $tid['subject']); // And keep merging them until we get down to one thread.

Zeile 277Zeile 295
				}
}
if($thread_options['removeredirects'] == 1) // Remove redirects

				}
}
if($thread_options['removeredirects'] == 1) // Remove redirects

			{

			{

				foreach($tids as $tid)
{
$this->remove_redirects($tid);

				foreach($tids as $tid)
{
$this->remove_redirects($tid);

Zeile 289Zeile 307
				$this->approve_threads($tids, $thread['fid']);
}
elseif($thread_options['approvethread'] == 'unapprove') // Unapprove thread

				$this->approve_threads($tids, $thread['fid']);
}
elseif($thread_options['approvethread'] == 'unapprove') // Unapprove thread

			{

			{

				$this->unapprove_threads($tids, $thread['fid']);
}
elseif($thread_options['approvethread'] == 'toggle') // Toggle thread visibility

				$this->unapprove_threads($tids, $thread['fid']);
}
elseif($thread_options['approvethread'] == 'toggle') // Toggle thread visibility

Zeile 322Zeile 340
			if(!empty($thread_options['addreply'])) // Add reply to thread
{
$tid_list = implode(',', $tids);

			if(!empty($thread_options['addreply'])) // Add reply to thread
{
$tid_list = implode(',', $tids);

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

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

				require_once MYBB_ROOT."inc/datahandlers/post.php";

// Loop threads adding a reply to each one

				require_once MYBB_ROOT."inc/datahandlers/post.php";

// Loop threads adding a reply to each one

Zeile 351Zeile 369
						"message" => $thread_options['addreply'],
"ipaddress" => $db->escape_string(get_ip()),
);

						"message" => $thread_options['addreply'],
"ipaddress" => $db->escape_string(get_ip()),
);

 


					// Set up the post options from the input.
$post['options'] = array(
"signature" => 1,
"emailnotify" => 0,
"disablesmilies" => 0
);

					// Set up the post options from the input.
$post['options'] = array(
"signature" => 1,
"emailnotify" => 0,
"disablesmilies" => 0
);

	








if($thread['closed'] == 1)
{
// Keep this thread closed
$post['modoptions']['closethread'] = 1;
}


					$posthandler->set_data($post);
if($posthandler->validate_post($post))
{

					$posthandler->set_data($post);
if($posthandler->validate_post($post))
{