From 0cce47f15f21f59ec77de41c76cf13eb2b2f4f74 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 28 Sep 2001 16:20:55 +0000 Subject: - fixed small glitch in node_del() - fixed small glitch in comment_del() - changed the API of the form() function. The first parameter, the "action"-attribute in the
-tag has been made optional. By default, it will be set to "$REQUEST_URI". Why? Because in 98% of the cases we would do: global $REQUEST_URI; $form = form($REQUEST_URI, $form_content); while we can do: $form = form($form_content); now. Update your modules (and sorry for the inconvenience)! --- includes/comment.inc | 7 +++---- includes/common.inc | 6 ++++-- includes/node.inc | 3 ++- includes/search.inc | 5 +---- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'includes') diff --git a/includes/comment.inc b/includes/comment.inc index 274c6e7be..161c0c758 100644 --- a/includes/comment.inc +++ b/includes/comment.inc @@ -48,7 +48,7 @@ function comment_settings($mode, $order, $threshold) { } function comment_form($edit) { - global $REQUEST_URI, $user; + global $user; // name field: $form .= form_item(t("Your name"), format_name($user)); @@ -71,7 +71,7 @@ function comment_form($edit) { $form .= form_submit(t("Post comment")); } - return form($REQUEST_URI, $form); + return form($form); } function comment_reply($pid, $id) { @@ -95,7 +95,7 @@ function comment_reply($pid, $id) { } function comment_preview($edit) { - global $REQUEST_URI, $theme, $user; + global $theme, $user; // Preview comment: comment_view(new Comment($user->uid, $user->name, check_preview($edit[subject]), check_preview($edit[comment]), time(), check_preview($user->homepage), 0, 0, 0, 0), t("reply to this comment")); @@ -301,7 +301,6 @@ function comment_render($lid, $cid) { } print "\n"; - // print " \n"; /* ** Render control panel: diff --git a/includes/common.inc b/includes/common.inc index f06206610..256beb34c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -244,8 +244,10 @@ function format_tag($link, $text) { return "''. ('$text' ? '$text' : '$link') .''"; } -function form($action, $form, $method = "post", $options = 0) { - return "\n$form
\n"; +function form($form, $method = "post", $action = 0, $options = 0) { + global $REQUEST_URI; + + return "
\n$form
\n"; } function form_item($title, $value, $description = 0) { diff --git a/includes/node.inc b/includes/node.inc index bc138b34d..b820511a9 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -53,6 +53,7 @@ function node_del($conditions) { db_query("DELETE FROM node WHERE nid = '$node->nid'"); db_query("DELETE FROM $node->type WHERE lid = '$node->lid' AND nid = '$node->nid'"); db_query("DELETE FROM comments WHERE lid = '$node->nid'"); + db_query("DELETE FROM moderate WHERE nid = '$node->nid'"); watchdog("special", "node: deleted '$node->title'"); return $node; } @@ -199,7 +200,7 @@ function node_control($node) { } $output .= "
\n"; - foreach ($choices as $key => $value) $options .= "\n"; + foreach ($choices as $key => $value) $options .= "\n"; $output .= " \n"; $output .= "
\n"; diff --git a/includes/search.inc b/includes/search.inc index e05b527d6..801fa037e 100644 --- a/includes/search.inc +++ b/includes/search.inc @@ -1,14 +1,11 @@ \n"; $output .= " "; $output .= " \n"; - $output .= "\n"; - return $output; + return form($output); } function search_data($keys, $type) { -- cgit v1.2.3