diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/comment.inc | 7 | ||||
-rw-r--r-- | includes/common.inc | 6 | ||||
-rw-r--r-- | includes/node.inc | 3 | ||||
-rw-r--r-- | includes/search.inc | 5 |
4 files changed, 10 insertions, 11 deletions
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 "<form method=\"post\" action=\"$REQUEST_URI\">\n"; - // print " <INPUT TYPE=\"hidden\" NAME=\"id\" value=\"$lid\">\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 "'<a href=\"node.php?title='. urlencode('$link') .'\">'. ('$text' ? '$text' : '$link') .'</a>'"; } -function form($action, $form, $method = "post", $options = 0) { - return "<form action=\"$action\" method=\"$method\"". ($options ? " $options" : "") .">\n$form</form>\n"; +function form($form, $method = "post", $action = 0, $options = 0) { + global $REQUEST_URI; + + return "<form action=\"". ($action ? $action : $REQUEST_URI) ."\" method=\"$method\"". ($options ? " $options" : "") .">\n$form</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 .= "<FORM METHOD=\"get\" ACTION=\"\">\n"; - foreach ($choices as $key => $value) $options .= "<OPTION VALUE=\"$key\"". (strstr($REQUEST_URI,"/$key") ? " SELECTED" : "") .">". check_form($value) ."</OPTION>\n"; + foreach ($choices as $key => $value) $options .= "<OPTION VALUE=\"$key\"". (strstr($REQUEST_URI, "/$key") ? " SELECTED" : "") .">". check_form($value) ."</OPTION>\n"; $output .= " <SELECT NAME=\"op\" ONCHANGE=\"visit(this.options[this.selectedIndex].value)\">$options</SELECT>\n"; $output .= "</FORM>\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 @@ <?php function search_form($keys) { - global $REQUEST_URI; - $output .= "<form action=\"$REQUEST_URI\" method=\"POST\">\n"; $output .= " <input size=\"50\" value=\"". check_form($keys) ."\" name=\"keys\">"; $output .= " <input type=\"submit\" value=\"". t("Search") ."\">\n"; - $output .= "</form>\n"; - return $output; + return form($output); } function search_data($keys, $type) { |