From: <he...@us...> - 2004-12-06 13:16:52
|
Update of /cvsroot/gc-linux/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11204 Modified Files: news_archive.php Log Message: Modified code to not depend on external php_libxslt.so. (This fixes the web site after the move to the new web servers) Indentation changes. Index: news_archive.php =================================================================== RCS file: /cvsroot/gc-linux/htdocs/news_archive.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- news_archive.php 23 Jan 2004 11:50:35 -0000 1.1.1.1 +++ news_archive.php 6 Dec 2004 13:16:44 -0000 1.2 @@ -1,8 +1,7 @@ <? -if (!isset($lang)) - { - $lang = "en"; - } +if (!isset($lang)) { + $lang = "en"; +} ?> <html> <head> @@ -24,25 +23,20 @@ <h1>News Archive</h1> <p> <? -dl("../../../../../home/groups/g/gc/gc-linux/php/php_libxslt.so"); -if (file_exists("./xml/{$lang}/news.xml")) - { - $xml = file_get_contents("./xml/{$lang}/news.xml"); - } - else - { - $xml = file_get_contents("./xml/en/news.xml"); - } +if (file_exists("./xml/{$lang}/news.xml")) { + $xml_file = "./xml/{$lang}/news.xml"; +} else { + $xml_file = "./xml/en/news.xml"; +} -$xsl = file_get_contents('./xml/en/news_archive.xsl'); -print libxslt_transform($xml, $xsl); +$xsl_file = './xml/en/news_archive.xsl'; + +$xml = domxml_open_file($xml_file); +$xsl = domxml_xslt_stylesheet_file($xsl_file); + +$result = $xsl->process($xml); +print $result->dump_mem(); -function file_get_contents($filename) { - $fd = fopen("$filename", "rb"); - $content = fread($fd, filesize($filename)); - fclose($fd); - return $content; -} ?> </p> </td> |