diff options
author | anonymous <> | 2001-03-23 20:06:06 +0000 |
---|---|---|
committer | anonymous <> | 2001-03-23 20:06:06 +0000 |
commit | 8a752cbe89a752cf9d90011980460c6812bc6c7f (patch) | |
tree | a145823a266918d1a0199bad1b2bcd71c938f48d | |
parent | ec18a2a36692de21feef71ec356e71e3bfbed5c0 (diff) | |
download | brdo-8a752cbe89a752cf9d90011980460c6812bc6c7f.tar.gz brdo-8a752cbe89a752cf9d90011980460c6812bc6c7f.tar.bz2 |
*** empty log message ***
-rw-r--r-- | modules/headlineRSS10.module | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/modules/headlineRSS10.module b/modules/headlineRSS10.module new file mode 100644 index 000000000..8277c4307 --- /dev/null +++ b/modules/headlineRSS10.module @@ -0,0 +1,59 @@ +<?php + +// RSS 1.0 headline exporter (v0.1) +// +// Kristjan Jansen -- kika@sloleht.ee + +$module = array("export" => "headlineRSS10_export"); + +include_once "includes/common.inc"; +include_once "modules/backend.class"; + +function headlineRSS10_export($uri) { + global $site_name, $site_url, $HTTP_REFERER, $HTTP_USER_AGENT; + + if ($uri[1] == "headlinesRSS10.rdf") { + watchdog("message", "grabbed 'headlinesRSS10.rdf' - referring url: $HTTP_REFERER - user agent: $HTTP_USER_AGENT"); + + 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://purl.org/rss/1.0/\">\n\n"; + + print "<channel rdf:about=\"".$site_url."export/headlinesRSS10.rdf\">\n"; + print " <title>$site_name</title>\n"; + print " <link>$site_url</link>\n"; + print " <description>$site_name</description>\n"; + + + print " <items>\n"; + print " <rdf:Seq>\n"; + + $result = db_query("SELECT * FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT 10"); + + while ($story = db_fetch_object($result)) { + print " <rdf:li resource=\"". $site_url ."story.php?id=$story->id\" />\n"; + + } + + print " </rdf:Seq>\n"; + print " </items>\n"; + print "</channel>\n\n"; + + $result = db_query("SELECT * FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT 10"); + + while ($story = db_fetch_object($result)) { + print "<item rdf:about=\"".$site_url ."story.php?id=$story->id\">\n"; + print " <title>". check_export($story->subject) ."</title>\n"; + print " <link>". $site_url ."story.php?id=$story->id</link>\n"; + print "</item>\n"; + } + + print "</rdf:RDF>\n"; + } +} + +?> |