- fixed update bug

3-00
Dries Buytaert 2001-03-31 13:18:57 +00:00
parent c43cf0c432
commit d9e72f37de
3 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ function node_save($node) {
$rows = array(nid, pid, lid, log, type, title, score, votes, author, status, timestamp);
if ($node[nid]) {
if ($node[nid] > 0) {
$u1 = array();
$u2 = array();

View File

@ -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"));
}

View File

@ -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"));
}