<?php
header("Content-Type: application/xml");
echo('<?xml version="1.0" encoding="iso-8859-1"?>');
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>BrandonE97</title>
		<link>http://www.BrandonE97.com/</link>
		<description>BrandonE97 is a site created for my own fun and experience with websites/servers. Movies, Stories, and a few more things are found here. Hope you enjoy my little place on the net! This feed contains my recent blog post.</description>
		<language>en-us</language>
		<copyright>Copyright 2007 BrandonE97 Networks</copyright>
		<image>
			<url>http://www.brandone97.com/images/97-miles.jpg</url>
			<title>BrandonE97</title>
			<link>http://www.BrandonE97.com/</link>
		</image>
		<atom:link href="http://www.brandone97.com/rss/BE97rss.xml" rel="self" type="application/rss+xml" />
		<lastBuildDate><?php echo(date("D, d M Y")); ?> 00:00:00 EST</lastBuildDate>
		<?php
		$sql_check = 'ReG3n4rA73()k@';
		require_once('../admin97/sql.php');
		$sqlrss = mysql_query("SELECT `id`,`date`,`category`,`description`,`message`,`update`,`image` FROM blog ORDER BY id DESC LIMIT 10");
		while ($rss = mysql_fetch_array($sqlrss)) {
			echo('<item>'."\r\n");
			echo('<title>'.$rss['description'].'</title>'."\r\n");
			echo('<category>'.$rss['category'].'</category>'."\r\n");
			echo('<pubDate>'.$rss['date'].' 12:00:00 EST</pubDate>'."\r\n");
			echo('<link>http://www.brandone97.com/blog.php?id='.$rss[id].';</link>'."\r\n");
			echo('<guid>http://www.brandone97.com/blog.php?id='.$rss['id'].';</guid>'."\r\n");
			echo('<description>'."\r\n");
			$string = $rss['message'];
			$max = 25;
			$string = trim($string);
			//$string = str_replace('"','&quot;',$string);
			$word = explode(" ", $string);
			$total_words = count($word);
			if($total_words>$max) {
				for($i=0;$i<=$max;$i++) {
					if ($i == $max) {
						echo $word[$max]."...";
					}
					else {
						echo $word[$i]." ";
					}
				}
			}
			else {
				echo $string;
			}
			if ($rss['image'] != '') {
				echo('&lt;br /&gt;
				&lt;img src=&quot;http://www.brandone97.com/images/blogpics/'.$rss['image'].'&quot; /&gt;');
			}
			if ($rss['update'] != '') {
				echo("\r\n".'
				&lt;br /&gt;...article has an update on BrandonE97.com</description>'."\r\n");
			}
			else {
				echo('</description>');
			}
			echo('</item>'."\r\n");
		}
		?>
	</channel>
</rss>
