From 8c672011a267d193fa47cd7cbb523e90a643ee32 Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Mon, 21 Jan 2002 17:31:13 +0000 Subject: - moved user block from theme.inc to user.module. * only problem is that the admin.php link is not available until the admin enables the block. * $theme->user is obsolete, will patch the themes properly in a later patch. - moved moderation block from theme.inc to queue.module. * removed theme_moderation_results(). - updated database/database.mysql. --- modules/queue.module | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'modules/queue.module') diff --git a/modules/queue.module b/modules/queue.module index 11790447e..c301051d1 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -170,4 +170,33 @@ function queue_page() { } } +function queue_block() { + global $PHP_SELF; + if (strrchr($PHP_SELF, "/") == "/node.php") { + global $user, $id; + if ($user->uid) { + $node = db_fetch_object(db_query("SELECT * FROM node WHERE nid = '$id'")); + } + if ($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]'.
"; + } + } + + $block[0]["subject"] = t("Moderation results"); + $block[0]["content"] = $output ? $output : t("This node has not been moderated yet."); + $block[0]["info"] = t("Moderation results"); + } + } + elseif (strrchr($PHP_SELF, "/") == "/admin.php") { + $block[0]["subject"] = t("Moderation results"); + $block[0]["info"] = t("Moderation results"); + } + + return $block; +} + ?> -- cgit v1.2.3