<?
header('Content-type: application/rss+xml'); 
?>
<?php

include("/home/tequila9/domains/halicontrove.com/include/connectchallenge.inc");

require_once "UBBCode.php";

$class = new UBBCode;

?>
<? echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"); ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Halicon Trove</title>
<description>Updates and Other Crap</description>
<link>http://www.halicontrove.com/lifeupdates/</link>
<copyright>2004 halicontrove.com</copyright>

<?

 $getinfo = "SELECT life_updates.id, life_users.username, life_updates.title, life_updates.diary, UNIX_TIMESTAMP(dateadded) as date FROM life_updates LEFT JOIN life_users on life_updates.userid = life_users.id order by date DESC LIMIT 0, 35";  
 $dogetinfo = mysql_query($getinfo);

while($item=mysql_fetch_array($dogetinfo))
 {

  $id=$item['id'];
  $user=htmlentities($item['username']);
  if($item['title']){
    $snip=htmlentities($item['title']);
  }else{
    $snip=htmlentities(substr(strip_tags($class->encode($item['diary'])),0,50), ENT_QUOTES);
    $snip=str_replace("\r\n", " ", $snip);
  }
  //$body=substr(strip_tags($class->encode($item['diary'])),0,150);
  $body=$class->encode($item['diary']);
  //$body=htmlentities($body, ENT_QUOTES);
  $bad_characters = array('&', '\\', '>', '<');  
  $dbody=str_replace($bad_characters,'?',substr(strip_tags($body),0 ,150))."...";
  $pubDate=strftime("%a, %d %b %Y %T %Z",$item['date']);

  // output to browser
	
?>

  <item>
  <title><?print $user;?>: <?print $snip;?></title>
  <description><?print $dbody;?></description>
  <link>http://www.halicontrove.com/lifeupdates/index.php#<?print $id;?></link> 
  <content:encoded><![CDATA[<?print $body;?>]]></content:encoded>
  <pubDate><?print $pubDate;?></pubDate>
  </item>

<?
  } 
?>

</channel>
</rss>

