From 6f02738cc2ca88d01d541b9b81cc7cf860980c33 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 16 May 2001 20:54:37 +0000 Subject: - Removed the "history"-field from the SQL table "users" and added this information to the "users"-field in both nodes and comments. This database/table change reduces the number of SQL queries and makes Drupal scale better where a lot of voting/moderation takes place. Last but not least it can be considered a new and better foundation for future moderation metrics / algorithms. In other words: it is plain better. --> oops, all voting/moderation results will be lost! --> requires database update, see "2.00-to-x.xx.sql"! - Updated database/database.mysql --- includes/theme.inc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'includes/theme.inc') diff --git a/includes/theme.inc b/includes/theme.inc index 2be12b414..269a5da2e 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -102,16 +102,14 @@ function theme_morelink($theme, $node) { } function theme_moderation_results($theme, $node) { - global $user; - - if ($user->id && $node->nid && ($user->id == $node->author || user_get($user, "history", "n$node->nid"))) { - $result = db_query("SELECT * FROM users WHERE history LIKE '%n$node->nid%'"); - while ($account = db_fetch_object($result)) { - $output .= format_username($account->userid) ." voted '". user_get($account, "history", "n$node->nid") ."'.
"; + foreach (explode(";", $node->users) as $vote) { + if ($vote) { + $data = explode(":", $vote); + $output .= format_username($data[0]) ." voted '$data[1]'.
"; } - - $theme->box(t("Moderation results"), ($output ? $output : t("This node has not been moderated yet."))); } + + $theme->box(t("Moderation results"), ($output ? $output : t("This node has not been moderated yet."))); } /* -- cgit v1.2.3