Index: aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator.module,v retrieving revision 1.246 diff -u -w -b -r1.246 aggregator.module --- aggregator.module 11 Aug 2005 13:12:44 -0000 1.246 +++ aggregator.module 21 Aug 2005 21:36:20 -0000 @@ -138,6 +138,12 @@ $items[] = array('path' => 'aggregator/opml', 'title' => t('opml'), 'callback' => 'aggregator_page_opml', 'access' => $view, 'type' => MENU_CALLBACK); + + $opml_category = db_fetch_object(db_query('SELECT title, cid FROM {aggregator_category} WHERE cid = %d', arg(2))); + if ($opml_category) { + $items[] = array('path' => 'aggregator/opml/'. $opml_category->cid, 'title' => t('opml'), + 'callback' => 'aggregator_page_opml', 'access' => $view, + 'callback arguments' => $opml_category->cid, 'type' => MENU_CALLBACK); } else { if (arg(0) == 'aggregator' && is_numeric(arg(2))) { @@ -1020,8 +1026,16 @@ /** * Menu callback; generates an OPML representation of all feeds. */ -function aggregator_page_opml() { +function aggregator_page_opml($cid = NULL) { + if ($cid) { + $result = db_query('SELECT c.title AS cat_title, f.title, f.url ' . + 'FROM aggregator_category_feed ac ' . + 'JOIN aggregator_category c on c.cid = ac.cid ' . + 'JOIN aggregator_feed f on f.fid = ac.fid ' . + "WHERE ac.cid = $cid ORDER BY cat_title, title"); + } else { $result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title'); + } $output = "\n"; $output .= "\n"; ***** CVS exited normally with code 1 *****