summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/book.module6
-rw-r--r--modules/book/book.module6
-rw-r--r--modules/node.module1
-rw-r--r--modules/node/node.module1
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);