summaryrefslogtreecommitdiff
path: root/modules/book.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-09-16 14:05:10 +0000
committerDries Buytaert <dries@buytaert.net>2001-09-16 14:05:10 +0000
commite2f249878eddb4d91e3bffa80ba5452691b5e43b (patch)
treeb0b27a46d7c281d3dd4aae420de3f823b6650b7a /modules/book.module
parent64a6fbc790f02a80b32682456a24a45afe8c50a5 (diff)
downloadbrdo-e2f249878eddb4d91e3bffa80ba5452691b5e43b.tar.gz
brdo-e2f249878eddb4d91e3bffa80ba5452691b5e43b.tar.bz2
- improved the search system by making it context sensitive
Diffstat (limited to 'modules/book.module')
-rw-r--r--modules/book.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/book.module b/modules/book.module
index f2cd01153..fa44a83fe 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -82,10 +82,10 @@ function book_view($node, $main = 0) {
}
function book_search($keys) {
- global $status;
+ global $PHP_SELF, $status;
$result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid LEFT JOIN user u ON n.author = u.uid 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");
while ($node = db_fetch_object($result)) {
- $find[$i++] = array("title" => check_output($node->title), "link" => (user_access("administer nodes") ? "admin.php?mod=node&type=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->name, "date" => $node->timestamp);
+ $find[$i++] = array("title" => check_output($node->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=node&type=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->name, "date" => $node->timestamp);
}
return $find;
}