summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-12-22 11:06:33 +0000
committerDries Buytaert <dries@buytaert.net>2002-12-22 11:06:33 +0000
commit259f17c5731e91fe4c4d738883527ae06573c576 (patch)
treee24dfdb356963c38641c94266c010975171e1e56
parentca743aa6fd44e2055111b4d46a9efdf110f7a531 (diff)
downloadbrdo-259f17c5731e91fe4c4d738883527ae06573c576.tar.gz
brdo-259f17c5731e91fe4c4d738883527ae06573c576.tar.bz2
- Bugfix: printer-friendly book pages were not being displayed in the proper
order.
-rw-r--r--modules/book.module14
-rw-r--r--modules/book/book.module14
2 files changed, 14 insertions, 14 deletions
diff --git a/modules/book.module b/modules/book.module
index 916bb1812..b6bace0c6 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -542,7 +542,7 @@ function book_page() {
if (user_access("access content")) {
switch ($op) {
case "print":
- print book_export_html($id, $depth = 1);
+ print book_print($id, $depth = 1);
break;
default:
book_render();
@@ -555,8 +555,8 @@ function book_page() {
}
}
-function book_export_html($id = "", $depth = 1) {
- $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND n.nid = '%d' AND (n.moderate = 0 OR n.revisions != '')", $id);
+function book_print($id = "", $depth = 1) {
+ $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND n.nid = '%d' AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight, n.title", $id);
while ($page = db_fetch_object($result)) {
// load the node:
@@ -577,13 +577,13 @@ function book_export_html($id = "", $depth = 1) {
}
}
- $output .= book_export_html_recurse($id, $depth);
+ $output .= book_print_recurse($id, $depth);
return $output;
}
-function book_export_html_recurse($parent = "", $depth = 1) {
- $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND b.parent = '$parent' AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight");
+function book_print_recurse($parent = "", $depth = 1) {
+ $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND b.parent = '$parent' AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight, n.title");
while ($page = db_fetch_object($result)) {
// load the node:
@@ -602,7 +602,7 @@ function book_export_html_recurse($parent = "", $depth = 1) {
$output .= "<ul>". book_body($node) ."</ul>";
}
- $output .= book_export_html_recurse($node->nid, $depth + 1);
+ $output .= book_print_recurse($node->nid, $depth + 1);
}
}
diff --git a/modules/book/book.module b/modules/book/book.module
index 916bb1812..b6bace0c6 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -542,7 +542,7 @@ function book_page() {
if (user_access("access content")) {
switch ($op) {
case "print":
- print book_export_html($id, $depth = 1);
+ print book_print($id, $depth = 1);
break;
default:
book_render();
@@ -555,8 +555,8 @@ function book_page() {
}
}
-function book_export_html($id = "", $depth = 1) {
- $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND n.nid = '%d' AND (n.moderate = 0 OR n.revisions != '')", $id);
+function book_print($id = "", $depth = 1) {
+ $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND n.nid = '%d' AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight, n.title", $id);
while ($page = db_fetch_object($result)) {
// load the node:
@@ -577,13 +577,13 @@ function book_export_html($id = "", $depth = 1) {
}
}
- $output .= book_export_html_recurse($id, $depth);
+ $output .= book_print_recurse($id, $depth);
return $output;
}
-function book_export_html_recurse($parent = "", $depth = 1) {
- $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND b.parent = '$parent' AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight");
+function book_print_recurse($parent = "", $depth = 1) {
+ $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND b.parent = '$parent' AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight, n.title");
while ($page = db_fetch_object($result)) {
// load the node:
@@ -602,7 +602,7 @@ function book_export_html_recurse($parent = "", $depth = 1) {
$output .= "<ul>". book_body($node) ."</ul>";
}
- $output .= book_export_html_recurse($node->nid, $depth + 1);
+ $output .= book_print_recurse($node->nid, $depth + 1);
}
}