diff --git a/.htaccess b/.htaccess
index da62b769b9feb57d10a1bfb161b12d5c7b3cd128..bf99349f47c365b56adcdc128ec6ea95f298955e 100644
--- a/.htaccess
+++ b/.htaccess
@@ -32,10 +32,9 @@ ErrorDocument 500 /error.php
    php_value magic_quotes_gpc        1
    php_value magic_quotes_runtime    0
    php_value magic_quotes_sybase     0
-   php_value session.name            DROPID
    php_value session.auto_start      0
    php_value session.cookie_lifetime 2000000
    php_value session.gc_maxlifetime  2000000
    php_value session.cache_expire    200000
-   php_value session.save_path       /tmp/dropsessions
+   # php_value session.save_path       /tmp/dropsessions
 </IfModule>
diff --git a/LICENSE b/LICENSE
index 408ac31b4f323b8d348e68881bb13309f599c4f9..2c095c8d3f42488e8168f9710a4ffbfc4125a159 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,12 +1,12 @@
 GNU GENERAL PUBLIC LICENSE
 
-							Version 2, June 1991
+              Version 2, June 1991
 
 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
 Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
 verbatim copies of this license document, but changing it is not allowed.
 
-								  Preamble
+                  Preamble
 
 The licenses for most software are designed to take away your freedom to
 share and change it. By contrast, the GNU General Public License is
@@ -53,9 +53,9 @@ free use or not licensed at all.
 The precise terms and conditions for copying, distribution and modification
 follow.
 
-				   GNU GENERAL PUBLIC LICENSE
+           GNU GENERAL PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
-							 MODIFICATION
+               MODIFICATION
 
 0. This License applies to any program or other work which contains a notice
 placed by the copyright holder saying it may be distributed under the terms
@@ -242,7 +242,7 @@ exceptions for this. Our decision will be guided by the two goals of
 preserving the free status of all derivatives of our free software and of
 promoting the sharing and reuse of software generally.
 
-							 NO WARRANTY
+               NO WARRANTY
 
 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
@@ -271,4 +271,4 @@ PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
 IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
 THE POSSIBILITY OF SUCH DAMAGES.
 
