Vergleich inc/class_custommoderation.php - 1.2.5 - 1.2.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id$

 * $Id: class_custommoderation.php 3515 2007-11-24 09:05:33Z Tikitiki $

 */

/**

 */

/**

Zeile 16Zeile 16

class CustomModeration extends Moderation
{


class CustomModeration extends Moderation
{

	/**
* The thread IDs and forum IDs to be updated
*/
var $update_tids = array();
var $update_fids = array();


 
	/**
* Get info on a tool
*

	/**
* Get info on a tool
*

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

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


// Update counts
$this->update_counts();

 

// If the thread is deleted, indicate to the calling script to redirect to the forum, and not the nonexistant thread
if($thread_options['deletethread'] == 'yes')


// If the thread is deleted, indicate to the calling script to redirect to the forum, and not the nonexistant thread
if($thread_options['deletethread'] == 'yes')

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

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

	{

	{

		global $db, $mybb;

		global $db, $mybb;





		if(is_array($tid))
{
$tid = intval($tid[0]); // There's only 1 thread when doing inline post moderation
}

		if(is_array($tid))
{
$tid = intval($tid[0]); // There's only 1 thread when doing inline post moderation
}


$this->update_tids[$tid] = 1;

 

// Get the information about thread
$thread = get_thread($tid);


// Get the information about thread
$thread = get_thread($tid);

		$this->update_fids[$thread['fid']] = 1;

 

// If deleting posts, only do that
if($post_options['deleteposts'] == 'yes')


// If deleting posts, only do that
if($post_options['deleteposts'] == 'yes')

Zeile 140Zeile 128

if($post_options['approveposts'] == 'approve') // Approve posts
{


if($post_options['approveposts'] == 'approve') // Approve posts
{

				$this->approve_posts($pids, $tid, $thread['fid']);

				$this->approve_posts($pids);

			}
elseif($post_options['approveposts'] == 'unapprove') // Unapprove posts
{

			}
elseif($post_options['approveposts'] == 'unapprove') // Unapprove posts
{

				$this->unapprove_posts($pids, $tid, $thread['fid']);

				$this->unapprove_posts($pids);

			}
elseif($post_options['approveposts'] == 'toggle') // Toggle post visibility
{

			}
elseif($post_options['approveposts'] == 'toggle') // Toggle post visibility
{

				$this->toggle_post_visibility($pids, $tid, $thread['fid']);

				$this->toggle_post_visibility($pids);

			}

if($post_options['splitposts'] > 0 || $post_options['splitposts'] == -2) // Split posts

			}

if($post_options['splitposts'] > 0 || $post_options['splitposts'] == -2) // Split posts

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

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

				$this->update_tids[$new_tid] = 1;
$this->update_fids[$post_options['splitposts']] = 1;

 
				if($post_options['splitpostsclose'] == 'close') // Close new thread
{
$this->close_threads($new_tid);

				if($post_options['splitpostsclose'] == 'close') // Close new thread
{
$this->close_threads($new_tid);

Zeile 196Zeile 182
						"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_string(get_ip()),
);
// Set up the post options from the input.
$post['options'] = array(
"signature" => 'yes',

						"ipaddress" => $db->escape_string(get_ip()),
);
// Set up the post options from the input.
$post['options'] = array(
"signature" => 'yes',

						"emailnotify" => 'no',
"disablesmilies" => 'no'
);

						"emailnotify" => 'no',
"disablesmilies" => 'no'
);





					$posthandler->set_data($post);

if($posthandler->validate_post($post))

					$posthandler->set_data($post);

if($posthandler->validate_post($post))

Zeile 227Zeile 213
	function execute_thread_moderation($thread_options, $tids)
{
global $db, $mybb;

	function execute_thread_moderation($thread_options, $tids)
{
global $db, $mybb;





		$tid = intval($tids[0]); // Take the first thread to get thread data from
$query = $db->simple_select(TABLE_PREFIX."threads", 'fid', "tid='$tid'");
$thread = $db->fetch_array($query);

		$tid = intval($tids[0]); // Take the first thread to get thread data from
$query = $db->simple_select(TABLE_PREFIX."threads", 'fid', "tid='$tid'");
$thread = $db->fetch_array($query);


$this->update_fids[$thread['fid']] = 1;

 

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


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

Zeile 285Zeile 269
			elseif($thread_options['approvethread'] == 'toggle') // Toggle thread visibility
{
$this->toggle_thread_visibility($tids, $thread['fid']);

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

			}


			}


			if($thread_options['openthread'] == 'open') // Open thread
{
$this->open_threads($tids);

			if($thread_options['openthread'] == 'open') // Open thread
{
$this->open_threads($tids);

Zeile 314Zeile 298
				{
$this->move_threads($tids, $thread_options['movethread']);
}

				{
$this->move_threads($tids, $thread_options['movethread']);
}

				$this->update_fids[$thread_options['movethread']] = 1;

 
			}
if($thread_options['copythread'] > 0 || $thread_options['copythread'] == -2) // Copy thread
{

			}
if($thread_options['copythread'] > 0 || $thread_options['copythread'] == -2) // Copy thread
{

Zeile 322Zeile 305
				{
$thread_options['copythread'] = $thread['fid'];
}

				{
$thread_options['copythread'] = $thread['fid'];
}

				//var_dump($tids);

 
				foreach($tids as $tid)
{
$new_tid = $this->move_thread($tid, $thread_options['copythread'], 'copy');

				foreach($tids as $tid)
{
$new_tid = $this->move_thread($tid, $thread_options['copythread'], 'copy');

					$this->update_tids[$new_tid] = 1;

 
				}

				}

				$this->update_fids[$thread_options['copythread']] = 1;

 
			}
if(trim($thread_options['newsubject']) != '{subject}') // Update thread subjects
{

			}
if(trim($thread_options['newsubject']) != '{subject}') // Update thread subjects
{

Zeile 374Zeile 354
					}
}
}

					}
}
}

		}
foreach($tids as $tid)
{
$this->update_tids[$tid] = 1;
}
return true;
}

/**
* Update Forum/Thread Counts
*
* @return boolean true
*/
function update_counts()
{
global $db;
foreach($this->update_tids as $tid => $val)
{
update_thread_count($tid);
}
foreach($this->update_fids as $fid => $val)
{
update_forum_count($fid);

 
		}
return true;
}

		}
return true;
}