Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html *
|
* $Id: class_moderation.php 3548 2007-12-14 04:08:59Z dennis $
| * $Id: class_moderation.php 3837 2008-05-15 05:41:50Z Tikitiki $
|
*/
class Moderation
| */
class Moderation
|
Zeile 420 | Zeile 420 |
---|
{ $db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum-1 WHERE uid='".$post['uid']."'"); }
|
{ $db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum-1 WHERE uid='".$post['uid']."'"); }
|
// Delete the post $db->delete_query(TABLE_PREFIX."posts", "pid='$pid'");
|
|
// Remove attachments remove_attachments($pid);
|
// Remove attachments remove_attachments($pid);
|
| // Delete the post $db->delete_query(TABLE_PREFIX."posts", "pid='$pid'");
|
$num_unapproved_posts = $num_approved_posts = 0; // Update unapproved post count if($post['visible'] == 0) { $db->query("UPDATE ".TABLE_PREFIX."forums SET unapprovedposts=unapprovedposts-1 WHERE fid='{$post['fid']}'"); $db->query("UPDATE ".TABLE_PREFIX."threads SET unapprovedposts=unapprovedposts-1 WHERE tid='{$post['tid']}'");
|
$num_unapproved_posts = $num_approved_posts = 0; // Update unapproved post count if($post['visible'] == 0) { $db->query("UPDATE ".TABLE_PREFIX."forums SET unapprovedposts=unapprovedposts-1 WHERE fid='{$post['fid']}'"); $db->query("UPDATE ".TABLE_PREFIX."threads SET unapprovedposts=unapprovedposts-1 WHERE tid='{$post['tid']}'");
|
$num_unaproved_posts--;
| --$num_unaproved_posts;
|
} else {
|
} else {
|
$num_approved_posts++;
| ++$num_approved_posts;
|
} $plugins->run_hooks("class_moderation_delete_post", $post['pid']);
| } $plugins->run_hooks("class_moderation_delete_post", $post['pid']);
|
Zeile 444 | Zeile 446 |
---|
"replies" => "-{$num_approved_posts}", "unapprovedposts" => "-{$num_unapproved_posts}" );
|
"replies" => "-{$num_approved_posts}", "unapprovedposts" => "-{$num_unapproved_posts}" );
|
update_thread_counters($post['tid'], $update_array);
| update_thread_counters($post['tid'], $update_array);
|
// Update stats
| // Update stats
|
Zeile 784 | Zeile 786 |
---|
while($posters = $db->fetch_array($query)) { if($method == "copy" && $newforum['usepostcounts'] != "no" && $posters['visible'] != "no")
|
while($posters = $db->fetch_array($query)) { if($method == "copy" && $newforum['usepostcounts'] != "no" && $posters['visible'] != "no")
|
{ $pcount = "+{$posters['posts']}";
| { $pcount = "+{$posters['posts']}";
|
} elseif($method != "copy" && ($newforum['usepostcounts'] != "no" && $forum['usepostcounts'] == "no" && $posters['visible'] != "no")) { $pcount = "+{$posters['posts']}";
|
} elseif($method != "copy" && ($newforum['usepostcounts'] != "no" && $forum['usepostcounts'] == "no" && $posters['visible'] != "no")) { $pcount = "+{$posters['posts']}";
|
}
| }
|
elseif($method != "copy" && ($newforum['usepostcounts'] == "no" && $forum['usepostcounts'] != "no" && $posters['visible'] != "no"))
|
elseif($method != "copy" && ($newforum['usepostcounts'] == "no" && $forum['usepostcounts'] != "no" && $posters['visible'] != "no"))
|
{
| {
|
$pcount = "-{$posters['posts']}";
|
$pcount = "-{$posters['posts']}";
|
}
| }
|
if(!empty($pcount)) { $db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum$pcount WHERE uid='{$posters['uid']}'");
|
if(!empty($pcount)) { $db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum$pcount WHERE uid='{$posters['uid']}'");
|
} }
| } }
|
// Update forum counts $update_array = array( "threads" => "+{$num_threads}",
| // Update forum counts $update_array = array( "threads" => "+{$num_threads}",
|
Zeile 845 | Zeile 847 |
---|
function merge_threads($mergetid, $tid, $subject) { global $db, $mybb, $mergethread, $thread, $plugins;
|
function merge_threads($mergetid, $tid, $subject) { global $db, $mybb, $mergethread, $thread, $plugins;
|
|
|
$mergetid = intval($mergetid); $tid = intval($tid);
| $mergetid = intval($mergetid); $tid = intval($tid);
|
Zeile 890 | Zeile 892 |
---|
$db->update_query(TABLE_PREFIX."threads", $pollsql, "tid='$tid'"); $sqlarray = array( "closed" => "moved|$tid",
|
$db->update_query(TABLE_PREFIX."threads", $pollsql, "tid='$tid'"); $sqlarray = array( "closed" => "moved|$tid",
|
);
| );
|
$db->update_query(TABLE_PREFIX."threads", $sqlarray, "closed='moved|$mergetid'"); $sqlarray = array( "tid" => $tid,
| $db->update_query(TABLE_PREFIX."threads", $sqlarray, "closed='moved|$mergetid'"); $sqlarray = array( "tid" => $tid,
|
Zeile 905 | Zeile 907 |
---|
$updated_stats = array( "replies" => '+'.($mergethread['replies']+1), "unapprovedposts" => "+{$mergethread['unapprovedposts']}"
|
$updated_stats = array( "replies" => '+'.($mergethread['replies']+1), "unapprovedposts" => "+{$mergethread['unapprovedposts']}"
|
);
| );
|
update_thread_counters($tid, $updated_stats); // Thread is not in current forum
| update_thread_counters($tid, $updated_stats); // Thread is not in current forum
|
Zeile 996 | Zeile 998 |
---|
if($oldusepcounts == "yes" && $newusepcounts == "no") { $pcount = "-{$posters['posts']}";
|
if($oldusepcounts == "yes" && $newusepcounts == "no") { $pcount = "-{$posters['posts']}";
|
}
| }
|
elseif($oldusepcounts == "no" && $newusepcounts == "yes") { $pcount = "+{$posters['posts']}";
| elseif($oldusepcounts == "no" && $newusepcounts == "yes") { $pcount = "+{$posters['posts']}";
|
Zeile 1026 | Zeile 1028 |
---|
} } else if($post['visible'] == 0)
|
} } else if($post['visible'] == 0)
|
{
| {
|
$num_unapproved++; } }
| $num_unapproved++; } }
|
Zeile 1261 | Zeile 1263 |
---|
$thread_counters[$post['tid']]['unapprovedposts'] = $post['threadunapprovedposts']; } --$thread_counters[$post['tid']]['unapprovedposts'];
|
$thread_counters[$post['tid']]['unapprovedposts'] = $post['threadunapprovedposts']; } --$thread_counters[$post['tid']]['unapprovedposts'];
|
if($post['threadfirstpost'] != $post['pid']) { if(!$thread_counters[$post['tid']]['replies']) { $thread_counters[$post['tid']]['replies'] = $post['threadreplies']; }
| if($post['threadfirstpost'] != $post['pid']) { if(!$thread_counters[$post['tid']]['replies']) { $thread_counters[$post['tid']]['replies'] = $post['threadreplies']; }
|
++$thread_counters[$post['tid']]['replies']; }
|
++$thread_counters[$post['tid']]['replies']; }
|
// Only add to the forum count if the thread is invisible if($post['threadvisible'] == 0) { ++$forum_counters[$post['fid']]['num_posts']; }
| ++$forum_counters[$post['fid']]['num_posts'];
|
// If the first post here matches and thread is invisible, we approve the thread too if($post['threadfirstpost'] == $post['pid'] && $post['threadvisible'] == 0) { $thread_counters[$post['tid']]['visible'] = 1;
|
// If the first post here matches and thread is invisible, we approve the thread too if($post['threadfirstpost'] == $post['pid'] && $post['threadvisible'] == 0) { $thread_counters[$post['tid']]['visible'] = 1;
|
$thread_counters[$post['tid']]['unapprovedposts'] += 1; $forum_counters[$post['fid']]['num_posts'] += $post['threadreplies']; $forum_counters[$post['fid']]['num_threads']++; } } if(!count($pids)) return false;
$where = "pid IN (".implode(",", $pids).")"; $db->update_query(TABLE_PREFIX."posts", $approve, $where);
if(is_array($thread_counters)) { foreach($thread_counters as $tid => $counters) { $db->update_query(TABLE_PREFIX."threads", $counters, "tid='{$tid}'"); } } if(is_array($forum_counters))
| $forum_counters[$post['fid']]['num_posts'] += $post['threadreplies']; $forum_counters[$post['fid']]['num_threads']++; } } if(!count($pids)) return false;
$where = "pid IN (".implode(",", $pids).")"; $db->update_query(TABLE_PREFIX."posts", $approve, $where);
if(is_array($thread_counters)) { foreach($thread_counters as $tid => $counters) { $db->update_query(TABLE_PREFIX."threads", $counters, "tid='{$tid}'"); update_thread_data($tid); } } if(is_array($forum_counters))
|
{ foreach($forum_counters as $fid => $counters) {
| { foreach($forum_counters as $fid => $counters) {
|
Zeile 1391 | Zeile 1390 |
---|
foreach($thread_counters as $tid => $counters) { $db->update_query(TABLE_PREFIX."threads", $counters, "tid='{$tid}'");
|
foreach($thread_counters as $tid => $counters) { $db->update_query(TABLE_PREFIX."threads", $counters, "tid='{$tid}'");
|
| update_thread_data($tid);
|
} }
| } }
|