<? 
if (function_exists('echo1')) {
    } else {
    
    
    
        function echo1($tekst) {
	    $tekst = strtr($tekst, "\xa6\xa1\xaf\xca\xc6\xac\xd3\xa3\xb6\xb1\xbf\xea\xe6\xbc\xf3\xb3",
	         "\x8c\xa5\xaf\xca\xc6\x8f\xd3\xa3\x9c\xb9\xbf\xea\xe6\x9f\xf3\xb3");
		       echo "$tekst";
		              }
			      
			             }
ini_set("error_reporting", E_ALL);
ini_set("display_errors",1);
header("Content-type: text/xml; charset=windows-1250"); 
echo "<";
echo "?";
echo "xml version=\"1.0\" encoding=\"windows-1250\"";
echo "?";
echo ">";
include('user.php');
$id_usera55=$_SERVER['id_usera1'];
$ip=$_SERVER['REMOTE_ADDR'];
$data_ip=date("U");
$res=pg_exec("insert into stat_rss values(nextval('stat_rss_id'),$id_usera55,'$ip',$data_ip)");
$res=pg_exec("select id,tytul,tresc,data3,coment,poziom from notka where id_usera=$id_usera55 order by id desc limit 15");
$res1=pg_exec("select * from users where id=$id_usera55");
$loginek=pg_result($res1,0,'login');
echo "
<rss version=\"2.0\"  xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\" xmlns:admin=\"http://webns.net/mvcb/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">
<channel>
<title>$loginek.eblog.pl</title>
<link>http://$loginek.eblog.pl</link>
<description>Najnowsze notki na $loginek.eblog.pl </description>
";
$ile=pg_numrows($res);
for ($i=0; $i<=$ile-1; $i++) {
$tytul=pg_result($res,$i,'tytul');
$tresc=pg_result($res,$i,'tresc');
$id_n=pg_result($res,$i,'id');
$data3=pg_result($res,$i,'data3');
$data3=str_replace(" +0200"," GMT",$data3);
//$data3="Fri, 26 May 2006 15:14:04";

$coment=pg_result($res,$i,'coment');
$status=pg_result($res,$i,'poziom');
if ($coment==-1) {$coment=0;}
$tytul=strip_tags($tytul);
$tytul=str_replace("&#39","`",$tytul);
$tytul=str_replace("&","",$tytul);
$tresc=strip_tags($tresc);
$tresc=substr($tresc,0,150);
//$tresc=str_replace("&","",$tresc);
//$tresc=str_replace(";","",$tresc);
//$tresc=str_replace(".","",$tresc);
echo "<item>
<title>$tytul</title>
<description>";
?>
<![CDATA[
<?
echo1 ("$tresc");
?>
]]>
<?echo"
</description>
";
if ($data3<>'') {echo "<pubDate>$data3</pubDate>";} else {echo "<pubDate>Wed, 22 Jun 2001 16:20:46 +0200</pubDate>";}
echo "<link>http://$loginek.eblog.pl/comment.php?id_notki=$id_n</link>
<guid>http://$loginek.eblog.pl/comment.php?id_notki=$id_n</guid>
</item>
";
}

echo "</channel>
</rss>";
 ?>
 
