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 /modules/comment/comment.module | |
parent | 64a6fbc790f02a80b32682456a24a45afe8c50a5 (diff) | |
download | brdo-e2f249878eddb4d91e3bffa80ba5452691b5e43b.tar.gz brdo-e2f249878eddb4d91e3bffa80ba5452691b5e43b.tar.bz2 |
- improved the search system by making it context sensitive
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |