if ($_REQUEST['urlfill']) { $struct->toOPMLfields(); $struct->fillURLs(); } //if urlfill, then ensure xml and html URLs by calling ->fillURLs. The toOPMLfields is not necessary but helps fillURLs do it's job easier. if ($_REQUEST['output'] == 'opml') { //output OPML header('Content-Type: application/xml;charset=utf-8'); //send the XML http header $struct->toOPMLfields(); //convert fields to standard OPML field names if ($_REQUEST['simplify']) { $struct->simplify(); } //if we're simplifying, do so echo $struct->toOPML(); //echo the OPML code for the object exit; //we're done } //end if output == opml if ($_REQUEST['output'] == 'xoxo') { //output XOXO if (count($classes) < 1) { $classes = array('xoxo'); } //If we were not passed classes, output has default class of 'xoxo' header('Content-Type: application/xml;charset=utf-8'); //sent the XML http header (should be HTML or XHTML, but is XML so Ning stuff doesn't get output and mess it up) echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' . "\n"; //Output XHTML 1.1 doctype so that etc is legal