diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-09-16 14:05:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-09-16 14:05:10 +0000 |
commit | e2f249878eddb4d91e3bffa80ba5452691b5e43b (patch) | |
tree | b0b27a46d7c281d3dd4aae420de3f823b6650b7a | |
parent | 64a6fbc790f02a80b32682456a24a45afe8c50a5 (diff) | |
download | brdo-e2f249878eddb4d91e3bffa80ba5452691b5e43b.tar.gz brdo-e2f249878eddb4d91e3bffa80ba5452691b5e43b.tar.bz2 |
- improved the search system by making it context sensitive
-rw-r--r-- | CHANGELOG | 6 | ||||
-rw-r--r-- | modules/blog.module | 4 | ||||
-rw-r--r-- | modules/blog/blog.module | 4 | ||||
-rw-r--r-- | modules/book.module | 4 | ||||
-rw-r--r-- | modules/book/book.module | 4 | ||||
-rw-r--r-- | modules/comment.module | 3 | ||||
-rw-r--r-- | modules/comment/comment.module | 3 | ||||
-rw-r--r-- | modules/poll.module | 4 | ||||
-rw-r--r-- | modules/poll/poll.module | 4 | ||||
-rw-r--r-- | modules/story.module | 4 | ||||
-rw-r--r-- | modules/story/story.module | 4 |
11 files changed, 25 insertions, 19 deletions
@@ -1,6 +1,10 @@ drupal x.xx, xx/xx/xxxx ----------------------- -- rewrote the user system +- rewrote the user system: + * added support for Drupal authentication through XML-RPC and through + a Jabber server. +- various updates: + * improved the search system by making it context sensitive. drupal 3.00, 15/09/2001 ----------------------- diff --git a/modules/blog.module b/modules/blog.module index c8126d2f8..eeee99f8d 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -355,11 +355,11 @@ function blog_block() { function blog_search($keys) { - global $status; + global $PHP_SELF, $status; $result = db_query("SELECT n.*, b.* FROM blog b LEFT JOIN node n ON n.nid = b.nid AND n.lid = b.lid WHERE (n.title LIKE '%$keys%' OR b.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($blog = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($blog->title), "link" => (user_access("administer nodes") ? "admin.php?mod=node&type=blog&op=edit&id=$blog->nid" : "node.php?id=$blog->nid"), "user" => $blog->name, "date" => $blog->timestamp); + $find[$i++] = array("title" => check_output($blog->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=node&type=blog&op=edit&id=$blog->nid" : "node.php?id=$blog->nid"), "user" => $blog->name, "date" => $blog->timestamp); } return $find; } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index c8126d2f8..eeee99f8d 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -355,11 +355,11 @@ function blog_block() { function blog_search($keys) { - global $status; + global $PHP_SELF, $status; $result = db_query("SELECT n.*, b.* FROM blog b LEFT JOIN node n ON n.nid = b.nid AND n.lid = b.lid WHERE (n.title LIKE '%$keys%' OR b.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($blog = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($blog->title), "link" => (user_access("administer nodes") ? "admin.php?mod=node&type=blog&op=edit&id=$blog->nid" : "node.php?id=$blog->nid"), "user" => $blog->name, "date" => $blog->timestamp); + $find[$i++] = array("title" => check_output($blog->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=node&type=blog&op=edit&id=$blog->nid" : "node.php?id=$blog->nid"), "user" => $blog->name, "date" => $blog->timestamp); } return $find; } 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; } diff --git a/modules/book/book.module b/modules/book/book.module index f2cd01153..fa44a83fe 100644 --- a/modules/book/book.module +++ b/modules/book/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; } diff --git a/modules/comment.module b/modules/comment.module index 02bd25f43..448f1ff32 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -1,9 +1,10 @@ <?php function comment_search($keys) { + global $PHP_SELF; $result = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN user u ON c.author = u.uid WHERE c.subject LIKE '%$keys%' OR c.comment LIKE '%$keys%' ORDER BY c.timestamp DESC LIMIT 20"); while ($comment = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($comment->subject), "link" => (user_access("administer comments") ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "node.php?id=$comment->lid&cid=$comment->cid"), "user" => $comment->name, "date" => $comment->timestamp); + $find[$i++] = array("title" => check_output($comment->subject), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "node.php?id=$comment->lid&cid=$comment->cid"), "user" => $comment->name, "date" => $comment->timestamp); } return $find; } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 02bd25f43..448f1ff32 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1,9 +1,10 @@ <?php function comment_search($keys) { + global $PHP_SELF; $result = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN user u ON c.author = u.uid WHERE c.subject LIKE '%$keys%' OR c.comment LIKE '%$keys%' ORDER BY c.timestamp DESC LIMIT 20"); while ($comment = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($comment->subject), "link" => (user_access("administer comments") ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "node.php?id=$comment->lid&cid=$comment->cid"), "user" => $comment->name, "date" => $comment->timestamp); + $find[$i++] = array("title" => check_output($comment->subject), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "node.php?id=$comment->lid&cid=$comment->cid"), "user" => $comment->name, "date" => $comment->timestamp); } return $find; } diff --git a/modules/poll.module b/modules/poll.module index 28cebb4ae..b2589941c 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -75,10 +75,10 @@ function poll_status() { } function poll_search($keys) { - global $status; + global $PHP_SELF, $status; $result = db_query("SELECT n.*, p.* FROM poll p LEFT JOIN node n ON n.nid = p.nid AND n.lid = p.lid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%') LIMIT 20"); while ($poll = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($poll->title), "link" => (user_access("administer nodes") ? "admin.php?mod=poll&op=edit&id=$poll->nid" : "node.php?id=$poll->nid"), "user" => $poll->name, "date" => $poll->timestamp); + $find[$i++] = array("title" => check_output($poll->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=poll&op=edit&id=$poll->nid" : "node.php?id=$poll->nid"), "user" => $poll->name, "date" => $poll->timestamp); } return $find; } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 28cebb4ae..b2589941c 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -75,10 +75,10 @@ function poll_status() { } function poll_search($keys) { - global $status; + global $PHP_SELF, $status; $result = db_query("SELECT n.*, p.* FROM poll p LEFT JOIN node n ON n.nid = p.nid AND n.lid = p.lid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%') LIMIT 20"); while ($poll = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($poll->title), "link" => (user_access("administer nodes") ? "admin.php?mod=poll&op=edit&id=$poll->nid" : "node.php?id=$poll->nid"), "user" => $poll->name, "date" => $poll->timestamp); + $find[$i++] = array("title" => check_output($poll->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=poll&op=edit&id=$poll->nid" : "node.php?id=$poll->nid"), "user" => $poll->name, "date" => $poll->timestamp); } return $find; } diff --git a/modules/story.module b/modules/story.module index 1f76aab78..4fbd630fa 100644 --- a/modules/story.module +++ b/modules/story.module @@ -13,10 +13,10 @@ function story_status() { } function story_search($keys) { - global $status; + global $PHP_SELF, $status; $result = db_query("SELECT n.*, s.* FROM story s LEFT JOIN node n ON n.nid = s.nid AND n.lid = s.lid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%' OR s.abstract LIKE '%$keys%' OR s.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($story = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($story->title), "link" => (user_access("administer nodes") ? "admin.php?mod=node&type=story&op=edit&id=$story->nid" : "node.php?id=$story->nid"), "user" => $story->name, "date" => $story->timestamp); + $find[$i++] = array("title" => check_output($story->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=node&type=story&op=edit&id=$story->nid" : "node.php?id=$story->nid"), "user" => $story->name, "date" => $story->timestamp); } return $find; } diff --git a/modules/story/story.module b/modules/story/story.module index 1f76aab78..4fbd630fa 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -13,10 +13,10 @@ function story_status() { } function story_search($keys) { - global $status; + global $PHP_SELF, $status; $result = db_query("SELECT n.*, s.* FROM story s LEFT JOIN node n ON n.nid = s.nid AND n.lid = s.lid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%' OR s.abstract LIKE '%$keys%' OR s.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($story = db_fetch_object($result)) { - $find[$i++] = array("title" => check_output($story->title), "link" => (user_access("administer nodes") ? "admin.php?mod=node&type=story&op=edit&id=$story->nid" : "node.php?id=$story->nid"), "user" => $story->name, "date" => $story->timestamp); + $find[$i++] = array("title" => check_output($story->title), "link" => ($PHP_SELF == "/admin.php" ? "admin.php?mod=node&type=story&op=edit&id=$story->nid" : "node.php?id=$story->nid"), "user" => $story->name, "date" => $story->timestamp); } return $find; } |