4.6.x aggregator.module aggregator_page_opml()
4.7.x aggregator.module aggregator_page_opml($cid = NULL)
5.x aggregator.module aggregator_page_opml($cid = NULL)
6.x aggregator.pages.inc aggregator_page_opml($cid = NULL)
7.x aggregator.pages.inc aggregator_page_opml($cid = NULL)

Page callback: Generates an OPML representation of all feeds.


$cid: (optional) If set, feeds are exported only from a category with this ID. Otherwise, all feeds are exported. Defaults to NULL.

Return value

An OPML formatted string.

1 string reference to 'aggregator_page_opml'
aggregator_menu in modules/aggregator/aggregator.module
Implements hook_menu().


modules/aggregator/aggregator.pages.inc, line 479
User page callbacks for the Aggregator module.


function aggregator_page_opml($cid = NULL) {
  if ($cid) {
    $result = db_query('SELECT f.title, f.url FROM {aggregator_feed} f LEFT JOIN {aggregator_category_feed} c on f.fid = c.fid WHERE c.cid = :cid ORDER BY title', array(
      ':cid' => $cid,
  else {
    $result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title');
  $feeds = $result
  return theme('aggregator_page_opml', array(
    'feeds' => $feeds,