diff options
Diffstat (limited to 'modules/book.module')
-rw-r--r-- | modules/book.module | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/book.module b/modules/book.module index 78199557f..f7b4d08e9 100644 --- a/modules/book.module +++ b/modules/book.module @@ -62,7 +62,7 @@ function book_view($node, $page = 1) { function book_find($keys) { global $status, $user; $find = array(); - $result = db_query("SELECT n.*, u.userid FROM nodes n LEFT JOIN users u ON n.author = u.id WHERE n.status = '$status[posted]' AND n.title LIKE '%". check_input($keys) ."%' ORDER BY n.timestamp DESC LIMIT 20"); + $result = db_query("SELECT n.*, u.userid FROM nodes n LEFT JOIN book b ON n.nid = b.node LEFT JOIN users u ON n.author = u.id WHERE n.type = 'book' AND n.status = '$status[posted]' AND (n.title LIKE '%". check_input($keys) ."%' OR b.body LIKE '%". check_input($keys) ."%') ORDER BY n.timestamp DESC LIMIT 20", 1); while ($node = db_fetch_object($result)) { array_push($find, array("title" => check_output($node->title), "link" => (user_access($user, "book") ? "admin.php?mod=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->userid, "date" => $node->timestamp)); } |