summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--account.php4
-rw-r--r--error.php4
-rw-r--r--includes/hostname.conf3
-rw-r--r--includes/user.inc2
-rw-r--r--includes/watchdog.inc3
-rw-r--r--modules/account.module2
-rw-r--r--modules/rating.module9
-rw-r--r--modules/section.module6
-rw-r--r--modules/story.module12
-rw-r--r--modules/story/story.module12
-rw-r--r--node.php1
11 files changed, 29 insertions, 29 deletions
diff --git a/account.php b/account.php
index 3810aca05..709ebc0af 100644
--- a/account.php
+++ b/account.php
@@ -226,8 +226,8 @@ function account_user($uname) {
function module($name, $module, $username) {
global $theme;
- if ($module["account"] && $block = $module["account"]($username, "account", "view")) {
- if ($block["content"]) $theme->box($block["subject"], $block["content"]);
+ if ($module[account] && $block = $module[account]($username, "account", "view")) {
+ if ($block[content]) $theme->box($block[subject], $block[content]);
}
}
diff --git a/error.php b/error.php
index 11a61dfa2..f4ffc1f52 100644
--- a/error.php
+++ b/error.php
@@ -7,7 +7,7 @@ function error_flood() {
}
function error_httpd() {
- global $REDIRECT_STATUS, $REDIRECT_URL, $HTTP_REFERER, $HTTP_USER_AGENT, $site_url;
+ global $REDIRECT_STATUS, $REDIRECT_URL, $HTTP_REFERER, $HTTP_USER_AGENT;
switch($REDIRECT_STATUS) {
case 500:
@@ -35,7 +35,7 @@ function error_httpd() {
print "<H1>Oops, an error occured!</H1>\n";
print "<B>Processed output:</B><BR>\n";
print " * $message<BR>\n";
- print " * Return to the <A HREF=\"$site_url\">main page</A>.\n";
+ print " * Return to the <A HREF=\"index.php\">main page</A>.\n";
print "</PRE>\n";
}
diff --git a/includes/hostname.conf b/includes/hostname.conf
index dff4d0732..3d55ddcd3 100644
--- a/includes/hostname.conf
+++ b/includes/hostname.conf
@@ -70,8 +70,7 @@ $moderation_votes = array("neutral (+0)" => "+ 0",
# Example: '"comment" => 60' means that there is only one new comment allowed from the same IP-address every 60 seconds.
#
$submission_rate = array("comment" => "60", // 60 seconds = 1 minute
- "diary" => "300", // 300 seconds = 5 minutes
- "story" => "300"); // 300 seconds = 5 minutes
+ "node" => "300") // 300 seconds = 5 minutes
#
# Submission size:
diff --git a/includes/user.inc b/includes/user.inc
index ad73efa8b..ce5820023 100644
--- a/includes/user.inc
+++ b/includes/user.inc
@@ -41,7 +41,7 @@ function user_save($account, $array) {
else db_query("INSERT INTO users SET $query last_access = '". time() ."', last_host = '$GLOBALS[REMOTE_ADDR]'");
// return account:
- return user_load(($account->userid ? $account->userid : $array["userid"]));
+ return user_load(($account->userid ? $account->userid : $array[userid]));
}
function user_get($account, $column, $field) {
diff --git a/includes/watchdog.inc b/includes/watchdog.inc
index 4512be755..2d221c842 100644
--- a/includes/watchdog.inc
+++ b/includes/watchdog.inc
@@ -1,8 +1,7 @@
<?php
$watchdog = array("comment" => array("0", $submission_rate["comment"]),
- "diary" => array("1", $submission_rate["diary"]),
- "story" => array("2", $submission_rate["story"]),
+ "node" => array("1", $submission_rate["node"]),
"message" => array("3", "0"),
"warning" => array("4", "0"),
"error" => array("5", "0"));
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;
*/
diff --git a/node.php b/node.php
index ca65a800c..0bb55f635 100644
--- a/node.php
+++ b/node.php
@@ -27,6 +27,7 @@ if ($node && node_visible($node)) {
$theme->footer();
break;
default:
+ if ($user->id) user_load($user->userid);
node_view($node, 1);
}
}