Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: class_custommoderation.php 3902 2008-06-11 02:21:37Z Tikitiki $
| * $Id: class_custommoderation.php 4392 2009-07-05 21:36:50Z RyanGordon $
|
*/
|
*/
|
| // Disallow direct access to this file for security reasons if(!defined("IN_MYBB")) { die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined."); }
|
/** * Used to execute a custom moderation tool
| /** * Used to execute a custom moderation tool
|
Zeile 119 | Zeile 125 |
---|
foreach($pids as $pid) { $this->delete_post($pid);
|
foreach($pids as $pid) { $this->delete_post($pid);
|
} } else {
| } } else {
|
if($post_options['mergeposts'] == 1) // Merge posts { $this->merge_posts($pids);
| if($post_options['mergeposts'] == 1) // Merge posts { $this->merge_posts($pids);
|
Zeile 199 | Zeile 205 |
---|
);
$posthandler->set_data($post);
|
);
$posthandler->set_data($post);
|
|
|
if($posthandler->validate_post($post)) { $posthandler->insert_post($post);
| if($posthandler->validate_post($post)) { $posthandler->insert_post($post);
|
Zeile 236 | Zeile 242 |
---|
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 251 | Zeile 257 |
---|
} } if($thread_options['deletepoll'] == 1) // Delete poll
|
} } if($thread_options['deletepoll'] == 1) // Delete poll
|
{ foreach($tids as $tid)
| { foreach($tids as $tid)
|
{ $this->delete_poll($tid); }
| { $this->delete_poll($tid); }
|
Zeile 276 | Zeile 282 |
---|
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 {
|
if($thread_options['openthread'] == 'open') // Open thread {
|
echo "opening";
| |
$this->open_threads($tids);
|
$this->open_threads($tids);
|
}
| }
|
elseif($thread_options['openthread'] == 'close') // Close thread { $this->close_threads($tids);
| elseif($thread_options['openthread'] == 'close') // Close thread { $this->close_threads($tids);
|
Zeile 299 | Zeile 304 |
---|
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)");
| $query = $db->simple_select("threads", 'fid, subject, tid, firstpost', "tid IN ($tid_list) AND closed NOT LIKE 'moved|%'");
|
require_once MYBB_ROOT."inc/datahandlers/post.php";
|
require_once MYBB_ROOT."inc/datahandlers/post.php";
|
|
|
// Loop threads adding a reply to each one while($thread = $db->fetch_array($query)) { $posthandler = new PostDataHandler("insert"); if(empty($thread_options['replysubject']))
|
// Loop threads adding a reply to each one while($thread = $db->fetch_array($query)) { $posthandler = new PostDataHandler("insert"); if(empty($thread_options['replysubject']))
|
{ $thread_options['replysubject'] = 'RE: '.$thread['subject']; } else { $thread_options['replysubject'] = str_ireplace('{username}', $mybb->user['username'], $thread_options['replysubject']); $thread_options['replysubject'] = str_ireplace('{subject}', $thread['subject'], $thread_options['replysubject']); } // 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" => $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); } // 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'],
|
Zeile 331 | Zeile 337 |
---|
$post['options'] = array( "signature" => 1, "emailnotify" => 0,
|
$post['options'] = array( "signature" => 1, "emailnotify" => 0,
|
"disablesmilies" => 1
| "disablesmilies" => 0
|
); $posthandler->set_data($post);
| ); $posthandler->set_data($post);
|