summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-06-25 19:36:04 +0000
committerDries Buytaert <dries@buytaert.net>2001-06-25 19:36:04 +0000
commit168db4c99e13586ff8f2087e7db77606c287d326 (patch)
tree8df58eeb2ee54d08b4397bb58de89429652daeb4
parentca6af5ad768e334a1c6ed184826de32bc7cbd2cb (diff)
downloadbrdo-168db4c99e13586ff8f2087e7db77606c287d326.tar.gz
brdo-168db4c99e13586ff8f2087e7db77606c287d326.tar.bz2
- Fixed problem with book.module (reported by Jared).
- Fixed problem with forum.module (reported by Jared).
-rw-r--r--modules/book.module17
-rw-r--r--modules/book/book.module17
-rw-r--r--modules/forum.module2
-rw-r--r--modules/forum/forum.module2
4 files changed, 18 insertions, 20 deletions
diff --git a/modules/book.module b/modules/book.module
index 3f7c38bc1..c8c8ad85a 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -97,7 +97,7 @@ function book_toc($parent = "", $indent = "", $toc = array()) {
// add root node:
if (user_access($user, "add and edit nodes")) {
- $toc[0] = "&nbsp;";
+ $toc[0] = "<root>";
}
// build table of contents:
@@ -120,12 +120,7 @@ function book_form($edit = array()) {
$form .= form_hidden(userid, $edit[userid]);
$form .= form_textfield(t("Subject"), "title", $edit[title], 50, 64);
- if ($edit[pid] > 0) {
- $form .= form_hidden("pid", $edit[pid]);
- }
- else {
- $form .= form_select(t("Parent"), "parent", $edit[parent], book_toc(), t("The parent subject or category the page belongs in."));
- }
+ $form .= form_select(t("Parent"), "parent", $edit[parent], book_toc(), t("The parent subject or category the page belongs in."));
$form .= form_textarea(t("Content"), "body", $edit[body], 70, 20, t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", "")));
$form .= form_textarea(t("Log message"), "log", $edit[log], 70, 5, t("An explanation of the additions or updates being made to help the group understand your motivations."));
@@ -138,6 +133,10 @@ function book_form($edit = array()) {
$form .= form_hidden("nid", $edit[nid]);
}
+ if ($edit[pid] > 0) {
+ $form .= form_hidden("pid", $edit[pid]);
+ }
+
if ($edit && !$edit[title]) {
$form .= "<FONT COLOR=\"red\">". t("Warning: you did not supply a title.") ."</FONT><P>\n";
$form .= form_submit(t("Preview"));
@@ -169,13 +168,13 @@ function book_delete($node) {
function book_insert($node) {
if ($node->pid && $node->status == node_status("posted")) {
- db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$node->pid'");
+ db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$node->pid'", 1);
}
}
function book_update($node) {
if ($node->pid && $node->status == node_status("posted")) {
- db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$node->pid'");
+ db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$node->pid'", 1);
}
}
diff --git a/modules/book/book.module b/modules/book/book.module
index 3f7c38bc1..c8c8ad85a 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -97,7 +97,7 @@ function book_toc($parent = "", $indent = "", $toc = array()) {
// add root node:
if (user_access($user, "add and edit nodes")) {
- $toc[0] = "&nbsp;";
+ $toc[0] = "<root>";
}
// build table of contents:
@@ -120,12 +120,7 @@ function book_form($edit = array()) {
$form .= form_hidden(userid, $edit[userid]);
$form .= form_textfield(t("Subject"), "title", $edit[title], 50, 64);
- if ($edit[pid] > 0) {
- $form .= form_hidden("pid", $edit[pid]);
- }
- else {
- $form .= form_select(t("Parent"), "parent", $edit[parent], book_toc(), t("The parent subject or category the page belongs in."));
- }
+ $form .= form_select(t("Parent"), "parent", $edit[parent], book_toc(), t("The parent subject or category the page belongs in."));
$form .= form_textarea(t("Content"), "body", $edit[body], 70, 20, t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", "")));
$form .= form_textarea(t("Log message"), "log", $edit[log], 70, 5, t("An explanation of the additions or updates being made to help the group understand your motivations."));
@@ -138,6 +133,10 @@ function book_form($edit = array()) {
$form .= form_hidden("nid", $edit[nid]);
}
+ if ($edit[pid] > 0) {
+ $form .= form_hidden("pid", $edit[pid]);
+ }
+
if ($edit && !$edit[title]) {
$form .= "<FONT COLOR=\"red\">". t("Warning: you did not supply a title.") ."</FONT><P>\n";
$form .= form_submit(t("Preview"));
@@ -169,13 +168,13 @@ function book_delete($node) {
function book_insert($node) {
if ($node->pid && $node->status == node_status("posted")) {
- db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$node->pid'");
+ db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$node->pid'", 1);
}
}
function book_update($node) {
if ($node->pid && $node->status == node_status("posted")) {
- db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$node->pid'");
+ db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$node->pid'", 1);
}
}
diff --git a/modules/forum.module b/modules/forum.module
index 8bce520e3..a9029f53d 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -24,7 +24,7 @@ function forum_form($edit = array()) {
function forum_save($edit) {
global $user, $status;
- node_save($edit, array(author => $user->id, body, comment => variable_get("forum_comment", 0), moderate => variable_get("forum_moderate", ""), promote => variable_get("forum_promote", 0), score => 0, status => $status[posted], timestamp => time(), title, type => "forum", votes => 0));
+ node_save($edit, array(author => $user->id, body, comment => 1, moderate => variable_get("forum_moderate", ""), promote => variable_get("forum_promote", 0), score => 0, status => $status[posted], timestamp => time(), title, type => "forum", votes => 0));
}
function forum_num_comments($nid) {
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 8bce520e3..a9029f53d 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -24,7 +24,7 @@ function forum_form($edit = array()) {
function forum_save($edit) {
global $user, $status;
- node_save($edit, array(author => $user->id, body, comment => variable_get("forum_comment", 0), moderate => variable_get("forum_moderate", ""), promote => variable_get("forum_promote", 0), score => 0, status => $status[posted], timestamp => time(), title, type => "forum", votes => 0));
+ node_save($edit, array(author => $user->id, body, comment => 1, moderate => variable_get("forum_moderate", ""), promote => variable_get("forum_promote", 0), score => 0, status => $status[posted], timestamp => time(), title, type => "forum", votes => 0));
}
function forum_num_comments($nid) {