Commit d9e72f37 authored by Dries's avatar Dries

- fixed update bug
parent c43cf0c4
......@@ -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();
......
......@@ -18,7 +18,7 @@ function Book($nid, $userid, $title, $body, $parent, $weight, $timestamp) {
}
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"));
}
......
......@@ -18,7 +18,7 @@ function Book($nid, $userid, $title, $body, $parent, $weight, $timestamp) {
}
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"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment