@ -29,61 +29,47 @@
< div class = "newsbox" >
< div class = "newsbox" >
<?
<?
/*
printf("< p id = 'lnews' > %s< / p > \n\n",_('Latest News'));
$query = "select *, UNIX_TIMESTAMP(`when`) as `TS` from news order by `when` desc limit 5";
$res = mysql_query($query);
$xml = "/www/pages/index/feed.rss"; // FIXME: use relative path to allow operation with different document root
while($row = mysql_fetch_assoc($res))
$dom = new DOMDocument();
{
$dom->preserveWhiteSpace = false;
echo "< p > < b > ".date("Y-m-d", $row['TS'])."< / b > - ".$row['short']."< / p > \n";
$dom->Load($xml);
if($row['story'] != "")
echo "< p > [ < a href = 'news.php?id=".$row[' id ' ] . " ' > "._("Full Story")."< / a > ]< / p > \n";
$xpath = new DOMXPath($dom); //Create an XPath query
}
if(mysql_num_rows(mysql_query("select * from `news`")) > 2)
$query = "//channel/item";
echo "< p > [ < a href = 'news.php' > "._("More News Items")."< / a > ]< / p > ";
$items = $xpath->query($query);
*/
$rss = "";
$count = 0;
$open = $items = 0;
foreach($items as $id => $item) {
$fp = @fopen("/www/pages/index/feed.rss", "r");
$query = "./title";
if($fp)
$nodeList = $xpath->query($query, $item);
{
$title = recode_string("UTF8..html" , $nodeList->item(0)->nodeValue);
echo '< p id = "lnews" > '._('Latest News').'< / p > ';
$query = "./link";
$nodeList = $xpath->query($query, $item);
while(!feof($fp))
$link = htmlspecialchars($nodeList->item(0)->nodeValue);
$rss .= trim(fgets($fp, 4096));
fclose($fp);
$query = "./description";
$rss = str_replace(">< ", ">\n< ", $rss);
$nodeList = $xpath->query($query, $item);
$lines = explode("\n", $rss);
$description = recode_string("UTF8..html" , $nodeList->item(0)->nodeValue);
foreach($lines as $line)
{
printf("< h3 > %s < / h3 > \n", $title);
$line = trim($line);
printf("< p > %s < / p > \n", $description);
printf("< p > [< a href = \"%s\" > %s < / a > ] < / p > \n\n", $link,_("Full Story"));
if($line != "< item > " & & $open == 0)
continue;
$title = '';
$description = '';
if($line == "< item > " & & $open == 0)
$link = '';
{
$open = 1;
$count++;
continue;
if ($count >= 3) {
}
break;
if($line == "< / item > " & & $open == 1)
{
$items++;
if($items >= 3)
break;
$open == 0;
continue;
}
if(substr($line, 0, 7) == "< title > ")
echo "< h3 > ".str_replace("& #", "& #", recode_string("UTF8..html", str_replace("& ", "", trim(substr($line, 7, -8)))))."< / h3 > \n";
if(substr($line, 0, 13) == "< description > ")
echo "< p > ".str_replace("& #", "& #", recode_string("UTF8..html", str_replace("& ", "", trim(substr($line, 13, -14)))))."< / p > \n";
if(substr($line, 0, 6) == "< link > ")
echo "< p > [ < a href = '".trim(substr($line, 6, -7))."' > "._("Full Story")."< / a > ]< / p > \n";
}
}
}
}
?>
?>
[ < a href = "http://blog.CAcert.org/" > <? = _ ( 'More News Items' ) ?> </ a > ]
[ < a href = "http://blog.CAcert.org/" > <? = _ ( 'More News Items' ) ?> </ a > ]
< / div >
< / div >
< hr / >
< hr / >
@ -127,4 +113,3 @@
< br / > < br / >
< br / > < br / >
<? = _ ( "If you want to participate in CAcert.org, have a look" ) ?> < a href = "http://wiki.cacert.org/wiki/HelpingCAcert" > <? = _ ( "here" ) ?> </ a > <? = _ ( "and" ) ?> < a href = "http://wiki.cacert.org/wiki/SystemTasks" > <? = _ ( "here" ) ?> </ a > .
<? = _ ( "If you want to participate in CAcert.org, have a look" ) ?> < a href = "http://wiki.cacert.org/wiki/HelpingCAcert" > <? = _ ( "here" ) ?> </ a > <? = _ ( "and" ) ?> < a href = "http://wiki.cacert.org/wiki/SystemTasks" > <? = _ ( "here" ) ?> </ a > .