<?php
require_once('connectdb.php');
require_once('functions.php');
mysql_select_db($mydbname,$mydb);
mssql_select_db($msdbname,$msdb);
echo '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n";
echo '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">'."\n";
echo ' <channel>'."\n";
echo ' <title>RSS Newsfeed</title>'."\n";
echo ' <link>http://lala.domain.bumm</link>'."\n";
echo ' <description></description>'."\n";
echo ' <language>en</language>'."\n";
echo ' <lastBuildDate>'.date('D, d M Y H:i:s T',time()).'</lastBuildDate>'."\n";
echo ' <generator>RSS Script</generator>'."\n";
echo ' <ttl>60</ttl>'."\n";
$news=mysql_query("select * from `news` where `type`='private' order by `id` desc limit 5",$mydb);
while ($new=mysql_fetch_assoc($news))
{
$users=mysql_query("select * from `users` where `id`='".$new['userid']."' limit 1",$mydb);
$user=mysql_fetch_assoc($users);
$description=cutatspace(strip_tags(replacetags($new['text'])),100);
if (strlen($description[0])<strlen(strip_tags(replacetags($new['text']))))
{
$description[0].=' ...';
}
echo ' <item>'."\n";
echo ' <title>'.$new['title'].'</title>'."\n";
echo ' <link>http://lala.domain.bumm</link>'."\n";
echo ' <pubDate>'.date('D, d M Y H:i:s T',$new['newsdate']).'</pubDate>'."\n";
echo ' <description>'.$description[0].'</description>'."\n";
echo ' <content:encoded><![CDATA['.nl2br(replacetags($new['text'])).']]></content:encoded>'."\n";
echo ' <category domain="http://lala.domain.bumm">News</category>'."\n";
echo ' <dc:creator>'.$user['username'].'</dc:creator>'."\n";
echo ' </item>'."\n";
}
echo ' </channel>'."\n";
echo '</rss>'."\n";
$mydb=mysql_close($mydb);
$msdb=mssql_close($msdb);
?>