Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=homepage-ng.git;a=commitdiff;h=951b89415f591b2513f3a36db54b604dce6ed5ec

commit 951b89415f591b2513f3a36db54b604dce6ed5ec
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Fri Oct 2 00:41:25 2009 +0200

add support for localised news feeds

diff --git a/frugalware/rewrite.php b/frugalware/rewrite.php
index 20f063f..3eda4d9 100644
--- a/frugalware/rewrite.php
+++ b/frugalware/rewrite.php
@@ -117,6 +117,14 @@ if($_SERVER["QUERY_STRING"]!="")
// build the url
$url="http://"; . $_SERVER["SERVER_NAME"] . "$fwng_root$page.php$urlsuffix";

+if(isset($lang))
+       $lang = getlang($lang);
+else
+       $lang = getlang();
+if(!isset($urlsuffix))
+       $url.="?lang=$lang";
+else
+       $url.="&lang=$lang";
if($page=="rss" and isset($urlsuffix))
{
// special header + those page can have <?xml..
@@ -125,14 +133,6 @@ if($page=="rss" and isset($urlsuffix))
}
else
{
-       if(isset($lang))
-               $lang = getlang($lang);
-       else
-               $lang = getlang();
-       if(!isset($urlsuffix))
-               $url.="?lang=$lang";
-       else
-               $url.="&lang=$lang";
if(strpos($url, ".text"))
header("Content-type: text/plain; charset=UTF-8");
else if(strpos($url, ".pdf"))
diff --git a/frugalware/rss.php b/frugalware/rss.php
index a210105..197a790 100644
--- a/frugalware/rss.php
+++ b/frugalware/rss.php
@@ -112,10 +112,11 @@ switch($_GET['type'])

case "news";
include("xml.inc.php");
-               if (file_exists("xml/news.xml"))
-                       $xmlfile = "xml/news.xml";
+               $flang = ( $lang == "en" ) ? "" : "_$lang";
+               if (file_exists("xml/news".$flang.".xml"))
+                       $xmlfile = "xml/news".$flang.".xml";
else
-                       $xmlfile = $docs_path."/xml/news.xml";
+                       $xmlfile = $docs_path."/xml/news".$flang.".xml";
$xml = file_get_contents($xmlfile);
$parser = new XMLParser($xml);
$parser->Parse();
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to