<?php
/**
  @licence GPL 2005-2011  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  11/02/11, 09:34
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
  @brief news xml by community
*/
?>
 <div id="homeNews" class="box">
 <h3><?php echo __('heading news feed') ;?></h3>

<?php
if ($language=="fr_FR") {
$FeedUrl="http://oscss.org/spip.php?page=backend&id_rubrique=9&lang=fr";
}else{
$FeedUrl="http://oscss.org/spip.php?page=backend&id_rubrique=9&lang=en";
}
$nbFeed = 3;
try{

  if(!$SimpleParser = @simplexml_load_string(fileUtility::url_fopen($FeedUrl,2))) throw new Exception(__('Flux introuvable'));
  foreach($SimpleParser->xpath('channel/item') as $item) {
      $FeedDate = $item->xpath('dc:date');
      print("<dl>\n");
      printf("<dt><a href='%s'>%s</a> <span class=\"date\">(%s)</span></dt>\n",(string)$item->link, (string)$item->title, str_replace(array('T','Z'),' ',(string)$FeedDate[0]));
      printf("<dd>%s</dd>\n",(string)$item->description);
      print("</dl>\n");
  }
}
catch(Exception $e){
  echo $e->getMessage();
}
?>

 <div class="separator"></div>
 </div>