From fd64164419060f4420ece6c7766c5693577f67ef Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 29 Dec 2000 11:00:56 +0000 Subject: Surprise, surprise. After nothing but code, a large batch of changes: - removed droplets - added (optional) admin_blocks module - added (optional) affiliate module - added (optional) about module (only placeholder, under construction) - fixed some tiny bugs (e.g. quote bug in search.php) - partionally rewrote some modules to be big, bad and better - partionally rewrote some modules to be more uniform - added GNU GPL license to CVS Also: - installed PHP 4.0.4 on my localhost and now working towards PHP 4.0.4 compatibility. - I think I'll baptize the engine "drupal". If you have a better idea, try convincing me ASAP. Todo: - more testing (also with PHP 4.0.4) - make "project"-module: download, info, blah blah - complete documentation --- includes/common.inc | 1 - includes/droplet.inc | 22 ---------------------- includes/theme.inc | 14 +++++++++++--- 3 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 includes/droplet.inc (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 7886b9b65..f077658ee 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -4,7 +4,6 @@ include_once "includes/". getenv("HTTP_HOST") .".conf"; include_once "includes/database.inc"; include_once "includes/watchdog.inc"; include_once "includes/function.inc"; -include_once "includes/droplet.inc"; include_once "includes/module.inc"; include_once "includes/theme.inc"; include_once "includes/user.inc"; diff --git a/includes/droplet.inc b/includes/droplet.inc deleted file mode 100644 index 3f1f3b209..000000000 --- a/includes/droplet.inc +++ /dev/null @@ -1,22 +0,0 @@ -code); - } - else { - watchdog("error", "droplet '$name' does not exist"); - } -} - -function droplet_add($name, $help, $code, $message = "") { - $result = db_query("INSERT INTO droplets (name, help, code) VALUES ('". check_input($name) ."', '". check_input($help) ."', '". check_code($code) ."')"); -} - -function droplet_delete($id) { - $result = db_query("DELETE FROM droplets WHERE id = $id"); -} - -?> diff --git a/includes/theme.inc b/includes/theme.inc index fd842e68a..7c93ec775 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -45,7 +45,7 @@ function theme_account($theme) { function theme_main_blocks($theme) { - global $PHP_SELF, $user, $id; + global $id, $PHP_SELF, $user; switch (strtok($PHP_SELF, ".")) { case "/discussion": @@ -53,6 +53,14 @@ function theme_main_blocks($theme) { if ($story->status == 1) theme_moderation_results($theme, $story); else theme_new_headlines($theme); break; + case "/index": + theme_account($theme); + $result = db_query("SELECT * FROM blocks WHERE status = 2"); + while ($block = db_fetch_object($result)) { + $blocks = module_execute($block->module, "block"); + $theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]); + } + break; default: theme_account($theme); } @@ -63,8 +71,8 @@ function theme_user_blocks($theme) { if ($user->id && strstr($PHP_SELF, "index.php")) { $result = db_query("SELECT * FROM layout l LEFT JOIN blocks b ON l.block = b.name WHERE l.user = '$user->id' AND l.weight > 0 AND b.status = '1' ORDER BY weight"); while ($block = db_fetch_object($result)) { - $blocks = module_execute($block->module, "block"); - $theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]); + $blocks = module_execute($block->module, "block"); + $theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]); } } } -- cgit v1.2.3