diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-12-25 21:13:13 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-12-25 21:13:13 +0000 |
commit | 649b61db2229e40ccf81570839c7962d455031ed (patch) | |
tree | b7a6b9b851f64a7f276efbce71d90a1f405f9d02 | |
parent | ea873bc7e2ce75847295118d3b9bcf123ffb10d1 (diff) | |
download | brdo-649b61db2229e40ccf81570839c7962d455031ed.tar.gz brdo-649b61db2229e40ccf81570839c7962d455031ed.tar.bz2 |
- added RDF backend
-rw-r--r-- | modules/backend.module | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/modules/backend.module b/modules/backend.module index ab8c6ab9e..a06b26caa 100644 --- a/modules/backend.module +++ b/modules/backend.module @@ -8,7 +8,36 @@ $module = array("page" => "backend_page", include "includes/common.inc"; include "modules/backend.class"; -function backend_page() { +function backend_rdf() { + global $site_name, $site_url; + + header("Content-Type: text/plain"); + + print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"; + print "<rdf:RDF\n"; + print " xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n"; + print " xmlns=\"http://my.netscape.com/rdf/simple/0.9/\">\n"; + + print "<channel>\n"; + print " <title>$site_name</title>\n"; + print " <link>$site_url</link>\n"; + print " <description>$site_name</description>\n"; + print "</channel>\n"; + + $result = db_query("SELECT * FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT 10"); + + while ($story = db_fetch_object($result)) { + print "<item>\n"; + print " <title>$story->subject</title>\n"; + print " <link>". $site_url ."discussion.php?id=$story->id</link>\n"; + print "</item>\n"; + } + + print "</rdf:RDF>\n"; + +} + +function backend_blocks() { global $theme; // Get channel info: @@ -44,6 +73,18 @@ function backend_page() { $theme->footer(); } +function backend_page() { + global $type; + + switch($type) { + case "rdf": + backend_rdf(); + break; + default: + backend_blocks(); + } +} + function backend_cron() { $result = db_query("SELECT * FROM channel"); while ($channel = db_fetch_object($result)) { |