-
Notifications
You must be signed in to change notification settings - Fork 0
/
rss.php
24 lines (24 loc) · 1.03 KB
/
rss.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
header('Content-type: text/xml');
require_once 'lib/function.php';
require_once 'config/config.php';
require_once 'config/config.site.php';
$entry = sql_query('SELECT * FROM ' . DB_PREFIX . 'entry ORDER BY time DESC LIMIT 0,20');
echo '<?xml version="1.0" encoding="utf-8"?><rss version="2.0">';
echo '<channel>';
echo '<title><![CDATA[' . stripslashes(MF_NAME) . ']]></title>';
echo '<link>' . MF_URL . '</link>';
echo '<description><![CDATA[' . $site['introduction'] . ']]></description>';
echo '<language>zh</language>';
echo "<copyright>Copyright 2011 Powerd By MicroFan</copyright>";
while ($item = mysql_fetch_object($entry)) {
echo '<item>';
echo '<title><![CDATA[' . strip_tags(str_replace(' ', ' ',$item -> content)) . ']]></title>';
echo '<link>' . MF_URL . 'index.php?page=view' . stripslashes('&') .'id=' . $item -> id. '</link>';
echo '<description><![CDATA[]]></description>';
echo '<pubDate>' . date('r', $item -> time) . '</pubDate>';
echo '</item>';
}
echo '</channel>';
echo '</rss>';
?>