diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2001-09-26 18:28:10 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2001-09-26 18:28:10 +0000 |
commit | f6f04a82fadbfe291b209eaa879f6ee373cb6e1d (patch) | |
tree | 5462914539dce875d0e149ff48756a13e0a3eb63 | |
parent | b146513e07feec607030d078e53f1fa9f6d5e403 (diff) | |
download | brdo-f6f04a82fadbfe291b209eaa879f6ee373cb6e1d.tar.gz brdo-f6f04a82fadbfe291b209eaa879f6ee373cb6e1d.tar.bz2 |
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.
-rw-r--r-- | modules/book.module | 6 | ||||
-rw-r--r-- | modules/book/book.module | 6 | ||||
-rw-r--r-- | modules/node.module | 1 | ||||
-rw-r--r-- | modules/node/node.module | 1 |
4 files changed, 8 insertions, 6 deletions
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 .= "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\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 .= "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\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); |