<?

// Database connection
if (!$msLink = mysql_connect("localhost", "ukgamer_admin", "Bradford0113")) {
        die("MYSQL Daemon not responding. Contact server administrator");
}
if (!mysql_select_db("ukgamer", $msLink)) {
        die("UKGamer database doesn't exist. Contact server administrator".mysql_error());
}

header('Content-type: text/xml'); 
?>

<rss version="2.0">
<channel>
<title>3DVelocity news RSS Feed</title>
<description>Honey coated hardware news</description>
<link>http://www.3dvelocity.com</link>
<copyright>3DVelocity</copyright>

<?
      $query = mysql_query("Select news.subject, news.BottomBody, users.Name, news.id from news, users where (news.site = '1') AND (news.view = '1') AND (news.author = users.id) ORDER BY news.id DESC LIMIT 25"); // Grabs the main post
			while ($row = mysql_fetch_row($query)){


  $title=strip_tags($row[0]);
  $body=strip_tags($row[1]);
  $body=substr($row[1],0,150);
	$tim = mktime();
  $pubDate=strftime("%a, %d %b %Y %T %Z",$tim);
	
  // output to browser
	
?>

  <item>
  <title><?print htmlentities($title, ENT_QUOTES);?></title>
 
  <link>http://www.3dvelocity.com/?id=<?print $row[3];?></link> 
	<pubDate><?print $pubDate;?></pubDate>
	</item>

<? 
  } 
?>

</channel>
</rss>