--- ../cvs.drupal.org/contribs-4.5/modules/flexinode/flexinode.module	2004-09-30 16:14:00.000000000 -0400
+++ 4.5/modules/flexinode/flexinode.module	2004-11-19 18:52:12.359529077 -0500
@@ -62,6 +62,10 @@ function flexinode_help($section) {
 function to switch on the node type and print out the fields in the
 way you choose. The fields are all named flexinode_n where n is the
 field ID.</p>
+
+<h3>RSS Feeds</h3>
+
+<p>You can get an rss feed of taxonomy listings by using the url on the xml button at the bottom of flexinode type listing pages, or constructing it yourself manually. The url scheme is: flexinode/feed/$cid/$uid where $cid is the content type ID and $uid is the user ID to filter by. $uid is not required, but when used the feed will only display entries submitted by that user. $cid is required.</p>
 ');
     case 'admin/node/types':
       return t('You may define your own content types here. These will be extensions of
@@ -164,6 +168,10 @@ function flexinode_menu($may_cache) {
     $items[] = array('path' => 'flexinode/update', 'title' => t('update'),
       'callback' => 'flexinode_page_admin_update', 'access' => $access,
       'type' => MENU_CALLBACK);
+    $items[] = array('path' => 'flexinode/feed', 'title' => t('RSS feed'),
+      'callback' => 'flexinode_feed',
+      'access' => user_access('access content'),
+      'type' => MENU_CALLBACK);
   }
 
   return $items;
@@ -192,6 +200,7 @@ function flexinode_page_list($ctype_id =
     $output .= node_view(node_load(array('nid' => $node->nid)), 1);
   }
   $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
+  $output .= theme('xml_icon', url('flexinode/feed/'.$ctype_id));
 
   print theme('page', $output, t($ctype->name));
 }
@@ -1035,4 +1044,33 @@ function flexinode_delete_field($edit) {
 
   drupal_set_message(t('deleted field "%name".', array('%name' => $edit['label'])));
 }
+
+/**
+ * Menu callback; displays an RSS feed containing recent flexinode entries.
+ */
+function flexinode_feed($ctype_id = 0, $uid = 0) {
+  if ($ctype_id) {
+    $type = 'flexinode-' . check_query($ctype_id);
+    $ctype = flexinode_load_content_type($ctype_id);
+  }
+  else {
+    drupal_not_found();
+  }
+
+  if ($uid) {
+    $result = db_query_range('SELECT n.nid FROM {node} n '. node_access_join_sql() .' INNER JOIN {users} u ON n.uid = u.uid WHERE '. node_access_where_sql() ." AND n.type = '%s' AND u.uid = %d AND n.status = 1 ORDER BY n.created DESC", $type, $uid, 0, 15);
+    $account = user_load(array('uid' => $uid, 'status' => 1));
+    $title = $account->name. ' '. $ctype->name .' Feed';
+  }
+  else {
+    $result = db_query_range('SELECT n.nid FROM {node} n '. node_access_join_sql() .' INNER JOIN {users} u ON n.uid = u.uid WHERE '. node_access_where_sql() ." AND n.type = '%s' AND n.status = 1 ORDER BY n.created DESC", $type, 0, 15);
+    $title .= $ctype->name .' Feed';
+  }
+
+  $channel['title'] = variable_get('site_name', '') . ': ' .$title;
+  $channel['link'] = url("blog/$uid", NULL, NULL, TRUE);
+  $channel['description'] = $ctype->description;
+  node_feed($result, $channel);
+}
+
 ?>
