<?php
/*
+--------------------------------------------------------+
| O-BLOG - PHP Blog System                               |
| Copyright (c) 2004 phpBlog.CN                          |
| Support : http://www.phpBlog.cn                        |
| Author : ShiShiRui (shishirui@163.com)                 |
|--------------------------------------------------------+
*/
error_reporting(7);
require('config.php');
require('class/rss.php');

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

print <<< END
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">

<channel about="http://$URL">
<title><![CDATA[{$title}]]></title> 
<link><![CDATA[http://{$URL}]]></link>
<description><![CDATA[{$discribe}]]></description>
<language><![CDATA[zh-cn]]></language>
<copyright><![CDATA[O-blog]]></copyright>
END;

for($i = 0;$i<$blognum;$i++)
{
$a[1]	= $blog[$i]['id'];
$a[2]	= $blog[$i]['title'];
$a[3]	= obdate('r',$blog[$i]['date']);
$a[4]	= $blog[$i]['classid'];
$a[5]	= $blog[$i]['content'];
$a[6] = ($makehtml) ? "http://".$URL."/".getHtmlPath($blog[$i]['id']) : "http://".$URL."/index.php?id=".$blog[$i]['id'];
$a[7]	= cn_substr($a[5],200);
$ubb = new Ubb();
$ubb->setString($a[7]);
$a[7] = $ubb->parse();
print <<< END
<item>
<title><![CDATA[{$a[2]}]]></title>
<link><![CDATA[{$a[6]}]]></link>
<pubDate><![CDATA[{$a[3]}]]></pubDate>
<guid><![CDATA[{$a[6]}]]></guid>
<description><![CDATA[{$a[7]}]]></description>
</item>
END;
}
print <<< END
</channel>
</rss>
END;

?>