summaryrefslogtreecommitdiff
path: root/modules/rating.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rating.module')
-rw-r--r--modules/rating.module9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/rating.module b/modules/rating.module
index c38f2a2d4..563876bd0 100644
--- a/modules/rating.module
+++ b/modules/rating.module
@@ -26,7 +26,7 @@ function rating_cron() {
$bonus -= $story->number / 2;
}
- $r4 = db_query("SELECT score, votes FROM comments WHERE author = '$rating->id' AND (". time() ." - timestamp < $period) ORDER BY timestamp LIMIT $number");
+ $r4 = db_query("SELECT score, votes FROM comments WHERE author = '$rating->id' AND (". time() ." - timestamp < $period) ORDER BY timestamp LIMIT $number", 1);
while ($comment = db_fetch_object($r4)) {
$weight++;
$score += $weight * $comment->score;
@@ -35,6 +35,7 @@ function rating_cron() {
if ($weight >= $offset && $votes > 0) {
$value = ($score + $weight) / $votes + $bonus;
+ print "update $rating->id : $value<BR>";
db_query("UPDATE users SET rating = '$value' WHERE id = '$rating->id'");
}
}
@@ -74,9 +75,9 @@ function rating_page() {
}
function rating_block() {
- $block[0]["subject"] = "Top 10:<BR>users";
- $block[0]["content"] = rating_list(10);
- $block[0]["info"] = "Top 10: users";
+ $block[0][subject] = "Top 10:<BR>users";
+ $block[0][content] = rating_list(10);
+ $block[0][info] = "Top 10: users";
return $block;
}