diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-11-03 07:57:28 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-11-03 07:57:28 +0000 |
commit | 7f2e4572fa1f1e6bcc14f0cc948f6fd988a7ff92 (patch) | |
tree | 4d8033ff512ecfe120e135b5bf012084af675ffe /search.php | |
parent | fb348c6a90f15c6f64d8e0e12056a55e778843c3 (diff) | |
download | brdo-7f2e4572fa1f1e6bcc14f0cc948f6fd988a7ff92.tar.gz brdo-7f2e4572fa1f1e6bcc14f0cc948f6fd988a7ff92.tar.bz2 |
- fixed bug in search.php
- fixed bug in discussion.php
- theme update: comment() now takes 3 arguments:
$comment - an object with comment data
$link - a link to the reply form of that particular
comment
$thread - the subthread of that particular comment
- theme 'marvin' and theme 'zaphod' are updated, theme
'unconed' is left to be done
Diffstat (limited to 'search.php')
-rw-r--r-- | search.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/search.php b/search.php index 18ef2c3b7..1ea6defc1 100644 --- a/search.php +++ b/search.php @@ -40,10 +40,10 @@ $output .= " <TD>\n"; ### Compose and perform query: - $query = "SELECT DISTINCT s.id, s.subject, u.userid, s.timestamp, COUNT(c.cid) AS comments FROM comments c, stories s LEFT JOIN users u ON s.author = u.id WHERE s.status = 2 AND s.id = c.sid "; + $query = "SELECT s.id, s.subject, u.userid, s.timestamp, COUNT(c.cid) AS comments FROM stories s LEFT JOIN users u ON s.author = u.id LEFT JOIN comments c ON s.id = c.sid WHERE s.status = 2 "; $query .= ($author) ? "AND u.userid = '$author' " : ""; $query .= ($terms) ? "AND (s.subject LIKE '%$terms%' OR s.abstract LIKE '%$terms%' OR s.updates LIKE '%$terms%') " : ""; - $query .= ($category) ? "AND s.category = '$category' GROUP BY c.sid " : "GROUP BY c.sid "; + $query .= ($category) ? "AND s.category = '$category' GROUP BY s.id " : "GROUP BY s.id "; $query .= ($order == "Oldest first") ? "ORDER BY s.timestamp ASC" : "ORDER BY s.timestamp DESC"; $result = db_query("$query"); @@ -64,4 +64,4 @@ $theme->box("Search", $output); $theme->footer(); -?>
\ No newline at end of file +?> |