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/node.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/node.module')
-rw-r--r-- | modules/node.module | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/node.module b/modules/node.module index 01098eb57..9424b3ac0 100644 --- a/modules/node.module +++ b/modules/node.module @@ -19,6 +19,23 @@ function node_system($field){ return $system[$field]; } +// accepts a db result object which includes nid and title from node table, and name from the user table +// returns an HTML list suitable as content for a block, and eventually other uses. +function node_title_list($result, $title = NULL) { + // no queries if site is in distress + if (module_exist("statistics") && throttle_status() > 4) { + return; + } + + while ($node = db_fetch_object($result)) { + $number = comment_num_all($node->nid); + $name = strip_tags(format_name($node)); // required for anonymous users to work + $items[] = l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => t("Author: %name, comments: %number", array("%name" => $name, "%number" => $number)))); + } + return theme_invoke("theme_item_list", $items, $title); + +} + function node_teaser($body) { $size = 400; |