summaryrefslogtreecommitdiff
path: root/modules/blog.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/blog.module
parent64a6fbc790f02a80b32682456a24a45afe8c50a5 (diff)
downloadbrdo-e2f249878eddb4d91e3bffa80ba5452691b5e43b.tar.gz
brdo-e2f249878eddb4d91e3bffa80ba5452691b5e43b.tar.bz2
- improved the search system by making it context sensitive
Diffstat (limited to 'modules/blog.module')
-rw-r--r--modules/blog.module4
1 files changed, 2 insertions, 2 deletions
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;
}