- Modified patch #22637: added OPML export for aggregator categories.

4.7.x
Dries Buytaert 2005-08-23 05:45:08 +00:00
parent 405cb49a0b
commit 789dd294ff
2 changed files with 14 additions and 4 deletions

View File

@ -1030,8 +1030,13 @@ function aggregator_page_sources() {
/** /**
* Menu callback; generates an OPML representation of all feeds. * Menu callback; generates an OPML representation of all feeds.
*/ */
function aggregator_page_opml() { function aggregator_page_opml($cid = NULL) {
$result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title'); 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 = %d ORDER BY title', $cid);
}
else {
$result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title');
}
$output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<opml version=\"1.1\">\n"; $output .= "<opml version=\"1.1\">\n";

View File

@ -1030,8 +1030,13 @@ function aggregator_page_sources() {
/** /**
* Menu callback; generates an OPML representation of all feeds. * Menu callback; generates an OPML representation of all feeds.
*/ */
function aggregator_page_opml() { function aggregator_page_opml($cid = NULL) {
$result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title'); 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 = %d ORDER BY title', $cid);
}
else {
$result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title');
}
$output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<opml version=\"1.1\">\n"; $output .= "<opml version=\"1.1\">\n";