<? echo '<?xml version="1.0" encoding="windows-1251"?>';?>
<rss version="2.0"> 
	<channel> 
		<title>����� � ��������</title> 
		<link>http://kuzba.ru</link> 
		<description>���������� ������� ��������</description> 
		<copyright>Copyright (c) Kuzba.ru</copyright> 

<?
date_default_timezone_set('Asia/Novosibirsk');
require_once $_SERVER['DOCUMENT_ROOT']."/inc/DbSimple/Generic.php";
require_once $_SERVER['DOCUMENT_ROOT']."/inc/DbSimple/Mysql.php";
$DB = DbSimple_Generic::connect("mysql://kuzba:b2761NT7wX@localhost/kuzba");
include_once ($_SERVER['DOCUMENT_ROOT'].'/inc/class.inc.php');
		mysql_query ("set character_set_client='cp1251'");
        mysql_query ("set character_set_results='cp1251'");
        mysql_query ("set collation_connection='cp1251_general_ci'");
$object= new myclass();

function clear_yandex($text)
{
$text=preg_replace("/<.*>/Ui",'',$text);
//$text=str_replace('&','&amp;',$text);
$text=str_replace('<','&lt;',$text);
$text=str_replace('>','&gt;',$text);
$text=str_replace("'",'&apos;',$text);
$text=str_replace('"','&quot;',$text);
$text=str_replace('&nbsp;',' ',$text);
$text=str_replace('&laquo;','&quot;',$text);
$text=str_replace('&raquo;','&quot;',$text);
$text=str_replace('&ndash;','-',$text);
$text=str_replace('&mdash;','-',$text);
$text=str_replace('&hellip;','...',$text);

return $text;
}


if (1==2){
$DB->setLogger('myLogger');
function myLogger($db, $sql)
{
  $caller = $db->findLibraryCaller();
  $tip = "at ".@$caller['file'].' line '.@$caller['line'];
  // �������� ������ (�������, Debug_HackerConsole �����)
  echo "<xmp title=\"$tip\">"; print_r($sql); echo "</xmp>";
}
}
?>
 
 
 
<?
$news=$DB->select("SELECT * FROM ".$object->tables['news']." WHERE status=1 and type='news' ORDER BY DATE DESC LIMIT 0,10");
foreach ($news as $news)
{
?>
<item> 
	<title><? echo clear_yandex($news['head']);?></title> 
	<description><? echo clear_yandex(strip_tags($news['short']));?></description> 
	<enclosure url="http://kuzba.ru/image/news/<? echo $news['id'];?>.jpg"/>
	<link>http://kuzba.ru/news-<? echo $news['id'];?>.html</link> 
	<pubDate><? echo $object->GetDate($news['date'], 'r');?></pubDate> 
</item> 
<?
}
?> 


	</channel> 
</rss>