From f6f04a82fadbfe291b209eaa879f6ee373cb6e1d Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Wed, 26 Sep 2001 18:28:10 +0000 Subject: Bug fixes mostly - fixed book.module not generating next/prev links properly - re-added default node options to the admin page - fixed a potential bug in node.php. Nodes with same titles were confusing it at times, should fix the bug reported by Gerhard Killesreiter. --- modules/book.module | 6 +++--- modules/book/book.module | 6 +++--- modules/node.module | 1 + modules/node/node.module | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/book.module b/modules/book.module index fa44a83fe..58b14a3f2 100644 --- a/modules/book.module +++ b/modules/book.module @@ -47,8 +47,8 @@ function book_view($node, $main = 0) { else { if ($node->nid && $node->parent) { $list = book_parent_query($node->parent); - $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight > '$node->weight' ORDER BY b.weight ASC")); - $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight < '$node->weight' ORDER BY b.weight DESC")); + $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND (b.weight > '$node->weight' || (b.weight = '$node->weight' AND n.title > '$node->title')) ORDER BY b.weight ASC,n.title ASC")); + $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND (b.weight < '$node->weight' || (b.weight = '$node->weight' AND n.title < '$node->title')) ORDER BY b.weight DESC,n.title DESC")); } $output .= "\n"; @@ -91,7 +91,7 @@ function book_search($keys) { } function book_parent_query($parent) { - if ($parent != "") { + if ($parent > 0) { $list = array(); foreach (book_parent($parent) as $pid) array_push($list, "b.parent = $pid"); } diff --git a/modules/book/book.module b/modules/book/book.module index fa44a83fe..58b14a3f2 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -47,8 +47,8 @@ function book_view($node, $main = 0) { else { if ($node->nid && $node->parent) { $list = book_parent_query($node->parent); - $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight > '$node->weight' ORDER BY b.weight ASC")); - $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND b.weight < '$node->weight' ORDER BY b.weight DESC")); + $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND (b.weight > '$node->weight' || (b.weight = '$node->weight' AND n.title > '$node->title')) ORDER BY b.weight ASC,n.title ASC")); + $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND (b.weight < '$node->weight' || (b.weight = '$node->weight' AND n.title < '$node->title')) ORDER BY b.weight DESC,n.title DESC")); } $output .= "
\n"; @@ -91,7 +91,7 @@ function book_search($keys) { } function book_parent_query($parent) { - if ($parent != "") { + if ($parent > 0) { $list = array(); foreach (book_parent($parent) as $pid) array_push($list, "b.parent = $pid"); } diff --git a/modules/node.module b/modules/node.module index 55fc07fc6..e5ac89f7d 100644 --- a/modules/node.module +++ b/modules/node.module @@ -340,6 +340,7 @@ function node_admin() { print node_edit_content(node_get_array(array("nid" => $id)), $type); break; case "default": + print node_setting(); break; case "confirm delete": print node_delete_confirmation($id); diff --git a/modules/node/node.module b/modules/node/node.module index 55fc07fc6..e5ac89f7d 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -340,6 +340,7 @@ function node_admin() { print node_edit_content(node_get_array(array("nid" => $id)), $type); break; case "default": + print node_setting(); break; case "confirm delete": print node_delete_confirmation($id); -- cgit v1.2.3