From f88cfaa2dd205846843068175931e68c582bb037 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 4 Nov 2001 23:30:39 +0000 Subject: - Another batch of updates. The most important bit is that the moderation queue should be functional again. It's not ready yet but I'll be tuning it for the next two evenings or so. --- modules/queue.module | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'modules/queue.module') diff --git a/modules/queue.module b/modules/queue.module index 8dd4d2a5a..ea1ba0b11 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -45,17 +45,29 @@ function queue_vote($id, $vote) { $node = node_load(array(nid => $id, type => $node->type)); - if (variable_get($node->type ."_post", 4) <= $node->score) { + if (variable_get($node->type ."_post", 3) <= $node->score) { node_save($node, array("nid", "status" => 1, "moderate" => 0)); - watchdog("special", "node: posted '$node->title' - moderation"); + watchdog("special", "moderation: posted '$node->title'"); } else if (variable_get($node->type ."_dump", -2) >= $node->score) { - node_save($node, array("nid", "status" => 1, "moderate" => 0)); - watchdog("special", "node: dumped '$node->title' - moderation"); + if ($node->revisions) { + node_revision_rollback($node->nid, node_revision_previous($node)); + watchdog("special", "moderation: dumped '$node->title' (rollback)"); + } + else { + node_save($node, array("nid", "status" => 0, "moderate" => 0)); + watchdog("special", "moderation: dumped '$node->title'"); + } } - else if (variable_get($node->type ."_expire", 8) <= $node->votes) { - node_save($node, array("nid", "status" => 0, "moderate" => 0)); - watchdog("special", "node: expired '$node->title' - moderation"); + else if (variable_get($node->type ."_expire", 6) <= $node->votes) { + if ($node->revisions) { + node_revision_rollback($node->nid, node_revision_previous($node)); + watchdog("special", "moderation: expired '$node->title' (rollback)"); + } + else { + node_save($node, array("nid", "status" => 0, "moderate" => 0)); + watchdog("special", "moderation: expired '$node->title'"); + } } } } -- cgit v1.2.3