Need help creating an RSS feed without Views

I can not use views because I want to include links to users who have flagged the nodes and this flag information is not available in views. So...as step one, I'm just trying to create the feed with just my profile nodes, here is what I have, wondering if anyone can point me in the right direction

function mymodule_rss() {
  $nodes = db_query_range(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.type = 'profile' AND n.status = 1"), 0, variable_get('feed_default_items', 100));
  $channel['title'] = t('!site_name profiles', array('!site_name' => variable_get('site_name', 'Drupal')));
  $channel['link'] = url('profile-feed', array('absolute' => TRUE));

  $items = array();
  while ($row = db_fetch_object($nodes)) {
    $items[] = $row->nid;
  }

  node_feed($items,$channel);

}

Groups:
Login to post comments