<?php header('Content-type: text/xml'); ?>

<rss version="2.0">
<channel>
<title>Ex-Bones (RSS 2.0)</title>
<description>The World's Most Popular Website</description>
<link>http://www.ex-bones.com/</link>
<copyright>Ex-Bones (c) 2004-2005</copyright>

<?php
$dbh=mysql_connect ("mysql.ex-bones.com", "nedsferatu", "Ikd.tIf5") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("exbones_old");

$sql="SELECT date, content, location FROM news WHERE date <= CURDATE() UNION SELECT date, link_name, location FROM drawings WHERE date <= CURDATE() ORDER BY date DESC LIMIT 20";

$results=mysql_query($sql);

while($row=mysql_fetch_array($results)) {
  $title=strip_tags($row['content']);
  $title=substr($row['content'],0,20);
  $date=$row['date'];
  $location=$row['location'];
  $body=strip_tags($row['content']);
  $body=substr($row['content'],0,150);
  $pubDate=strftime("%a, %d %b %Y %T %Z",$row['date']);

  // output to client
	
?>

  <item>
  <title><?php print htmlentities($title, ENT_QUOTES);?></title>
  <description><?php print htmlentities($body, ENT_QUOTES);?>...</description>
  <link>http://www.ex-bones.com/<?php print $location ?></link> 
  <pubDate><?php print $pubDate;?></pubDate>
  </item>

<?php 
  } 
?>

</channel>
</rss>
