diff --git a/modules/book.module b/modules/book.module index f1a174ffd02..429f1296b12 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' || (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")); + $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 > '". check_query($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 < '". check_query($node->title) ."')) ORDER BY b.weight DESC,n.title DESC")); } $output .= "\n"; diff --git a/modules/book/book.module b/modules/book/book.module index f1a174ffd02..429f1296b12 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' || (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")); + $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 > '". check_query($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 < '". check_query($node->title) ."')) ORDER BY b.weight DESC,n.title DESC")); } $output .= "
\n";