Vergleich inc/class_custommoderation.php - 1.8.3 - 1.8.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 24Zeile 24
	/**
* Get info on a tool
*

	/**
* Get info on a tool
*

	 * @param int Tool ID
* @param mixed Thread IDs
* @param mixed Post IDs
* @return mixed Returns tool data (tid, type, name, description) in an array, otherwise boolean false.

	 * @param int $tool_id Tool ID
* @return array|bool Returns tool data (tid, type, name, description) in an array, otherwise boolean false.



	 */
function tool_info($tool_id)
{

	 */
function tool_info($tool_id)
{

Zeile 49Zeile 47
	/**
* Execute Custom Moderation Tool
*

	/**
* Execute Custom Moderation Tool
*

	 * @param int Tool ID
* @param mixed Thread ID(s)
* @param mixed Post IDs

	 * @param int $tool_id Tool ID
* @param int|array Thread ID(s)
* @param int|array Post ID(s)

	 * @return string 'forum' or 'default' indicating where to redirect
*/
function execute($tool_id, $tids=0, $pids=0)

	 * @return string 'forum' or 'default' indicating where to redirect
*/
function execute($tool_id, $tids=0, $pids=0)

Zeile 81Zeile 79
		$thread_options = my_unserialize($tool['threadoptions']);

// If the tool type is a post tool, then execute the post moderation

		$thread_options = my_unserialize($tool['threadoptions']);

// If the tool type is a post tool, then execute the post moderation

 
		$deleted_thread = 0;

		if($tool['type'] == 'p')
{
$deleted_thread = $this->execute_post_moderation($post_options, $pids, $tids);

		if($tool['type'] == 'p')
{
$deleted_thread = $this->execute_post_moderation($post_options, $pids, $tids);

Zeile 99Zeile 98
	/**
* Execute Inline Post Moderation
*

	/**
* Execute Inline Post Moderation
*

	 * @param array Moderation information
* @param mixed Post IDs
* @param array Thread IDs (in order of dateline ascending)

	 * @param array $post_options Moderation information
* @param array $pids Post IDs
* @param array|int $tid Thread IDs (in order of dateline ascending). Only the first one will be used

	 * @return boolean true
*/
function execute_post_moderation($post_options, $pids, $tid)

	 * @return boolean true
*/
function execute_post_moderation($post_options, $pids, $tid)

Zeile 138Zeile 137
				foreach($delete_tids as $delete_tid)
{
$this->delete_thread($delete_tid);

				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;

				// return true here so the code in execute() above knows to redirect to the forum
return true;

			}
}
else

			}
}
else

Zeile 164Zeile 162
				$this->toggle_post_visibility($pids);
}


				$this->toggle_post_visibility($pids);
}


			if($post_options['softdelete'] == 'softdelete') // Soft delete posts

			if($post_options['softdeleteposts'] == 'softdelete') // Soft delete posts

			{
$this->soft_delete_posts($pids);
}

			{
$this->soft_delete_posts($pids);
}

			elseif($post_options['softdelete'] == 'restore') // Restore posts

			elseif($post_options['softdeleteposts'] == 'restore') // Restore posts

			{
$this->restore_posts($pids);
}

			{
$this->restore_posts($pids);
}

			elseif($post_options['softdelete'] == 'toggle') // Toggle post visibility

			elseif($post_options['softdeleteposts'] == 'toggle') // Toggle post visibility

			{
$this->toggle_post_softdelete($pids);
}

			{
$this->toggle_post_softdelete($pids);
}

Zeile 242Zeile 240
						"uid" => $mybb->user['uid'],
"username" => $mybb->user['username'],
"message" => $post_options['splitpostsaddreply'],

						"uid" => $mybb->user['uid'],
"username" => $mybb->user['username'],
"message" => $post_options['splitpostsaddreply'],

						"ipaddress" => $db->escape_binary(my_inet_pton(get_ip())),

						"ipaddress" => my_inet_pton(get_ip()),

					);
// Set up the post options from the input.
$post['options'] = array(

					);
// Set up the post options from the input.
$post['options'] = array(

Zeile 266Zeile 264
	/**
* Execute Normal and Inline Thread Moderation
*

	/**
* Execute Normal and Inline Thread Moderation
*

	 * @param array Moderation information
* @param mixed Thread IDs

	 * @param array $thread_options Moderation information
* @param array Thread IDs. Only the first one will be used, but it needs to be an array

	 * @return boolean true
*/
function execute_thread_moderation($thread_options, $tids)

	 * @return boolean true
*/
function execute_thread_moderation($thread_options, $tids)

Zeile 336Zeile 334
				$this->toggle_thread_visibility($tids, $thread['fid']);
}


				$this->toggle_thread_visibility($tids, $thread['fid']);
}


			if($thread_options['softdelete'] == 'softdelete') // Soft delete thread

			if($thread_options['softdeletethread'] == 'softdelete') // Soft delete thread

			{

			{

				$this->soft_delete_threads($tids, $thread['fid']);

				$this->soft_delete_threads($tids);

			}

			}

			elseif($thread_options['softdelete'] == 'restore') // Restore thread

			elseif($thread_options['softdeletethread'] == 'restore') // Restore thread

			{

			{

				$this->restore_threads($tids, $thread['fid']);

				$this->restore_threads($tids);

			}

			}

			elseif($thread_options['softdelete'] == 'toggle') // Toggle thread visibility

			elseif($thread_options['softdeletethread'] == 'toggle') // Toggle thread visibility

			{

			{

				$this->toggle_thread_softdelete($tids, $thread['fid']);

				$this->toggle_thread_softdelete($tids);

			}

if($thread_options['openthread'] == 'open') // Open thread

			}

if($thread_options['openthread'] == 'open') // Open thread

Zeile 396Zeile 394
					$posthandler = new PostDataHandler("insert");

if(empty($thread_options['replysubject']))

					$posthandler = new PostDataHandler("insert");

if(empty($thread_options['replysubject']))

                    {
$new_subject = 'RE: '.$thread['subject'];
}
else
{
$new_subject = str_ireplace('{username}', $mybb->user['username'], $thread_options['replysubject']);
$new_subject = str_ireplace('{subject}', $thread['subject'], $new_subject);
}

					{
$new_subject = 'RE: '.$thread['subject'];
}
else
{
$new_subject = str_ireplace('{username}', $mybb->user['username'], $thread_options['replysubject']);
$new_subject = str_ireplace('{subject}', $thread['subject'], $new_subject);
}





                    // Set the post data that came from the input to the $post array.
$post = array(
"tid" => $thread['tid'],
"replyto" => $thread['firstpost'],
"fid" => $thread['fid'],
"subject" => $new_subject,

					// Set the post data that came from the input to the $post array.
$post = array(
"tid" => $thread['tid'],
"replyto" => $thread['firstpost'],
"fid" => $thread['fid'],
"subject" => $new_subject,

						"uid" => $mybb->user['uid'],
"username" => $mybb->user['username'],
"message" => $thread_options['addreply'],

						"uid" => $mybb->user['uid'],
"username" => $mybb->user['username'],
"message" => $thread_options['addreply'],

						"ipaddress" => $db->escape_binary(my_inet_pton(get_ip())),

						"ipaddress" => my_inet_pton(get_ip()),

					);

// Set up the post options from the input.

					);

// Set up the post options from the input.