summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2003-07-17 22:47:59 +0000
committerDries Buytaert2003-07-17 22:47:59 +0000
commit095179ee8d6effff5b3f1c3c708a2d894c0c45dd (patch)
tree5eff542f5928cd57d013c2a311d8f48b424c6417
parent6d75a4f5f67b0536e367a8e1b8fd79912dd025e7 (diff)
- Some queue module fixes by Torgeir.
-rw-r--r--modules/queue.module37
1 files changed, 21 insertions, 16 deletions
diff --git a/modules/queue.module b/modules/queue.module
index b6270c5..95f68ac 100644
--- a/modules/queue.module
+++ b/modules/queue.module
@@ -188,33 +188,38 @@ function queue_page() {
}
function queue_block($op = "list", $delta = 0) {
+
+ global $user;
+
if ($op == "list") {
$blocks[0]["info"] = t("Moderation results");
return $blocks;
}
else {
- if (user_access("access submission queue") && (substr_count(request_uri(), url("queue")) || substr_count(request_uri(), url("node")))) {
- global $user, $id;
+ if (user_access("access submission queue") && (arg(0) == "queue") || arg(0) == "node") {
if ($user->uid) {
+ if (arg(0) == "queue") {
+ $id = arg(1);
+ }
+ else {
+ $id = arg(2);
+ }
$node = node_load(array("nid" => $id));
- }
- if (($user->uid == $node->uid || field_get($node->users, $user->uid)) && $node->moderate == 1) {
- foreach (explode(",", $node->users) as $vote) {
- if ($vote) {
- $data = explode("=", $vote);
- $account = user_load(array("uid" => $data[0]));
- $output .= format_name($account) ." voted '$data[1]'.<br />";
+ if (($user->uid == $node->uid || field_get($node->users, $user->uid)) && $node->moderate == 1) {
+ foreach (explode(",", $node->users) as $vote) {
+ if ($vote) {
+ $data = explode("=", $vote);
+ $account = user_load(array("uid" => $data[0]));
+ $output .= format_name($account) ." voted '$data[1]'.<br />";
+ }
}
- }
- $block["subject"] = t("Moderation results");
- $block["content"] = $output ? $output : t("This node has not yet been moderated.");
+ $block["subject"] = t("Moderation results");
+ $block["content"] = $output ? $output : t("This node has not yet been moderated.");
+
+ }
}
}
- elseif ((user_access("access submission queue") || user_access("administer blocks")) && (substr_count(request_uri(), url("user")) || substr_count(request_uri(), url("admin")))) {
- $block["subject"] = t("Moderation results");
- }
-
return $block;
}
}