<? header('Content-type: text/xml');
require_once("/maxforlive.com/config/m4l_config.php");
$db = mysql_connect($dbHost,$dbUser,$dbPass) or die ("Cannot connect to database");
mysql_select_db ($dbName) or die("Could not select database");
?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <atom:link href="http://www.maxforlive.com/rss/news.xml" rel="self" type="application/rss+xml" />
		<title>Max for Live . com </title>
		<description>The syndicated news feed from free online device library for Max for Live</description>
		<link>http://www.maxforlive.com</link>
		<copyright>2009 Maxforlive.com</copyright>

		<?php
		$q="SELECT id,title,news,UNIX_TIMESTAMP(date) AS pubDate FROM tbl_news ORDER BY pubDate DESC LIMIT 0,10";
		$doGet=mysql_query($q);

		while($result = mysql_fetch_array($doGet)){
		$id = $result['id'];
      $link = htmlentities("http://www.maxforlive.com/news.php?id=$id");
		?> 
		<item> 
		<title><?php echo htmlentities(strip_tags($result['title']), ENT_QUOTES, 'UTF-8'); ?></title> 
		<description> <?php echo htmlentities($result['news'], ENT_QUOTES, 'UTF-8');?></description> 
		<link><?php echo $link;?></link> 
		<guid><?php echo $link;?></guid> 
		<pubDate> <?=strftime( "%a, %d %b %Y %T %Z" , $result['pubDate']); ?></pubDate> 
		</item>
		<?php } ?>  
	 </channel>
</rss>

