diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-08-27 05:49:52 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-08-27 05:49:52 +0000 |
commit | 89005902e44973f798cfa903742c0d8b99345ce0 (patch) | |
tree | 237f57b37a8d85907d121f118b0a9cbd2144f8fa /modules/forum.module | |
parent | 93fb265d478c06a6dcce25473f1f904095c5622a (diff) | |
download | brdo-89005902e44973f798cfa903742c0d8b99345ce0.tar.gz brdo-89005902e44973f798cfa903742c0d8b99345ce0.tar.bz2 |
- Tested and committed Kjartan's performance patches. (Fixed the access check
in update.php though.)
Diffstat (limited to 'modules/forum.module')
-rw-r--r-- | modules/forum.module | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/forum.module b/modules/forum.module index 35f4b8e2b..6378e3e34 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -82,9 +82,9 @@ function forum_block($op = "list", $delta = 0) { } else { if (user_access("access content")) { - $content = node_title_list(db_query_range("SELECT n.nid, n.title, u.uid, u.name, GREATEST(n.created, MAX(c.timestamp)) AS sort FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE n.type = 'forum' AND n.nid = f.nid AND n.status = 1 GROUP BY n.nid, n.title, n.created, u.uid, u.name ORDER BY sort DESC", 0, variable_get("forum_block_num", "5")), t("Active forum topics:")); + $content = node_title_list(db_query_range("SELECT n.nid, n.title, GREATEST(n.created, MAX(c.timestamp)) AS sort FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid WHERE n.type = 'forum' AND n.status = 1 GROUP BY n.nid, n.title, n.created ORDER BY sort DESC", 0, variable_get("forum_block_num", "5")), t("Active forum topics:")); - $content .= node_title_list(db_query_range("SELECT n.nid, n.title, u.uid, u.name FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE n.type = 'forum' ORDER BY n.nid DESC", 0, variable_get("forum_block_num", "5")), t("New forum topics:")); + $content .= node_title_list(db_query_range("SELECT nid, title FROM {node} WHERE type = 'forum' ORDER BY nid DESC", 0, variable_get("forum_block_num", "5")), t("New forum topics:")); if ($content) { $content .= "<div class=\"more-link\">". l(t("more"), "forum", array("title" => t("Read the latest forum topics."))) ."</div>"; |