summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-12-10 10:29:19 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-12-10 10:29:19 +0000
commit3355267c3bd8498a84228509adef3dbb0de2e1b0 (patch)
tree2d515aca876874d4b222957ed903b48fffc68071
parentad397fc1e43453b0305295808415096a3709d674 (diff)
downloadbrdo-3355267c3bd8498a84228509adef3dbb0de2e1b0.tar.gz
brdo-3355267c3bd8498a84228509adef3dbb0de2e1b0.tar.bz2
#188908 by JirkaRybka, documentation added: empty feeds resulted in feeds with all nodes instead
-rw-r--r--modules/node/node.module9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 197cb12d6..fae77fe64 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1513,15 +1513,18 @@ function node_block($op = 'list', $delta = 0) {
* A generic function for generating RSS feeds from a set of nodes.
*
* @param $nids
- * An array of node IDs (nid).
+ * An array of node IDs (nid). Defaults to FALSE so empty feeds can be
+ * generated with passing an empty array, if no items are to be added
+ * to the feed.
* @param $channel
* An associative array containing title, link, description and other keys.
* The link should be an absolute URL.
*/
-function node_feed($nids = array(), $channel = array()) {
+function node_feed($nids = FALSE, $channel = array()) {
global $base_url, $language;
- if (!$nids) {
+ if ($nids === FALSE) {
+ $nids = array();
$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;