diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-03-31 13:18:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-03-31 13:18:57 +0000 |
commit | d9e72f37de62ae2c96925ec5f75c7e6bd449b59b (patch) | |
tree | 81a06c683641e1a2c45faab340bbe11ded6d223c /modules | |
parent | c43cf0c43261751f1a83337422e168f7f0d6e89a (diff) | |
download | brdo-d9e72f37de62ae2c96925ec5f75c7e6bd449b59b.tar.gz brdo-d9e72f37de62ae2c96925ec5f75c7e6bd449b59b.tar.bz2 |
- fixed update bug
Diffstat (limited to 'modules')
-rw-r--r-- | modules/book.module | 2 | ||||
-rw-r--r-- | modules/book/book.module | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/book.module b/modules/book.module index 40baa5246..8009ae27e 100644 --- a/modules/book.module +++ b/modules/book.module @@ -18,7 +18,7 @@ class Book { } function book_navigation($node) { - if ($node->nid) { + if ($node->nid && $node->parent && $node->weight) { $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 b.parent = '$node->parent' 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 b.parent = '$node->parent' AND b.weight < $node->weight ORDER BY b.weight DESC")); } diff --git a/modules/book/book.module b/modules/book/book.module index 40baa5246..8009ae27e 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -18,7 +18,7 @@ class Book { } function book_navigation($node) { - if ($node->nid) { + if ($node->nid && $node->parent && $node->weight) { $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 b.parent = '$node->parent' 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 b.parent = '$node->parent' AND b.weight < $node->weight ORDER BY b.weight DESC")); } |