diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-07-02 17:08:36 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-07-02 17:08:36 +0000 |
commit | b6c069ad7d8bbc53a4e10b8a6c71326cab7f284c (patch) | |
tree | 79ec2a02a65af67d180a9c8db65d75725350e423 /modules/node/node.module | |
parent | 5644ad02641b008016a03aedce5101dd47107341 (diff) | |
download | brdo-b6c069ad7d8bbc53a4e10b8a6c71326cab7f284c.tar.gz brdo-b6c069ad7d8bbc53a4e10b8a6c71326cab7f284c.tar.bz2 |
- Patch #20295 by pyromanfo, webchick, Gurpartap Singh et al: allow forum topics to be custom node types.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index 3d67408a5..f0dc3aaf1 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1944,28 +1944,31 @@ function node_block($op = 'list', $delta = 0) { /** * A generic function for generating RSS feeds from a set of nodes. * - * @param $nodes - * An object as returned by db_query() which contains the nid field. + * @param $nids + * An array of node IDs (nid). * @param $channel * An associative array containing title, link, description and other keys. * The link should be an absolute URL. */ -function node_feed($nodes = 0, $channel = array()) { +function node_feed($nids = array(), $channel = array()) { global $base_url, $language; - if (!$nodes) { - $nodes = db_query_range(db_rewrite_sql('SELECT n.nid, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.created DESC'), 0, variable_get('feed_default_items', 10)); + if (!$nids) { + $result = db_query_range(db_rewrite_sql('SELECT n.nid, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.created DESC'), 0, variable_get('feed_default_items', 10)); + while ($row = db_fetch_object($result)) { + $nids[] = $row->nid; + } } $item_length = variable_get('feed_item_length', 'teaser'); $namespaces = array('xmlns:dc="http://purl.org/dc/elements/1.1/"'); $items = ''; - while ($node = db_fetch_object($nodes)) { + foreach ($nids as $nid) { // Load the specified node: - $item = node_load($node->nid); + $item = node_load($nid); $node->build_mode = NODE_BUILD_RSS; - $link = url("node/$node->nid", array('absolute' => TRUE)); + $link = url("node/$nid", array('absolute' => TRUE)); if ($item_length != 'title') { $teaser = ($item_length == 'teaser') ? TRUE : FALSE; |