rss feed plus

Added an action for creating an RSS 1.0 (RDF) feed. To make this work,
added a couple of helper functions to util, and changed the HTML stuff
to use the helper functions.

Also, changed a bit of formatting in the profile. Yeah, not a clean
changeset.

darcs-hash:20080521143351-84dde-d191761c399d7f014b990585c21e916e887b3401.gz
This commit is contained in:
Evan Prodromou
2008-05-21 10:33:51 -04:00
parent b86a51ec8a
commit cb45529d8d
3 changed files with 155 additions and 11 deletions

View File

@@ -65,17 +65,31 @@ function common_element($tag, $attrs=NULL, $content=NULL) {
common_element_end($tag);
}
function common_start_xml($doc=NULL, $public=NULL, $system=NULL) {
global $xw;
$xw = new XMLWriter();
$xw->openURI('php://output');
$xw->setIndent(true);
$xw->startDocument('1.0', 'UTF-8');
if ($doc) {
$xw->writeDTD($doc, $public, $system);
}
}
function common_end_xml() {
global $xw;
$xw->endDocument();
$xw->flush();
}
function common_show_header($pagetitle) {
global $config, $xw;
header('Content-Type: application/xhtml+xml');
$xw = new XMLWriter();
$xw->openURI('php://output');
$xw->setIndent(true);
$xw->startDocument('1.0', 'UTF-8');
$xw->writeDTD('html', '-//W3C//DTD XHTML 1.0 Strict//EN',
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
common_start_xml('html',
'-//W3C//DTD XHTML 1.0 Strict//EN',
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
# FIXME: correct language for interface
@@ -121,8 +135,7 @@ function common_show_footer() {
common_element_end('div');
common_element_end('body');
common_element_end('html');
$xw->endDocument();
$xw->flush();
common_end_xml();
}
function common_text($txt) {