From 3f14fd77bf28a41266e34ec1ca900311ae1ed06b Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Thu, 2 May 2002 19:55:22 +0000 Subject: [PATCH] - small update .htaccess, fixed the blog link. - some interface changes in block admin page. --- .htaccess | 2 +- modules/block.module | 17 ++++++++++------- modules/block/block.module | 17 ++++++++++------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.htaccess b/.htaccess index 3b27a5a5b16..cf82514913f 100644 --- a/.htaccess +++ b/.htaccess @@ -35,7 +35,7 @@ ErrorDocument 500 /error.php # Various rewrite rules RewriteEngine on - RewriteRule ^blog/(.*) /module.php?mod=blog\&op=view\&name=$1 [R] + RewriteRule ^blog/(.*) /module.php?mod=blog\&name=$1 [R] # $Id$ diff --git a/modules/block.module b/modules/block.module index 011c777d8d3..85d8413f4c8 100644 --- a/modules/block.module +++ b/modules/block.module @@ -71,12 +71,10 @@ function block_admin_display() { // Generate output: $output = "\n"; - $output .= "\n"; + $output .= "\n"; while ($block = db_fetch_object($result)) { - for ($count = 0; $count < 10; $count++) { - $weights[$count] = $count; - } + $weights = array(0 => 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); $output .= ''; //$output .= ''; @@ -177,18 +175,23 @@ function block_box_form($edit = array()) { function block_box_save($edit) { if ($edit["bid"]) { db_query("UPDATE boxes SET title = '%s', body = '%s', info = '%s', type = '%s' WHERE bid = '%s'", $edit["title"], $edit["body"], $edit["info"], $edit["type"], $edit["bid"]); - return "Block updated."; + return "block updated."; } else { db_query("INSERT INTO boxes (title, body, info, type) VALUES ('%s', '%s', '%s', '%s')", $edit["title"], $edit["body"], $edit["info"], $edit["type"]); - return "Block added."; + if (db_error()) { + return "block added."; + } + else { + return "failed to add block."; + } } } function block_box_delete($bid) { if ($bid) { db_query("DELETE FROM boxes WHERE bid = '%s'", $bid); - return "Block deleted."; + return "block deleted."; } } diff --git a/modules/block/block.module b/modules/block/block.module index 011c777d8d3..85d8413f4c8 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -71,12 +71,10 @@ function block_admin_display() { // Generate output: $output = "
blockmodulestatuscustomweightregionpath
blockmodulestatuscustomweightregionpathoperations
'. la($block->name, array("mod" => "block", "op" => "view", "id" => $block->delta), t("View the block details")) .'
\n"; - $output .= "\n"; + $output .= "\n"; while ($block = db_fetch_object($result)) { - for ($count = 0; $count < 10; $count++) { - $weights[$count] = $count; - } + $weights = array(0 => 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); $output .= ''; //$output .= ''; @@ -177,18 +175,23 @@ function block_box_form($edit = array()) { function block_box_save($edit) { if ($edit["bid"]) { db_query("UPDATE boxes SET title = '%s', body = '%s', info = '%s', type = '%s' WHERE bid = '%s'", $edit["title"], $edit["body"], $edit["info"], $edit["type"], $edit["bid"]); - return "Block updated."; + return "block updated."; } else { db_query("INSERT INTO boxes (title, body, info, type) VALUES ('%s', '%s', '%s', '%s')", $edit["title"], $edit["body"], $edit["info"], $edit["type"]); - return "Block added."; + if (db_error()) { + return "block added."; + } + else { + return "failed to add block."; + } } } function block_box_delete($bid) { if ($bid) { db_query("DELETE FROM boxes WHERE bid = '%s'", $bid); - return "Block deleted."; + return "block deleted."; } }
blockmodulestatuscustomweightregionpath
blockmodulestatuscustomweightregionpathoperations
'. la($block->name, array("mod" => "block", "op" => "view", "id" => $block->delta), t("View the block details")) .'