-				  END OF TERMS AND CONDITIONS
+          END OF TERMS AND CONDITIONS
diff --git a/account.php b/account.php
index 1723b0abf29d1bd6e6073359e0feb1cbc4d06e83..2528c17f270e401c391b81d62a3aff7961df35a0 100644
--- a/account.php
+++ b/account.php
@@ -1,6 +1,6 @@
 <?
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 function account_get_user($uname) {
   $result = db_query("SELECT * FROM users WHERE userid = '$uname'");
@@ -56,7 +56,6 @@ function account_session_start($userid, $passwd) {
 
   $user = new User($userid, $passwd);
   if ($user->id) {
-    session_start();
     session_register("user");
     watchdog("message", "session opened for user `$user->userid'");
   }
diff --git a/admin.php b/admin.php
index a8658cdf46be0d300c206f5261836b25a90d40ff..74d575ed1fb67bd23e35544fbf187c7027935416 100644
--- a/admin.php
+++ b/admin.php
@@ -1,9 +1,9 @@
 <?
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 // validate user permission:
-if (!($user->permissions == 1 || $user->id == 1)) exit();
+if (!user_permission($user)) exit();
 
 function admin_page($mod) {
   global $repository, $site_name, $menu, $modules;
diff --git a/cron.php b/cron.php
index 141580f2c11a7a5aa60e33b0ef6efc97d30214c8..9b3eb831db3cd6b9e5fd403310defb8a33aacf6a 100644
--- a/cron.php
+++ b/cron.php
@@ -1,6 +1,6 @@
 <?
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 function cron_run() {
   global $repository;
diff --git a/database/database.mysql b/database/database.mysql
index 362b7dff695e685212af9f986e5edd1309b667b7..a6b22c6d250c210aeeca605feea7b292a9ddea8d 100644
--- a/database/database.mysql
+++ b/database/database.mysql
@@ -15,6 +15,7 @@ CREATE TABLE blocks (
   status tinyint(2) DEFAULT '0' NOT NULL,
   weight tinyint(1) DEFAULT '0' NOT NULL,
   region tinyint(1) DEFAULT '0' NOT NULL,
+  remove tinyint(1) DEFAULT '0' NOT NULL,
   PRIMARY KEY (name)
 );
 
diff --git a/error.php b/error.php
index 5aaf456abea853f28f31b7ed81cab983065fa6ee..9f7fd08d313349cc6c37914f93a55d847d6f147c 100644
--- a/error.php
+++ b/error.php
@@ -39,7 +39,7 @@ function error_httpd() {
   print "</PRE>\n";
 }
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 switch ($op) {
   case "flood":
diff --git a/export b/export
index ba89b23bae6765ab931287189b9e9be0b47429e9..071b87501debef55fe5082f1b85e009d9e4a694f 100644
--- a/export
+++ b/export
@@ -1,10 +1,10 @@
 <?
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 function export($name, $module) {
   global $REQUEST_URI;
-  module_execute($name, "export", explode("/", $REQUEST_URI));
+  module_execute($name, "export", explode("/", strrchr($REQUEST_URI, "/export")));
 }
 
 module_iterate("export");
diff --git a/includes/comment.inc b/includes/comment.inc
index 6e39ee2ba37e134626aefcc5f39574cac3d14d52..4f9ee3ac501d79e57cba8d8764b6a4eddc37a460 100644
--- a/includes/comment.inc
+++ b/includes/comment.inc
@@ -8,7 +8,7 @@
 
 $cmodes = array(1 => "List - min", 2 => "List - max", 3 => "Threaded - min", 4 => "Threaded - max");
 $corder = array(1 => "Date - new", 2 => "Date - old", 3 => "Rate - high", 4 => "Rate - low");
-$link = ($mod) ? $mod : substr($PHP_SELF, 1, strlen($PHP_SELF) - 5);
+$link = ($mod) ? $mod : substr(strrchr($PHP_SELF, "/"), 1, strrchr($PHP_SELF, "/") - 4);
 
 class Comment {
   function Comment($userid, $subject, $comment, $timestamp, $url, $fake_email, $score, $votes, $cid, $lid) {
@@ -32,12 +32,12 @@ function comment_moderate($moderate) {
     $none = $comment_votes[key($comment_votes)];
 
     foreach ($moderate as $id=>$vote) {
-      if ($vote != $comment_votes[$none] && !user_getHistory($user->history, "c$id")) {
+      if ($vote != $comment_votes[$none] && !user_get_history($user->history, "c$id")) {
         // Update the comment's score:
         $result = db_query("UPDATE comments SET score = score $vote, votes = votes + 1 WHERE cid = $id");
 
         // Update the user's history:
-        user_setHistory($user, "c$id", $vote);
+        user_set_history("c$id", $vote);
       }
     }
   }
@@ -54,7 +54,7 @@ function comment_settings($mode, $order, $threshold) {
 }
 
 function comment_reply($pid, $id) {
-  global $allowed_html, $link, $theme, $user;
+  global $allowed_html, $link, $REQUEST_URI, $theme, $user;
 
   // Extract parent-information/data:
   if ($pid) {
@@ -70,7 +70,7 @@ function comment_reply($pid, $id) {
   }
 
   // Build reply form:
-  $output .= "<FORM ACTION=\"". comment_uri() ."\" METHOD=\"post\">\n";
+  $output .= "<FORM ACTION=\"$REQUEST_URI\" METHOD=\"post\">\n";
 
   // Name field:
   $output .= "<P>\n";
@@ -105,13 +105,13 @@ function comment_reply($pid, $id) {
 }
 
 function comment_preview($pid, $id, $subject, $comment) {
-  global $allowed_html, $link, $theme, $user;
+  global $allowed_html, $link, $REQUEST_URI, $theme, $user;
 
   // Preview comment:
   $theme->comment(new Comment($user->userid, $subject, $comment, time(), $user->url, $user->fake_email, 0, 0, 0, 0), "reply to this comment");
 
   // Build reply form:
-  $output .= "<FORM ACTION=\"". comment_uri() ."\" METHOD=\"post\">\n";
+  $output .= "<FORM ACTION=\"$REQUEST_URI\" METHOD=\"post\">\n";
 
   // Name field:
   $output .= "<P>\n";
@@ -160,7 +160,6 @@ function comment_post($pid, $id, $subject, $comment) {
 
   if ($duplicate != 0) {
     watchdog("error", "comment: attempt to insert duplicate comment");
-    $theme->box("duplicate comment", "duplicate comment: $duplicate");
   }
   else {
     // Validate subject:
@@ -171,9 +170,6 @@ function comment_post($pid, $id, $subject, $comment) {
 
     // Add comment to database:
     db_query("INSERT INTO comments (link, lid, pid, author, subject, comment, hostname, timestamp, score) VALUES ('". check_input($link) ."', $id, $pid, '$user->id', '". check_input($subject) ."', '". check_input($comment) ."', '". getenv("REMOTE_ADDR") ."', '". time() ."', '". ($user->userid ? 1 : 0) ."')");
-
-    // Compose header:
-    header("Location: ". comment_uri("id=$id"));
   }
 }
 
@@ -203,7 +199,7 @@ function comment_moderation($comment) {
   if ($op == "reply") {
     $output .= "&nbsp;";
   }
-  else if ($user->id && $user->userid != $comment->userid && !user_getHistory($user->history, "c$comment->cid")) {
+  else if ($user->id && $user->userid != $comment->userid && !user_get_history($user->history, "c$comment->cid")) {
     $output .= "<SELECT NAME=\"moderate[$comment->cid]\">\n";
     foreach ($comment_votes as $key=>$value) $output .= " <OPTION VALUE=\"$value\">$key</OPTION>\n";
     $output .= "</SELECT>\n";
@@ -282,8 +278,8 @@ function comment_uri($args = 0) {
 
 function comment_link($comment, $return = 1) {
   global $link, $theme;
-  if ($return) return "<A HREF=\"". comment_uri("id=$comment->lid#$comment->cid") ."\"><FONT COLOR=\"$theme->hlcolor2\">return</FONT></A> | <A HREF=\"". comment_uri("op=reply&id=$comment->lid&pid=$comment->cid") ."\"><FONT COLOR=\"$theme->hlcolor2\">reply to this comment</FONT></A>";
-  else return "<A HREF=\"". comment_uri("op=reply&id=$comment->lid&pid=$comment->cid") ."\"><FONT COLOR=\"$theme->hlcolor2\">reply to this comment</FONT></A>";
+  if ($return) return "<A HREF=\"". comment_uri("id=$comment->lid#$comment->cid") ."\"><FONT COLOR=\"$theme->link\">return</FONT></A> | <A HREF=\"". comment_uri("op=reply&id=$comment->lid&pid=$comment->cid") ."\"><FONT COLOR=\"$theme->link\">reply to this comment</FONT></A>";
+  else return "<A HREF=\"". comment_uri("op=reply&id=$comment->lid&pid=$comment->cid") ."\"><FONT COLOR=\"$theme->link\">reply to this comment</FONT></A>";
 }
 
 function comment_comment($comment, $folded = 0) {
diff --git a/includes/common.inc b/includes/common.inc
index 392fc474bfe73cbdb9c8fd9db24c16f0c0562a1a..f5ebc09d6f58821a062caf463bbb8536da5876df 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1,7 +1,17 @@
 <?
 
-$cf = strtr($HTTP_HOST ."". substr($REQUEST_URI, 0, strrpos($REQUEST_URI, "/")), "/:", "..");
-include_once "includes/$cf.conf";
+function conf_load() {
+  global $HTTP_HOST, $REQUEST_URI;
+  $file = strtr($HTTP_HOST ."". substr($REQUEST_URI, 0, strrpos($REQUEST_URI, "/")), "/:", "..");
+  while ($file && !file_exists("includes/$file.conf")) {
+    $file = substr($file, 0, strrpos($file, "."));
+  }
+  return $file;
+}
+
+$conf = conf_load();
+
+include_once "includes/$conf.conf";
 include_once "includes/database.inc";
 include_once "includes/watchdog.inc";
 include_once "includes/function.inc";
@@ -10,7 +20,7 @@
 include_once "includes/theme.inc";
 include_once "includes/user.inc";
 
-session_start();
+user_load();
 
 $theme = theme_load();
 
diff --git a/includes/hostname.conf b/includes/hostname.conf
index 62e4ae02a9d8b84a3a7510f696f7da45b157f420..e9b597b2e95e8847a70a34d7309983a6cc7da2a8 100644
--- a/includes/hostname.conf
+++ b/includes/hostname.conf
@@ -16,7 +16,6 @@ $site_name = "site name";
 $site_url  = "http://yourdomain.com/";
 $site_email = "info@yourdomain.com";
 
-
 #
 # Comment votes:
 #   the keys of this associative array are displayed in each
diff --git a/includes/module.inc b/includes/module.inc
index 6c11a358d084b4fcdd174dab2030e98f3ebea7eb..c339ee8f715ee296440661f8af1afac2f160058d 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -24,12 +24,18 @@ function module_rehash_crons($name, $module) {
 }
 
 function module_rehash_blocks($name, $module) {
-  db_query("DELETE FROM blocks WHERE module = '$name'");
+  db_query("UPDATE blocks SET remove = '1' WHERE module = '$name'");
   if ($module["block"] && $blocks = $module["block"]()) {
     foreach ($blocks as $offset=>$block) {
-      db_query("INSERT INTO blocks (name, module, offset) VALUES ('". check_input($block["info"]) ."', '". check_input($name) ."', '". check_input($offset) ."')");
+      if (!db_fetch_object(db_query("SELECT * FROM blocks WHERE module = '$name' AND name = '". check_input($block["info"]) ."'"))) {
+        db_query("INSERT INTO blocks (name, module, offset) VALUES ('". check_input($block["info"]) ."', '". check_input($name) ."', '". check_input($offset) ."')");
+      }
+      else {
+        db_query("UPDATE blocks SET offset = '". check_input($offset) ."', remove = '0' WHERE module = '$name' AND name = '". check_input($block["info"]) ."'");
+      }
     }
   }
+  db_query("DELETE FROM blocks WHERE module = '$name' AND remove = '1'");
 }
 
 function module_rehash($name) {
diff --git a/includes/story.inc b/includes/story.inc
index 2ec39ca1680513344fa124996a1636550465e092..a1ba62796be5d2d4630e2db076776e6ea67e7908 100644
--- a/includes/story.inc
+++ b/includes/story.inc
@@ -11,4 +11,9 @@ function Story($userid, $subject, $abstract, $article, $section, $timestamp) {
   }
 }
 
+function story_visible($story) {
+  global $user;
+  return ($story->status == 1 && $user->id) || ($story->status == 2) || user_permission();
+}
+
 ?>
\ No newline at end of file
diff --git a/includes/submission.inc b/includes/submission.inc
index 2b3cf7ebdf9d4fc5d972a026a6831ac2081d1796..78027c1099a7a3d3de4288012d45a2e199bd164c 100644
--- a/includes/submission.inc
+++ b/includes/submission.inc
@@ -13,7 +13,7 @@ function submission_score($id) {
 function submission_vote($id, $vote, $comment) {
   global $user;
 
-  if (!user_getHistory($user->history, "s$id")) {
+  if (!user_get_history($user->history, "s$id")) {
     // Update submission's score- and votes-field:
     db_query("UPDATE stories SET score = score $vote, votes = votes + 1 WHERE id = $id");
 
@@ -24,7 +24,7 @@ function submission_vote($id, $vote, $comment) {
     }
 
     // Update user's history record:
-    user_setHistory($user, "s$id", $vote);
+    user_set_history("s$id", $vote);
 
     // Update story table (if required):
     $result = db_query("SELECT * FROM stories WHERE id = $id");
diff --git a/includes/theme.inc b/includes/theme.inc
index f46c29e0bd440321d8de952ba5643d6c53d3b4ef..e54de391c0b61a8c92f400a030940340d00bb371 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -41,7 +41,7 @@ function menu($name, $module) {
     $content .= "<LI><A HREF=\"account.php?op=edit&topic=content\">edit site content</A></LI>\n";
     $content .= "<P>\n";
 
-    if (($user->id) && ($user->permissions == 1 || $user->id == 1)) {
+    if (user_permission($user)) {
       $content .= "<LI><A HREF=\"admin.php\">administer ". $site_name ."</A></LI>\n";
       $content .= "<P>\n";
     }
@@ -91,16 +91,16 @@ function theme_blocks($region, $theme) {
 }
 
 function theme_morelink($theme, $story) {
-  return ($story->article) ? "[ <A HREF=\"story.php?id=$story->id\"><FONT COLOR=\"$theme->hlcolor2\"><B>read more</B></FONT></A> | ". strlen($story->article) ." bytes | <A HREF=\"story.php?id=$story->id\"><FONT COLOR=\"$theme->hlcolor2\">". format_plural($story->comments, "comment", "comments") ."</FONT></A> ]" : "[ <A HREF=\"story.php?id=$story->id\"><FONT COLOR=\"$theme->hlcolor2\">". format_plural($story->comments, "comment", "comments") ."</FONT></A> ]";
+  return ($story->article) ? "[ <A HREF=\"story.php?id=$story->id\"><FONT COLOR=\"$theme->link\"><B>read more</B></FONT></A> | ". strlen($story->article) ." bytes | <A HREF=\"story.php?id=$story->id\"><FONT COLOR=\"$theme->link\">". format_plural($story->comments, "comment", "comments") ."</FONT></A> ]" : "[ <A HREF=\"story.php?id=$story->id\"><FONT COLOR=\"$theme->link\">". format_plural($story->comments, "comment", "comments") ."</FONT></A> ]";
 }
 
 function theme_moderation_results($theme, $story) {
   global $user;
 
-  if ($user->id && $story->id && ($user->id == $story->author || user_getHistory($user->history, "s$story->id"))) {
+  if ($user->id && $story->id && ($user->id == $story->author || user_get_history($user->history, "s$story->id"))) {
     $result = db_query("SELECT * FROM users WHERE history LIKE '%s$story->id%'");
     while ($account = db_fetch_object($result)) {
-      $output .= format_username($account->userid) ." voted `". user_getHistory($account->history, "s$story->id") ."'.<BR>";
+      $output .= format_username($account->userid) ." voted `". user_get_history($account->history, "s$story->id") ."'.<BR>";
     }
 
     $theme->box("Moderation results", ($output ? $output : "This story has not been moderated yet."));
@@ -131,7 +131,6 @@ function theme_new_headlines($theme, $num = 10) {
   $content = "";
   $result = db_query("SELECT id, subject FROM stories WHERE status = 2 ORDER BY id DESC LIMIT $num");
   while ($story = db_fetch_object($result)) $content .= "<LI><A HREF=\"story.php?id=$story->id\">". check_output($story->subject) ."</A></LI>\n";
-  $content .= "<P ALIGN=\"right\">[ <A HREF=\"search.php\"><FONT COLOR=\"$theme->hlcolor2\">more</FONT></A> ]</P>";
   $theme->box("Latest headlines", $content);
 }
 
@@ -148,8 +147,6 @@ function theme_old_headlines($theme, $num = 10) {
     }
     $content .= "<LI><A HREF=\"story.php?id=$story->id\">". check_output($story->subject) ."</A></LI>\n";
   }
-  $content .= "<P ALIGN=\"right\">[ <A HREF=\"search.php\"><FONT COLOR=\"$theme->hlcolor2\">more</FONT></A> ]</P>";
-
   $theme->box("Older headlines", $content);
 }
 
diff --git a/includes/user.inc b/includes/user.inc
index 90e1dc1e80994984a0525e96370edd23736ff283..65a891cb9d5c5fec1304b1b341a58a5f9104486f 100644
--- a/includes/user.inc
+++ b/includes/user.inc
@@ -1,7 +1,13 @@
 <?
 
 class User {
-  function User($userid, $passwd = "") {
+  function User($userid) {
+    $result = db_query("SELECT * FROM users WHERE userid = '$userid' && STATUS = 2");
+    if (db_num_rows($result) == 1) {
+      foreach (db_fetch_row($result) as $key=>$value) { $field = mysql_field_name($result, $key); $this->$field = stripslashes($value); $this->field[] = $field; }
+    }
+  }
+  function User($userid, $passwd) {
     $result = db_query("SELECT * FROM users WHERE LOWER(userid) = LOWER('$userid') && passwd = PASSWORD('$passwd') && STATUS = 2");
     if (db_num_rows($result) == 1) {
       foreach (db_fetch_row($result) as $key=>$value) { $field = mysql_field_name($result, $key); $this->$field = stripslashes($value); $this->field[] = $field; }
@@ -10,6 +16,12 @@ function User($userid, $passwd = "") {
   }
 }
 
+function user_load() {
+  global $db_name;
+  session_name($db_name);
+  session_start();
+}
+
 function user_save($data, $id = 0) {
   global $user;
 
@@ -29,7 +41,7 @@ function user_save($data, $id = 0) {
   }
 }
 
-function user_getHistory($history, $field) {
+function user_get_history($history, $field) {
   $data = explode(";", $history);
   for (reset($data); current($data); next($data)) {
     $entry = explode(":", current($data));
@@ -38,8 +50,8 @@ function user_getHistory($history, $field) {
   return $rval;
 }
 
-function user_setHistory(&$user, $field, $value) {
-
+function user_set_history($field, $value) {
+  global $user;
   $history = $user->history;
   if (!$value) {
     // remove entry:
@@ -71,4 +83,13 @@ function user_setHistory(&$user, $field, $value) {
   db_query($query);
 }
 
+function user_rehash() {
+  global $user;
+  if ($user->id) $user = new User($user->userid);
+}
+
+function user_permission($account) {
+  return ($account->permissions == 1 || $account->id == 1);
+}
+
 ?>
\ No newline at end of file
diff --git a/includes/watchdog.inc b/includes/watchdog.inc
index f50fab57e98fb7c15e6ba97dfe10582a70945d6a..6a5b66163dba1700bc6f8829d48cd479a8ffa88a 100644
--- a/includes/watchdog.inc
+++ b/includes/watchdog.inc
@@ -9,8 +9,8 @@
 
 function watchdog($id, $message) {
   global $user, $watchdog, $watchdog_history;
-
-  if ($watchdog[$id][1] && !($user->permissions == 1 || $user->id == 1)) {
+/*
+  if ($watchdog[$id][1] && !user_permission()) {
     if ($log = db_fetch_object(db_query("SELECT * FROM watchdog WHERE hostname = '". getenv("REMOTE_ADDR") ."' AND level = '". $watchdog[$id][0] ."'"))) {
       if (time() - $log->timestamp < $watchdog[$id][1]) {
         watchdog("warning", "'". getenv("REMOTE_ADDR") ."' exceeded '$id' submission rate");
@@ -19,6 +19,7 @@ function watchdog($id, $message) {
       }
     }
   }
+*/
 
   // Perform query to add new watchdog entry:
   db_query("INSERT INTO watchdog (level, timestamp, user, message, location, hostname) VALUES ('". $watchdog[$id][0] ."', '". time() ."', '". check_input($user->id) ."', '". check_input($message) ."', '". check_input(getenv("REQUEST_URI")) ."', '". check_input(getenv("REMOTE_ADDR")) ."')");
diff --git a/index.php b/index.php
index 924c157c42732dcf87b888a75b2b8daf1aa0aaae..57569098754b31cc0eceb0d8d178271e5b990373 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
 <?
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 // Initialize/pre-process variables:
 $number = ($user->stories) ? $user->stories : 10;
diff --git a/modules/account.module b/modules/account.module
index b4a278d2f26a996455e35c4a6c6f6594b13963d1..ddeada1c2ef40446c5bafd7faa3ae9dff9b66a74 100644
--- a/modules/account.module
+++ b/modules/account.module
@@ -51,13 +51,13 @@ function account_display($order = "username") {
     $output .= " <TR>\n";
     foreach ($show as $key=>$value) {
       switch($value = strtok($value, " ")) {
-  case "real_email":
+        case "real_email":
           $output .= "  <TD>". format_email($account[$value]) ."</TD>\n";
           break;
         case "last_access":
           $output .= "  <TD>". format_interval(time() - $account[$value]) ." ago</TD>\n";
           break;
-  case "status":
+        case "status":
           $output .= "  <TD ALIGN=\"center\">". $stat[$account[$value]] ."</TD>\n";
           break;
         case "permissions":
@@ -69,7 +69,7 @@ function account_display($order = "username") {
         case "url":
           $output .= "  <TD>". format_url($account[$value]) ."</TD>\n";
           break;
-  case "userid":
+        case "userid":
           $output .= "  <TD>". format_username($account[$value], 1) ."</TD>\n";
           break;
         default:
@@ -100,7 +100,7 @@ function account_comments($id) {
   return $output;
 }
 
-function account_save($name, $edit) {
+function account_edit_save($name, $edit) {
   foreach ($edit as $key=>$value) {
     $query .= "$key = '". addslashes($value) ."', ";
   }
@@ -195,7 +195,7 @@ function account_admin() {
       account_view($name);
       break;
     case "Save account":
-      account_save($name, $edit);
+      account_edit_save($name, $edit);
       account_view($name);
       break;
     case "Update":
diff --git a/modules/backend.class b/modules/backend.class
index 04e25520dde58a53a58e5322f5158d05510ebf94..2028c5d876aefed95647f2856d925176ff9bc863 100644
--- a/modules/backend.class
+++ b/modules/backend.class
@@ -37,7 +37,6 @@ class backend {
       while ($headline = db_fetch_object($result)) {
         array_push($this->headlines, "<A HREF=\"$headline->link\">$headline->title</A>");
       }
-
     }
     else {
       $this->site = $site;
@@ -94,9 +93,6 @@ class backend {
             $title = ereg_replace(".*<title>", "", $item);
             $title = ereg_replace("</title>.*", "", $title);
 
-            // Clean headlines:
-            $title = stripslashes($title);
-
             // Count the number of stories:
             $number += 1;
 
@@ -145,7 +141,6 @@ class backend {
       }
       // Add timestamp:
       $update = round((time() - $this->timestamp) / 60);
-      $content .= "<P ALIGN=\"right\">[ <A HREF=\"backend.php?op=reset&site=$this->site\"><FONT COLOR=\"$theme->hlcolor2\">reset</FONT></A> | updated $update min. ago ]</P>";
 
       // Display box:
       $theme->box("$this->site", $content);
diff --git a/modules/ban.module b/modules/ban.module
index b14dc492e1ade1ca7304e02868e90faa4c100af5..862077a470b8e8fedaf7fe8daca2bbdb6316e695 100644
--- a/modules/ban.module
+++ b/modules/ban.module
@@ -3,7 +3,7 @@
 $module = array("help" => "ban_help",
                 "admin" => "ban_admin");
 
-include "includes/ban.inc";
+include_once "includes/ban.inc";
 
 
 function ban_help() {
diff --git a/modules/cron.module b/modules/cron.module
index 54d55c41b5fa0ec567cc5c5877af80c377b2e334..cb3bbb1fa7c59351d19827db32fbe016592c5715 100644
--- a/modules/cron.module
+++ b/modules/cron.module
@@ -17,6 +17,13 @@ function cron_save($edit) {
   }
 }
 
+function cron_execute($name) {
+  global $repository;
+  watchdog("message", "cron: executed '". $name ."_cron()'");
+  $repository[$name]["cron"]();
+  db_query("UPDATE crons SET timestamp = ". time() ." WHERE module = '$name'");
+}
+
 function cron_display() {
   $intervals = array(300, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200);
 
@@ -29,7 +36,7 @@ function cron_display() {
   $output .= " <TR><TH>module</TH><TH>period</TH><TH>last execution</TH><TH>operations</TH></TR>\n";
   while ($cron = db_fetch_object($result)) {
     foreach ($intervals as $value) $period .= "<OPTION VALUE=\"$value\"". (($cron->scheduled == $value) ? " SELECTED" : "") .">every ". format_interval($value) ."</OPTION>\n";
-    $output .= " <TR><TD>". check_output($cron->module) ."</TD><TD><SELECT NAME=\"edit[$cron->module]\">$period</SELECT></TD><TD>". format_interval(time() - $cron->timestamp) ." ago</TD><TD ALIGN=\"center\"><A HREF=\"cron.php\">execute</A></TD></TR>\n";
+    $output .= " <TR><TD>". check_output($cron->module) ."</TD><TD><SELECT NAME=\"edit[$cron->module]\">$period</SELECT></TD><TD ALIGN=\"center\">". ($cron->timestamp ? format_interval(time() - $cron->timestamp) ." ago" : "never" )."</TD><TD ALIGN=\"center\"><A HREF=\"admin.php?mod=cron&op=execute&name=$cron->module\">execute</A></TD></TR>\n";
     unset($period);
   }
   $output .= "</TABLE>\n";
@@ -47,6 +54,10 @@ function cron_admin() {
     case "help":
       cron_help();
       break;
+    case "execute":
+      cron_execute($name);
+      cron_display();
+      break;
     case "Save crons":
       cron_save($edit);
       // fall through
diff --git a/modules/diary.module b/modules/diary.module
index 584a51b8aacfb8b62f39ad859d5fd81115ea2968..7b95f10729c64da036c15acab0f180650dfd32a7 100644
--- a/modules/diary.module
+++ b/modules/diary.module
@@ -8,7 +8,7 @@
                 "admin" => "diary_admin",
                 "export" => "diary_export");
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 function diary_page_overview($num = 20) {
   global $theme, $user;
diff --git a/modules/drupal.module b/modules/drupal.module
index 990080f0591b4e68fd5c41e3028b4912921908ee..8ece0a6d91051cab6abba7347951106a059674e1 100644
--- a/modules/drupal.module
+++ b/modules/drupal.module
@@ -50,6 +50,9 @@ function drupal_page() {
       break;
     case "Post comment":
       comment_post($pid, $id, $subject, $comment);
+      $theme->header();
+      drupal_render($id, $cid);
+      $theme->footer();
       break;
     case "reply":
       $theme->header();
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module
index 990080f0591b4e68fd5c41e3028b4912921908ee..8ece0a6d91051cab6abba7347951106a059674e1 100644
--- a/modules/drupal/drupal.module
+++ b/modules/drupal/drupal.module
@@ -50,6 +50,9 @@ function drupal_page() {
       break;
     case "Post comment":
       comment_post($pid, $id, $subject, $comment);
+      $theme->header();
+      drupal_render($id, $cid);
+      $theme->footer();
       break;
     case "reply":
       $theme->header();
diff --git a/modules/faq.module b/modules/faq.module
index d4c0b1d819abdb95ad713e8e580ab6be728457ca..811282a6113071df9b4d79747c4e45f6bef245ec 100644
--- a/modules/faq.module
+++ b/modules/faq.module
@@ -2,7 +2,7 @@
 
 $module = array("page" => "faq_page");
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 function faq_page() {
   global $theme, $site_name, $site_email;
diff --git a/modules/headline.module b/modules/headline.module
index 8bb89d31052d780a77dec7f5c3656dd929fb5740..306944cea47dd795107f13bbc5ca3338bbc67522 100644
--- a/modules/headline.module
+++ b/modules/headline.module
@@ -7,9 +7,8 @@
                 "admin" => "headline_admin",
                 "export" => "headline_export");
 
-include "includes/common.inc";
-include "modules/backend.class";
-
+include_once "includes/common.inc";
+include_once "modules/backend.class";
 
 function headline_blocks() {
   global $theme;
@@ -37,7 +36,7 @@ function headline_blocks() {
     }
 
     // Print backend box to screen:
-    $theme->box($backend->site, "$content<P ALIGN=\"right\">[ <A HREF=\"$backend->url\">more</A> ]\n");
+    $theme->box($backend->site, $content);
     print " </TD>\n";
 
     if ($state % 3 == 2) print " </TR>\n";
@@ -185,8 +184,7 @@ function headline_admin() {
 function headline_export($uri) {
   global $site_name, $site_url, $HTTP_REFERER, $HTTP_USER_AGENT;
 
-  if ($uri[2] == "headlines.rdf") {
-
+  if ($uri[1] == "headlines.rdf") {
     watchdog("message", "grabbed 'headlines.rdf' - referring url: $HTTP_REFERER - user agent: $HTTP_USER_AGENT");
 
     header("Content-Type: text/plain");
diff --git a/modules/module.module b/modules/module.module
index 9f905c1596ba8fa39db41e80925cbbbf55c4f650..4c32990f4bad7d5d6a1795edb5c3f7efabbdecc6 100644
--- a/modules/module.module
+++ b/modules/module.module
@@ -1,6 +1,13 @@
 <?
 
-$module = array("admin" => "module_admin");
+$module = array("help" => "module_help",
+                "admin" => "module_admin");
+
+function module_help() {
+ ?>
+  The module administration page provide you a list of all available modules.  Moreover, it allows you to "rehash" modules.  Whenever you install a new module or when an existing module has been changed or updated, it requires "rehasing": when you rehash a module, the module is registered to the engine and properly initialized.
+ <?
+}
 
 function module_admin_rehash() {
   global $repository;
@@ -41,16 +48,23 @@ function module_row($name, $module) {
 function module_admin() {
   global $op, $name;
 
+  print "<SMALL><A HREF=\"admin.php?mod=module\">overview</A> | <A HREF=\"admin.php?mod=module&op=help\">help</A></SMALL><HR>\n";
+
   switch ($op) {
-    case "Rehash modules":
-      module_admin_rehash();
+    case "help":
+      module_help();
       break;
     case "rehash":
       module_rehash($name);
+      module_admin_display();
       break;
+    case "Rehash modules":
+      module_admin_rehash();
+      module_admin_display();
+      break;
+    default:
+      module_admin_display();
   }
-
-  module_admin_display();
 }
 
 ?>
diff --git a/modules/section.module b/modules/section.module
index 36642f4183dbe015d66cbd3faa7ad91f9025f991..2ee5869d94b8da6ae954c7c4a019b46dc4f1e359 100644
--- a/modules/section.module
+++ b/modules/section.module
@@ -12,8 +12,8 @@
 
 function section_help() {
  ?>
-  <P>When submitting new stories, every story is assigned a section or category.  These sections can be maintained from the administration pages.</P>
-  <P>For moderation purpose, you can specify a post, dump and expiration thresholds for each available section according to type and urgency level a section.  Some section do not really "expire" and stay interesting and active as time passes by, whereas news-related stories are only considered "hot" over a short period of time.</P>
+  <P>When submitting new stories, every story is assigned a section or category.  Sections can be maintained from the administration pages.</P>
+  <P>For moderation purpose, you can specify a post, dump and expiration thresholds for each available section according to type and urgency level of a section.  This is useful considering the fact that some sections do not really "expire" and stay interesting and active as time passes by, whereas news-related stories are only considered "hot" over a short period of time.</P>
  <?
 }
 
@@ -113,7 +113,7 @@ function section_admin() {
 
   switch($op) {
     case "add":
-      section_add($edit);
+      section_add();
       break;
     case "help":
       section_help();
diff --git a/search.php b/search.php
index 64d703dd7e0c64940dd135b04166c9a63683f90d..f18c08e6c316f3d52e02322f2408b3da76254202 100644
--- a/search.php
+++ b/search.php
@@ -1,5 +1,5 @@
 <?
- include "includes/common.inc";
+ include_once "includes/common.inc";
 
  $theme->header();
 
diff --git a/story.php b/story.php
index fa2f7651e07e15a578c4e49d9c7acb188aac3c02..7f12e535f727b4a6ab23e3d97162bb35806b094c 100644
--- a/story.php
+++ b/story.php
@@ -1,18 +1,19 @@
 <?
 
-include "includes/common.inc";
+include_once "includes/common.inc";
+include_once "includes/story.inc";
 
 function story_render($id, $cid) {
   global $theme, $user;
 
-  $result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.status != 0 AND s.id = $id");
+  $story = db_fetch_object(db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.id = $id"));
 
-  if ($story = db_fetch_object($result)) {
+  if (story_visible($story)) {
     $theme->article($story, "[ <A HREF=\"story.php?op=reply&id=$id&pid=0\">reply to this story</A> ]");
     comment_render($id, $cid);
   }
   else {
-    $theme->box("Warning message", "The story you requested is no longer available or does not exist.");
+    $theme->box("Warning message", "The story you requested is not available or does not exist.");
   }
 }
 
@@ -24,6 +25,9 @@ function story_render($id, $cid) {
     break;
   case "Post comment":
     comment_post($pid, $id, $subject, $comment);
+    $theme->header();
+    story_render($id, $cid);
+    $theme->footer();
     break;
   case "Add comment":
     $theme->header();
diff --git a/submission.php b/submission.php
index 070aa196b804ced10698cd8da9bee547d547a067..481fbdc552671fe8ea07b1cdf98f54a8340efbf1 100644
--- a/submission.php
+++ b/submission.php
@@ -1,7 +1,7 @@
 <?
 
-include "includes/submission.inc";
-include "includes/common.inc";
+include_once "includes/submission.inc";
+include_once "includes/common.inc";
 
 function submission_display_main() {
   global $theme, $user;
@@ -13,8 +13,8 @@ function submission_display_main() {
   $content .= "<TABLE BORDER=\"0\" CELLSPACING=\"4\" CELLPADDING=\"4\">\n";
   $content .= " <TR BGCOLOR=\"$bgcolor1\"><TH>Subject</TH><TH>Section</TH><TH>Date</TH><TH>Author</TH><TH>Score</TH></TR>\n";
   while ($submission = db_fetch_object($result)) {
-    if ($user->id == $submission->author || user_getHistory($user->history, "s$submission->id")) $content .= " <TR><TD WIDTH=\"100%\"><A HREF=\"submission.php?op=view&id=$submission->id\">". stripslashes($submission->subject) ."</A></TD><TD>$submission->section</TD><TD ALIGN=\"center\">". date("Y-m-d", $submission->timestamp) ."<BR>". date("H:m:s", $submission->timestamp) ."</TD><TD ALIGN=\"center\">". format_username($submission->userid) ."</TD><TD ALIGN=\"center\">". submission_score($submission->id) ."</TD></TR>\n";
-    else $content .= " <TR><TD WIDTH=\"100%\"><A HREF=\"submission.php?op=view&id=$submission->id\">". stripslashes($submission->subject) ."</A></TD><TD>$submission->section</TD><TD ALIGN=\"center\">". date("Y-m-d", $submission->timestamp) ."<BR>". date("H:m:s", $submission->timestamp) ."</TD><TD ALIGN=\"center\">". format_username($submission->userid) ."</TD><TD ALIGN=\"center\"><A HREF=\"submission.php?op=view&id=$submission->id\">vote</A></TD></TR>\n";
+    if ($user->id == $submission->author || user_get_history($user->history, "s$submission->id")) $content .= " <TR><TD WIDTH=\"100%\"><A HREF=\"submission.php?op=view&id=$submission->id\">". check_output($submission->subject) ."</A></TD><TD>$submission->section</TD><TD ALIGN=\"center\">". date("Y-m-d", $submission->timestamp) ."<BR>". date("H:m:s", $submission->timestamp) ."</TD><TD ALIGN=\"center\">". format_username($submission->userid) ."</TD><TD ALIGN=\"center\">". submission_score($submission->id) ."</TD></TR>\n";
+    else $content .= " <TR><TD WIDTH=\"100%\"><A HREF=\"submission.php?op=view&id=$submission->id\">". check_output($submission->subject) ."</A></TD><TD>$submission->section</TD><TD ALIGN=\"center\">". date("Y-m-d", $submission->timestamp) ."<BR>". date("H:m:s", $submission->timestamp) ."</TD><TD ALIGN=\"center\">". format_username($submission->userid) ."</TD><TD ALIGN=\"center\"><A HREF=\"submission.php?op=view&id=$submission->id\">vote</A></TD></TR>\n";
   }
   $content .= "</TABLE>\n";
 
@@ -29,19 +29,19 @@ function submission_display_item($id) {
   $result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.id = $id");
   $submission = db_fetch_object($result);
 
-  if ($user->id == $submission->author || user_getHistory($user->history, "s$id")) {
+  if ($user->id == $submission->author || user_get_history($user->history, "s$id")) {
     header("Location: story.php?id=$id");
   }
   else {
     $theme->header();
-    $theme->article($submission, "[ <A HREF=\"submission.php\"><FONT COLOR=\"$theme->hlcolor2\">back</FONT></A> ]");
+    $theme->article($submission, "[ <A HREF=\"submission.php\"><FONT COLOR=\"$theme->link\">back</FONT></A> ]");
 
     print "<FORM ACTION=\"submission.php\" METHOD=\"post\">\n";
 
     print "<P>\n";
     print " <B>Vote:</B><BR>\n";
     print " <SELECT NAME=\"vote\">\n";
-    foreach ($submission_votes as $key=>$value) print "  <OPTION VALUE=\"$value\">". $key ."</OPTION>\n";
+    foreach ($submission_votes as $key=>$value) print "  <OPTION VALUE=\"$value\">$key</OPTION>\n";
     print " </SELECT>\n";
     print "</P>\n";
     print "<P>\n";
@@ -63,6 +63,9 @@ function submission_display_item($id) {
 }
 
 if ($user->id) {
+
+  user_rehash();
+
   switch($op) {
     case "view":
       submission_display_item($id);
diff --git a/submit.php b/submit.php
index baf1b941e575488eec7b50ad2b12fbd086297856..8e9e56967c99b3f31259e06f496bd16ca56fc1f7 100644
--- a/submit.php
+++ b/submit.php
@@ -132,7 +132,7 @@ function submit_submit($subject, $abstract, $article, $section) {
   $theme->footer();
 }
 
-include "includes/common.inc";
+include_once "includes/common.inc";
 
 switch($op) {
   case "Preview submission":
diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme
index 5451ad5c646df11cbea8506ba5d8bcf6bef5963f..287c8a524cc07329e234b5b335f0fe83e6b5cb58 100644
--- a/themes/marvin/marvin.theme
+++ b/themes/marvin/marvin.theme
@@ -1,6 +1,8 @@
 <?
 
  class Theme {
+   var $link = "#666699";
+
    // color set #1:
    var $bgcolor1 = "#EAEAEA";   // background color
    var $fgcolor1 = "#404040";   // table body color
@@ -40,7 +42,7 @@ function header() {
         <TD>&nbsp;</TD>
        </TR>
        <TR>
-        <TD ALIGN="right" COLSPAN="2"><SMALL><A HREF="/">home</A> | <A HREF="module.php?mod=faq">faq</A> | <A HREF="module.php?mod=diary">diary</A> | <A HREF="search.php">search</A> | <A HREF="submit.php">submit news</A> | <A HREF="account.php">user account</A></SMALL></TD>
+        <TD ALIGN="right" COLSPAN="2"><SMALL><A HREF="index.php">home</A> | <A HREF="module.php?mod=faq">faq</A> | <A HREF="module.php?mod=diary">diary</A> | <A HREF="search.php">search</A> | <A HREF="submit.php">submit news</A> | <A HREF="account.php">user account</A></SMALL></TD>
        </TR>
        <TR>
         <TD VALIGN="top" WIDTH="100%">
@@ -182,7 +184,7 @@ function footer() {
       </TR>
       <TR>
        <TD ALIGN="center" COLSPAN="3">
-        <SMALL>[ <A HREF="/">home</A> | <A HREF="module.php?mod=faq">faq</A> | <A HREF="module.php?mod=diary">diary</A> | <A HREF="search.php">search</A> | <A HREF="submit.php">submit news</A> | <A HREF="account.php">user account</A> ]</SMALL>
+        <SMALL>[ <A HREF="index.php">home</A> | <A HREF="module.php?mod=faq">faq</A> | <A HREF="module.php?mod=diary">diary</A> | <A HREF="search.php">search</A> | <A HREF="submit.php">submit news</A> | <A HREF="account.php">user account</A> ]</SMALL>
        </TD>
       </TR>
      </TABLE>
diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme
index ee6e308abfa160213bd1563c2d868380b0f6a548..01f2834a7a9871746b54945ceadd7eeb1b6edc4d 100644
--- a/themes/unconed/unconed.theme
+++ b/themes/unconed/unconed.theme
@@ -1,6 +1,7 @@
 <?
 
  class Theme {
+   var $link = "#000000";
    var $themename = "unconed";
 
    var $cl80 = "#8B8E95";
diff --git a/updates/1.00-to-1.xx b/updates/1.00-to-1.xx
index 8c2c20bf135e5ec1dde9ff960bbdbbb4746f9c80..b115a3845d6079c93827e26d769b391b923935d7 100644
--- a/updates/1.00-to-1.xx
+++ b/updates/1.00-to-1.xx
@@ -7,3 +7,6 @@ update comments set link = 'article';
 
 # 21/01/2001: section manager
 alter table stories change category section varchar(64) DEFAULT '' NOT NULL;
+
+# 31/01/2001: block rehashing
+alter table blocks add remove tinyint(1) DEFAULT '0' NOT NULL;