Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html *
|
* $Id: class_moderation.php 2063 2006-08-12 08:12:26Z chris $
| * $Id: class_moderation.php 2385 2006-11-06 23:40:55Z Tikitiki $
|
*/
class Moderation
| */
class Moderation
|
Zeile 334 | Zeile 334 |
---|
// Update unapproved post count if($post['visible'] == 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]'");
| $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']}'");
|
} $plugins->run_hooks("delete_post", $post['tid']); $cache->updatestats();
| } $plugins->run_hooks("delete_post", $post['tid']); $cache->updatestats();
|
Zeile 359 | Zeile 359 |
---|
$pidin = implode(",", $pids); $first = 1; // Get the messages to be merged
|
$pidin = implode(",", $pids); $first = 1; // Get the messages to be merged
|
$query = $db->simple_select(TABLE_PREFIX."posts", "*", "tid='$tid' AND pid IN($pidin)", array('order_by' => 'dateline'));
| $query = $db->query(" SELECT p.pid, p.uid, p.fid, p.tid, p.visible, p.message, f.usepostcounts FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=p.fid) WHERE p.tid='$tid' AND p.pid IN($pidin) ORDER BY dateline ASC ");
|
$num_unapproved_posts = 0; $message = ''; while($post = $db->fetch_array($query))
| $num_unapproved_posts = 0; $message = ''; while($post = $db->fetch_array($query))
|
Zeile 374 | Zeile 380 |
---|
{ // these are the selected posts if($sep == "new_line") {
|
{ // these are the selected posts if($sep == "new_line") {
|
$message .= "\n\n $post[message]";
| $message .= "\n\n {$post['message']}"; } else { $message .= "[hr]{$post['message']}";
|
}
|
}
|
else
| if($post['usepostcounts'] != "no")
|
{
|
{
|
$message .= "[hr]$post[message]";
| // Update post count of the user of the merged posts $db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum-1 WHERE uid='{$post['uid']}'");
|
} } }
| } } }
|
Zeile 424 | Zeile 436 |
---|
$fid = $thread['fid']; $forum = get_forum($fid); switch($method)
|
$fid = $thread['fid']; $forum = get_forum($fid); switch($method)
|
{
| {
|
case "redirect": // move (and leave redirect) thread $plugins->run_hooks("moderation_do_move_redirect");
| case "redirect": // move (and leave redirect) thread $plugins->run_hooks("moderation_do_move_redirect");
|
Zeile 449 | Zeile 461 |
---|
"closed" => "moved|$tid", "sticky" => $thread['sticky'], "visible" => $thread['visible'],
|
"closed" => "moved|$tid", "sticky" => $thread['sticky'], "visible" => $thread['visible'],
|
| "notes" => ''
|
); $db->insert_query(TABLE_PREFIX."threads", $threadarray); if($redirect_expire)
| ); $db->insert_query(TABLE_PREFIX."threads", $threadarray); if($redirect_expire)
|
Zeile 475 | Zeile 488 |
---|
"sticky" => $thread['sticky'], "visible" => $thread['visible'], "unapprovedposts" => $thread['unapprovedposts'],
|
"sticky" => $thread['sticky'], "visible" => $thread['visible'], "unapprovedposts" => $thread['unapprovedposts'],
|
| "notes" => ''
|
); $plugins->run_hooks("moderation_do_move_copy"); $db->insert_query(TABLE_PREFIX."threads", $threadarray);
| ); $plugins->run_hooks("moderation_do_move_copy"); $db->insert_query(TABLE_PREFIX."threads", $threadarray);
|
Zeile 488 | Zeile 502 |
---|
$postssql .= ", "; } $post['message'] = $db->escape_string($post['message']);
|
$postssql .= ", "; } $post['message'] = $db->escape_string($post['message']);
|
$postssql .= "('$newtid','$new_fid','$post[subject]','$post[icon]','$post[uid]','$post[username]','$post[dateline]','$post[message]','$post[ipaddress]','$post[includesig]','$post[smilieoff]','$post[edituid]','$post[edittime]','$post[visible]')";
| $postssql .= "('$newtid','$new_fid','{$post['subject']}','{$post['icon']}','{$post['uid']}','{$post['username']}','{$post['dateline']}','{$post['message']}','{$post['ipaddress']}','{$post['includesig']}','{$post['smilieoff']}','{$post['edituid']}','{$post['edittime']}','{$post['visible']}')";
|
} $db->query("INSERT INTO ".TABLE_PREFIX."posts (tid,fid,subject,icon,uid,username,dateline,message,ipaddress,includesig,smilieoff,edituid,edittime,visible) VALUES $postssql");
| } $db->query("INSERT INTO ".TABLE_PREFIX."posts (tid,fid,subject,icon,uid,username,dateline,message,ipaddress,includesig,smilieoff,edituid,edittime,visible) VALUES $postssql");
|
Zeile 522 | Zeile 536 |
---|
{ if($method == "copy" && $newforum['usepostcounts'] != "no") {
|
{ if($method == "copy" && $newforum['usepostcounts'] != "no") {
|
$pcount = "+$posters[posts]";
| $pcount = "+{$posters['posts']}";
|
} elseif($method != "copy" && ($newforum['usepostcounts'] != "no" && $forum['usepostcounts'] == "no")) {
|
} elseif($method != "copy" && ($newforum['usepostcounts'] != "no" && $forum['usepostcounts'] == "no")) {
|
$pcount = "+$posters[posts]";
| $pcount = "+{$posters['posts']}";
|
} elseif($method != "copy" && ($newforum['usepostcounts'] == "no" && $forum['usepostcounts'] != "no")) {
|
} elseif($method != "copy" && ($newforum['usepostcounts'] == "no" && $forum['usepostcounts'] != "no")) {
|
$pcount = "-$posters[posts]";
| $pcount = "-{$posters['posts']}";
|
} if(!empty($pcount)) {
|
} if(!empty($pcount)) {
|
$db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum$pcount WHERE uid='$posters[uid]'");
| $db->query("UPDATE ".TABLE_PREFIX."users SET postnum=postnum$pcount WHERE uid='{$posters['uid']}'");
|
} }
| } }
|
Zeile 582 | Zeile 596 |
---|
$pollsql = ''; if($mergethread['poll']) {
|
$pollsql = ''; if($mergethread['poll']) {
|
$pollsql = ", poll='$mergethread[poll]'";
| $pollsql = ", poll='{$mergethread['poll']}'";
|
$sqlarray = array( "tid" => $tid, );
| $sqlarray = array( "tid" => $tid, );
|
Zeile 664 | Zeile 678 |
---|
"lastposter" => $thread['lastposter'], "replies" => count($pids)-1, "visible" => "1",
|
"lastposter" => $thread['lastposter'], "replies" => count($pids)-1, "visible" => "1",
|
| "notes" => ''
|
); $db->insert_query(TABLE_PREFIX."threads", $query); $newtid = $db->insert_id();
| ); $db->insert_query(TABLE_PREFIX."threads", $query); $newtid = $db->insert_id();
|
Zeile 686 | Zeile 701 |
---|
SELECT COUNT(p.pid) AS posts, u.uid FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
|
SELECT COUNT(p.pid) AS posts, u.uid FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
|
WHERE p.tid='$tid'
| WHERE p.tid='$newtid'
|
GROUP BY u.uid ORDER BY posts DESC ");
| GROUP BY u.uid ORDER BY posts DESC ");
|
Zeile 694 | Zeile 709 |
---|
{ if($oldusepcounts == "yes" && $newusepcounts == "no") {
|
{ if($oldusepcounts == "yes" && $newusepcounts == "no") {
|
$pcount = "-$posters[posts]";
| $pcount = "-{$posters['posts']}";
|
} elseif($oldusepcounts == "no" && $newusepcounts == "yes") {
|
} elseif($oldusepcounts == "no" && $newusepcounts == "yes") {
|
$pcount = "+$posters[posts]";
| $pcount = "+{$posters['posts']}";
|
}
if(!empty($pcount))
| }
if(!empty($pcount))
|
Zeile 714 | Zeile 729 |
---|
"subject" => $newsubject, "replyto" => 0 );
|
"subject" => $newsubject, "replyto" => 0 );
|
$db->update_query(TABLE_PREFIX."posts", $sqlarray, "pid='$newthread[pid]'");
| $db->update_query(TABLE_PREFIX."posts", $sqlarray, "pid='{$newthread['pid']}'");
|
// Update the subject of the first post in the old thread $query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid='$tid'", array('order_by' => 'dateline', 'limit' => 1));
| // Update the subject of the first post in the old thread $query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid='$tid'", array('order_by' => 'dateline', 'limit' => 1));
|