"SBU" , 'resolvetemplates' => true , 'templates' => array () , 'namespace_template' => 'Vorlage' , ) ; $content_provider = new ContentProviderTextFile ; $converter = new MediaWikiConverter ; $title = urldecode ( get_param ( 'title' , urlencode ( 'Main Page' ) ) ) ; $xmlg['page_title'] = $title ; $format = strtolower ( get_param ( 'format' , 'xhtml' ) ) ; $content_provider->basedir = $base_text_dir ; $text = $content_provider->get_wiki_text ( $title ) ; $xml = $converter->article2xml ( $title , $text , $xmlg ) ; if ( $format =="xml" ) { # XML header('Content-type: text/xml; charset=utf-8'); print "\n" ; print $xml ; } else if ( $format == "text" ) { # Plain text $xmlg['plaintext_markup'] = true ; $xmlg['plaintext_prelink'] = true ; $out = $converter->articles2text ( $xml , $xmlg ) ; $out = str_replace ( "\n" , "
" , $out ) ; header('Content-type: text/html; charset=utf-8'); print $out ; } else { # XHTML if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) { # Skipping the "strict" part ;-) header("Content-type: text/html; charset=utf-8"); # header("Content-type: application/xhtml+xml"); } else { # Header hack for IE header("Content-type: text/html; charset=utf-8"); } print $converter->articles2xhtml ( $xml , $xmlg ) ; } ?>