<?php
/**
 *\licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
 *\portion code Copyright (c) 2002 osCommerce
 *\package osCSS-2 <www http://www.oscss.org>
 *\version 2.0.9
 *\date  22/06/10, 09:21
 *\author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
 *\encode UTF-8
 *\file
 *\dir catalog/
 *\brief page des flux
*/

header("Content-type: application/rss+xml");

include('includes/application_top.php');

$page->init(basename(__FILE__),$language);

$class = (isset($_GET['box']) && tep_not_null($_GET['box']))? $_GET['box'] : "feeds";
$file = DIR_WS_INCLUDES .'rss/' . $class . '.php';

if (file_exists($file)) {
 include(DIR_WS_LANGUAGES.$language.'/rss/' . $class . '.php');
 require($file);
}
if(!class_exists($class)) exit;
$list_item=new $class();


print '<?xml version="1.0" encoding="'. CHARSET .'"?>' . "\n";
print '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">' . "\n";
print '  <channel>' . "\n";
print "    <title>".STORE_NAME." : ".$list_item->title."</title>\n";
print "    <description>".$list_item->description."</description>\n";
print "    <link>".HTTP_SERVER.DIR_WS_CATALOG."</link>\n";

  foreach($list_item->feed() as $item) {
    print '    <item>' . "\n";
    foreach($item as $k=>$v)  print '<'.$k.'>' . $v . '</'.$k.'>'. "\n";
    print '    </item>' . "\n";
  }

print "  </channel>\n";
print "</rss>\n";
?>