diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-11-11 20:59:28 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-11-11 20:59:28 +0000 |
commit | a6c8b10d8e07075f2bbab81d3d972f3175ebe3ee (patch) | |
tree | 020bd15048ce51878af38a55697edbee4be2ccf7 /modules/forum/forum.module | |
parent | b372053cf8be2d8e535a0886bb324766f823813e (diff) | |
download | brdo-a6c8b10d8e07075f2bbab81d3d972f3175ebe3ee.tar.gz brdo-a6c8b10d8e07075f2bbab81d3d972f3175ebe3ee.tar.bz2 |
Applied Moshe's patches:
- Adds more title info to each line in the block: now showing author and number of comments in a unified way accross all modules.
- Added pager support to blog module.
- Blog module now uses standard node view, not its own hack which is more theme friendly (http://www.drupal.org/node.php?id=133).
- Blog module now uses node_feed() function for making RSS feeds. since all feeds are now consolidated, a couple tweaks to node_feed() and format_rss_* would lead us to support new RSS formats easily.
- Fixed bugs where unpublished entries were displayed.
Diffstat (limited to 'modules/forum/forum.module')
-rw-r--r-- | modules/forum/forum.module | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 81308d5dd..46dacdded 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -97,23 +97,14 @@ function forum_block($op = "list", $delta = 0) { if (!$content) { unset($items); - $result = db_query("SELECT n.nid, n.title, n.body, GREATEST(n.created, MAX(c.timestamp)) AS sort FROM node n, forum f LEFT JOIN comments c ON c.nid = n.nid WHERE n.type = 'forum' AND n.nid = f.nid AND f.shadow = 0 AND n.status = 1 GROUP BY n.nid ORDER BY sort DESC LIMIT ". variable_get("forum_block_num", "5")); - while ($node = db_fetch_object($result)) { - $items[] = l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => substr(strip_tags($node->body), 0, 100)."...")); - } - $content .= theme_invoke("theme_item_list", $items, t("Active forum topics:")); - + $content = node_title_list(db_query("SELECT n.nid, n.title, u.name, GREATEST(n.created, MAX(c.timestamp)) AS sort FROM node n, forum f LEFT JOIN comments c ON c.nid = n.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.type = 'forum' AND n.nid = f.nid AND f.shadow = 0 AND n.status = 1 GROUP BY n.nid ORDER BY sort DESC LIMIT ". variable_get("forum_block_num", "5")), t("Active forum topics:")); $content .= "<br />"; unset ($items); - $result = db_query("SELECT n.nid, n.title, n.body FROM node n LEFT JOIN forum f ON n.nid = f.nid WHERE n.type = 'forum' ORDER BY n.nid DESC LIMIT ". variable_get("forum_block_num", "5")); - while ($node = db_fetch_object($result)) { - $items[] = l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => substr(strip_tags($node->body), 0, 100)."...")); - } - $content .= theme_invoke("theme_item_list", $items, t("New forum topics:")); + $content .= node_title_list(db_query("SELECT n.nid, n.title, u.name FROM node n LEFT 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 LIMIT ". variable_get("forum_block_num", "5")), t("New forum topics:")); if ($content) { - $content .= "<div align=\"right\">". lm(t("more"), array("mod" => "forum")) ."</div>"; + $content .= "<div id=\"forum_more\" align=\"right\">". lm(t("more"), array("mod" => "forum")) ."</div>"; } cache_set("forum:block", $content, time() + 60 * 3); |