Merge alternate branch 'bug-1190' by magu into bug-1190
authorBenny Baumann <BenBE@geshi.org>
Sun, 14 Jul 2013 20:55:13 +0000 (22:55 +0200)
committerBenny Baumann <BenBE@geshi.org>
Sun, 14 Jul 2013 20:55:13 +0000 (22:55 +0200)
pages/index/0.php

index 3afdc72..a44b0a8 100644 (file)
 
 
 <div class="newsbox">
-    <?
-    printf("<p id='lnews'>%s</p>\n\n",_('Latest News'));
+<?
+       printf("<p id='lnews'>%s</p>\n\n",_('Latest News'));
 
-    $xml = "/www/pages/index/feed.rss"; // FIXME: use relative path to allow operation with different document root
-    $dom = new DOMDocument();
-    $dom->preserveWhiteSpace = false;
-    $dom->Load($xml);
+       $xml = "/www/pages/index/feed.rss"; // FIXME: use relative path to allow operation with different document root
+       $dom = new DOMDocument();
+       $dom->preserveWhiteSpace = false;
+       $dom->Load($xml);
 
-    $xpath = new DOMXPath($dom);    //Create an XPath query
+       $xpath = new DOMXPath($dom);    //Create an XPath query
 
-    $query = "//channel/item";
-    $items = $xpath->query($query);
+       $query = "//channel/item";
+       $items = $xpath->query($query);
 
-    foreach($items as $id => $item) {
-                    $query = "./title";
-                    $nodeList = $xpath->query($query, $item);
-                    $title = str_replace("&amp;#", "&#", recode_string("UTF8..html" , $nodeList->item(0)->nodeValue));
+       foreach($items as $id => $item) {
+               $query = "./title";
+               $nodeList = $xpath->query($query, $item);
+               $title = str_replace("&amp;#", "&#", recode_string("UTF8..html" , $nodeList->item(0)->nodeValue));
 
-                    $query = "./link";
-                    $nodeList = $xpath->query($query, $item);
-                    $link = $nodeList->item(0)->nodeValue;
+               $query = "./link";
+               $nodeList = $xpath->query($query, $item);
+               $link = $nodeList->item(0)->nodeValue;
 
-                    $query = "./description";
-                    $nodeList = $xpath->query($query, $item);
-                    $description = str_replace("&amp;#", "&#", recode_string("UTF8..html" , $nodeList->item(0)->nodeValue));
+               $query = "./description";
+               $nodeList = $xpath->query($query, $item);
+               $description = str_replace("&amp;#", "&#", recode_string("UTF8..html" , $nodeList->item(0)->nodeValue));
 
-                    printf("<h3> %s </h3>\n", $title);
-                    printf("<p> %s </p>\n", $description);
-                    printf("<p>[<a href='%s'> %s </a> ] </p>\n\n", $link,_("Full Story"));
+               printf("<h3> %s </h3>\n", $title);
+               printf("<p> %s </p>\n", $description);
+               printf("<p>[<a href='%s'> %s </a> ] </p>\n\n", $link,_("Full Story"));
 
-                    $title = '';
-                    $description = '';
-                    $link = '';
-}
+               $title = '';
+               $description = '';
+               $link = '';
+       }
 ?>
 
 [ <a href="http://blog.CAcert.org/"><?=_('More News Items')?></a> ]