Update of /cvsroot/gc-linux/htdocs/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11934
Modified Files:
news.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.php
===================================================================
RCS file: /cvsroot/gc-linux/htdocs/include/news.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- news.php 23 Jan 2004 11:50:39 -0000 1.1.1.1
+++ news.php 6 Dec 2004 13:20:00 -0000 1.2
@@ -1,23 +1,20 @@
<?
-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");
- }
-
-$xsl = file_get_contents('./xml/en/news.xsl');
-print libxslt_transform($xml, $xsl);
+// 20041206 Albert Herranz
-function file_get_contents($filename) {
- $fd = fopen("$filename", "rb");
- $content = fread($fd, filesize($filename));
- fclose($fd);
- return $content;
+if (file_exists("./xml/{$lang}/news.xml")) {
+ $xml_file = "./xml/{$lang}/news.xml";
+} else {
+ $xml_file = "./xml/en/news.xml";
}
+
+$xsl_file = './xml/en/news.xsl';
+
+$xml = domxml_open_file($xml_file);
+$xsl = domxml_xslt_stylesheet_file($xsl_file);
+
+$result = $xsl->process($xml);
+print $result->dump_mem();
+
?>
|