<?php
include 'core.php';
print '<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
<title>Hany.ro</title>
	<atom:link href="http://hany.ro/feed/" rel="self" type="application/rss+xml" />
	<link>http://hany.ro</link>
	<description>Ultimele produse</description>
	<language>ro-RO</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>Hany.ro</generator>';
$rez=$db->run('select a.*, b.slug as subcat, c.slug as maincat from produse as a, categorii_bf as b, categorii_bf as c where a.ap=1 and b.id=a.category and c.id=b.root order by a.id DESC limit 0,10');
while($row=$db->db_fetch_array($rez))
{		
	$mylink=$_SESSION['sPATH'].'/'.$row['maincat'].'/'.$row['subcat'].'/'.$row['id'].'_'.seotransform($row['title']).'.html';
	$jucariinoi.='<item><title>'.$row['title'].'</title><description><![CDATA[<p align="center">';
	if($row['imgurl']=='') $jucariinoi.='<img width="150" src="'.$_SESSION['sPATH'].'/produse/'.$row['id'].'.jpg" alt="'.$row['title'].'">';
	else
	$jucariinoi.='<img width="150" src="'.$row['imgurl'].'" alt="'.$row['title'].'">';
	$jucariinoi.='</p>'.substr(strip_tags($row['description']),0,200).'...]]></description><link>'.$mylink.'</link></item>';
}
print $jucariinoi;
?>
</channel>
</rss>