summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-08-23 05:45:08 +0000
committerDries Buytaert <dries@buytaert.net>2005-08-23 05:45:08 +0000
commit789dd294ff59423376d7fe42501ad197803a12cf (patch)
tree23b2393302518d099401c1caee471167e008df32
parent405cb49a0b904544ad89d89b738cc24431603aa3 (diff)
downloadbrdo-789dd294ff59423376d7fe42501ad197803a12cf.tar.gz
brdo-789dd294ff59423376d7fe42501ad197803a12cf.tar.bz2
- Modified patch #22637: added OPML export for aggregator categories.
-rw-r--r--modules/aggregator.module9
-rw-r--r--modules/aggregator/aggregator.module9
2 files changed, 14 insertions, 4 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module
index c7e1fb6c7..ec07192ea 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -1030,8 +1030,13 @@ function aggregator_page_sources() {
/**
* Menu callback; generates an OPML representation of all feeds.
*/
-function aggregator_page_opml() {
- $result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title');
+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 = %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 .= "<opml version=\"1.1\">\n";
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index c7e1fb6c7..ec07192ea 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -1030,8 +1030,13 @@ function aggregator_page_sources() {
/**
* Menu callback; generates an OPML representation of all feeds.
*/
-function aggregator_page_opml() {
- $result = db_query('SELECT * FROM {aggregator_feed} ORDER BY title');
+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 = %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 .= "<opml version=\"1.1\">\n";