summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-05-16 20:54:37 +0000
committerDries Buytaert <dries@buytaert.net>2001-05-16 20:54:37 +0000
commit6f02738cc2ca88d01d541b9b81cc7cf860980c33 (patch)
tree81ef242e0ae747e1715142dd370450bbed651ceb /includes/theme.inc
parent0b13183e097ae941db44a52b5ce5dc97faef99c2 (diff)
downloadbrdo-6f02738cc2ca88d01d541b9b81cc7cf860980c33.tar.gz
brdo-6f02738cc2ca88d01d541b9b81cc7cf860980c33.tar.bz2
- 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
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc14
1 files changed, 6 insertions, 8 deletions
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") ."'.<BR>";
+ foreach (explode(";", $node->users) as $vote) {
+ if ($vote) {
+ $data = explode(":", $vote);
+ $output .= format_username($data[0]) ." voted '$data[1]'.<BR>";
}
-
- $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.")));
}
/*