diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-03-28 07:03:47 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-03-28 07:03:47 +0000 |
commit | 3f2b0e0b3f0322dac929bb997a331cb7c021f295 (patch) | |
tree | 01940cabb5f1b50c16822e8585092ab9cee543ce /modules | |
parent | 6bb49b4bb8d7c73e1cce62e27375559b9837b898 (diff) | |
download | brdo-3f2b0e0b3f0322dac929bb997a331cb7c021f295.tar.gz brdo-3f2b0e0b3f0322dac929bb997a331cb7c021f295.tar.bz2 |
Flushing my backlog (in case Natrak wants to make more changes):
- tidied up some of the code
- fixed a small problems
Diffstat (limited to 'modules')
-rw-r--r-- | modules/account.module | 2 | ||||
-rw-r--r-- | modules/rating.module | 9 | ||||
-rw-r--r-- | modules/section.module | 6 | ||||
-rw-r--r-- | modules/story.module | 12 | ||||
-rw-r--r-- | modules/story/story.module | 12 |
5 files changed, 21 insertions, 20 deletions
diff --git a/modules/account.module b/modules/account.module index 82b01092d..178b31301 100644 --- a/modules/account.module +++ b/modules/account.module @@ -87,7 +87,7 @@ function account_delete($name) { function account_edit_save($name, $edit) { foreach ($edit as $key=>$value) if ($key != "access") $query .= "$key = '". addslashes($value) ."', "; db_query("UPDATE users SET $query access = '' WHERE userid = '$name'"); - if ($edit["access"]) foreach ($edit["access"] as $key=>$value) user_set(user_load($name), "access", $value, 1); + if ($edit[access]) foreach ($edit[access] as $key=>$value) user_set(user_load($name), "access", $value, 1); watchdog("message", "account: modified user '$name'"); } 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; } diff --git a/modules/section.module b/modules/section.module index 052004b00..07054903e 100644 --- a/modules/section.module +++ b/modules/section.module @@ -23,9 +23,9 @@ function section_block() { $content .= "<LI><A HREF=\"?section=". urlencode($_section->name) ."\">$_section->name</A> (". check_output($_section->stories, 0) .")</LI>\n"; } - $block[0]["subject"] = "Sections"; - $block[0]["content"] = $content; - $block[0]["info"] = "Section list"; + $block[0][subject] = "Sections"; + $block[0][content] = $content; + $block[0][info] = "Section list"; return $block; } diff --git a/modules/story.module b/modules/story.module index 06ace2f70..dc557a4c5 100644 --- a/modules/story.module +++ b/modules/story.module @@ -193,9 +193,9 @@ function story_block() { $content .= "<LI><A HREF=\"node.php?id=$story->id\">". check_output($story->title) ."</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n"; } - $blocks[0]["subject"] = "Top 10:<BR>all stories"; - $blocks[0]["content"] = $content; - $blocks[0]["info"] = "Top 10: all stories"; + $blocks[0][subject] = "Top 10:<BR>all stories"; + $blocks[0][content] = $content; + $blocks[0][info] = "Top 10: all stories"; unset($content); @@ -204,9 +204,9 @@ function story_block() { $content .= "<LI><A HREF=\"node.php?id=$story->id\">". check_output($story->title) ."</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n"; } - $blocks[1]["subject"] = "Top 10:<BR>recent stories"; - $blocks[1]["content"] = $content; - $blocks[1]["info"] = "Top 10: recent stories"; + $blocks[1][subject] = "Top 10:<BR>recent stories"; + $blocks[1][content] = $content; + $blocks[1][info] = "Top 10: recent stories"; return $blocks; */ diff --git a/modules/story/story.module b/modules/story/story.module index 06ace2f70..dc557a4c5 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -193,9 +193,9 @@ function story_block() { $content .= "<LI><A HREF=\"node.php?id=$story->id\">". check_output($story->title) ."</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n"; } - $blocks[0]["subject"] = "Top 10:<BR>all stories"; - $blocks[0]["content"] = $content; - $blocks[0]["info"] = "Top 10: all stories"; + $blocks[0][subject] = "Top 10:<BR>all stories"; + $blocks[0][content] = $content; + $blocks[0][info] = "Top 10: all stories"; unset($content); @@ -204,9 +204,9 @@ function story_block() { $content .= "<LI><A HREF=\"node.php?id=$story->id\">". check_output($story->title) ."</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n"; } - $blocks[1]["subject"] = "Top 10:<BR>recent stories"; - $blocks[1]["content"] = $content; - $blocks[1]["info"] = "Top 10: recent stories"; + $blocks[1][subject] = "Top 10:<BR>recent stories"; + $blocks[1][content] = $content; + $blocks[1][info] = "Top 10: recent stories"; return $blocks; */ |