<?php echo '<?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><?php echo get_setting('site_name'); ?></title>
		<atom:link href="<?php echo get_js_url('/feed/'); ?>" rel="self" type="application/rss+xml" />
		<link><?php echo get_setting('base_url'); ?></link>
		<description><?php echo get_setting('description'); ?></description>
		<language>en-gb</language>
		<generator>TanyaCMS</generator>
		<?php foreach($this->list as $key => $val){ ?>
		<item>
			<title><?php echo $val['question_content']; ?></title>
			<link><?php echo get_js_url('/question/' . $val['question_id']); ?></link>
			<description><![CDATA[<?php echo nl2br(utf8_substr($val['question_detail'], 0, 150, 'UTF-8', '...')); ?>]]></description>
			<pubDate><?php echo date('r', $val['add_time']); ?></pubDate>
			<guid isPermaLink="false"><?php echo get_js_url('/question/' . $val['question_id']); ?></guid>
		</item>
		<?php } ?>
	</channel>
</rss>