diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-07-26 17:39:12 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-07-26 17:39:12 +0000 |
commit | 30337a7d2946a9e24d1884c4d2371e429be4467d (patch) | |
tree | bb5161839c7cc79f78bcc5e85cd11dbdc47d7156 /modules | |
parent | e278e46f4945d443d4cfb7a58c656fe5afda34f3 (diff) | |
download | brdo-30337a7d2946a9e24d1884c4d2371e429be4467d.tar.gz brdo-30337a7d2946a9e24d1884c4d2371e429be4467d.tar.bz2 |
- Bugfix: remove forum block caching as it contains text that can be translated.
Fixes bug #2329.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/forum.module | 19 | ||||
-rw-r--r-- | modules/forum/forum.module | 19 |
2 files changed, 8 insertions, 30 deletions
diff --git a/modules/forum.module b/modules/forum.module index 01574b4ff..1613b020b 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -82,23 +82,12 @@ function forum_block($op = "list", $delta = 0) { } else { if (user_access("access content")) { - $cache = cache_get("forum:block"); + $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:")); - if (empty($cache)) { - unset($items); - $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, 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:")); - unset ($items); - $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:")); - - if ($content) { - $content .= "<div id=\"forum_more\" style=\"text-align: right;\">". l(t("more"), "forum", array("title" => t("Read the latest forum topics."))) ."</div>"; - } - - cache_set("forum:block", $content, 1); - } - else { - $content = $cache->data; + if ($content) { + $content .= "<div id=\"forum_more\" style=\"text-align: right;\">". l(t("more"), "forum", array("title" => t("Read the latest forum topics."))) ."</div>"; } $blocks["subject"] = t("Forum topics"); diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 01574b4ff..1613b020b 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -82,23 +82,12 @@ function forum_block($op = "list", $delta = 0) { } else { if (user_access("access content")) { - $cache = cache_get("forum:block"); + $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:")); - if (empty($cache)) { - unset($items); - $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, 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:")); - unset ($items); - $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:")); - - if ($content) { - $content .= "<div id=\"forum_more\" style=\"text-align: right;\">". l(t("more"), "forum", array("title" => t("Read the latest forum topics."))) ."</div>"; - } - - cache_set("forum:block", $content, 1); - } - else { - $content = $cache->data; + if ($content) { + $content .= "<div id=\"forum_more\" style=\"text-align: right;\">". l(t("more"), "forum", array("title" => t("Read the latest forum topics."))) ."</div>"; } $blocks["subject"] = t("Forum topics"); |