From e32241e59ae93dced80d561350e9c45bf1ca264d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 28 May 2001 18:53:48 +0000 Subject: - Renamed syndication.module to import.module. - Removed headline.module: it became obsolete. - Removed backend.class: it became obsolete. - Added export.module. For now, you can use: 1. http://drupal/export.php?headlines.rss 2. http://drupal/export.php?headlines.rdf - Renamed export to export.php. For now, you can use: 1. http://drupal/export.php?headlines.rss 2. http://drupal/export.php?headlines.rdf Renaming this file has main 3 advantages: 1. We no longer rely on .htaccess for being able to export. 2. It is more conform with the general naming conventions. 3. It removes a pseudo-hack with formatting the URI. - Made import.module export blocks with feeds. --- modules/export.module | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 modules/export.module (limited to 'modules/export.module') diff --git a/modules/export.module b/modules/export.module new file mode 100644 index 000000000..b65fa569b --- /dev/null +++ b/modules/export.module @@ -0,0 +1,87 @@ +\n"; + print "\n"; + + print "\n"; + print " ". variable_get(site_name, "drupal") ."\n"; + print " ". path_uri() ."\n"; + print " ". variable_get(site_name, "drupal") ."\n"; + print "\n"; + + $result = db_query("SELECT * FROM node WHERE promote = '1' AND status = '$status[posted]' ORDER BY timestamp DESC LIMIT 10"); + + while ($node = db_fetch_object($result)) { + print "\n"; + print " ". check_export($node->title) ."\n"; + print " ". path_uri() ."node.php?id=$node->nid\n"; + print "\n"; + } + + print "\n"; +} + +function export_export_rss() { + global $status; + + header("Content-Type: text/plain"); + + print "\n"; + print "\n\n"; + + print "\n"; + print " ". variable_get(site_name, "drupal") ."\n"; + print " ". path_uri() ."\n"; + print " ". variable_get(site_name, "drupal") ."\n"; + + print " \n"; + print " \n"; + + $result = db_query("SELECT * FROM node WHERE promote = '1' AND status = '$status[posted]' ORDER BY timestamp DESC LIMIT 10"); + + while ($node = db_fetch_object($result)) { + print " nid\" />\n"; + } + + print " \n"; + print " \n"; + print "\n\n"; + + $result = db_query("SELECT * FROM node WHERE promote = '1' AND status = '$status[posted]' ORDER BY timestamp DESC LIMIT 10"); + + while ($node = db_fetch_object($result)) { + print "nid\">\n"; + print " ". check_export($node->title) ."\n"; + print " ". path_uri() ."node.php?id=$node->nid\n"; + + if ($node->abstract) print " ". check_output($node->abstract, 1) ."\n"; + if ($node->body) print " ". check_output($node->body, 1) ."\n"; + + print "\n"; + } + + print "\n"; +} + +function export_export($query) { + switch ($query) { + case "headlines.rss": + export_export_rss(); + break; + case "headlines.rdf": + case "default": + export_export_rdf(); + } +} + +?> -- cgit v1.2.3