aggregator_page_opml

function aggregator_page_opml

aggregator_page_opml($cid = NULL)

Page callback: Generates an OPML representation of all feeds.

Parameters

$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.

File

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

Code

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->fetchAll();
  return theme('aggregator_page_opml', array('feeds' => $feeds));
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!aggregator!aggregator.pages.inc/function/aggregator_page_opml/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部