<?
$conn = mysql_connect('localhost', 'dish_feeel', 'feeel');
mysql_select_db('dish_propver2', $conn);
header('Content-type: text/xml');
?>


<rss version="2.0">

<channel>

<title>Prop Feed - PropCulture</title>
<description>Interpreting Pop Culture for All Humanity</description>
<link>http://www.propculture.com</link>

<image>
  <title>PropCulture.com</title>
  <url>http://www.propculture.com/images/FeedImg.gif</url>
  <link>http://www.propculture.com</link>
</image>

<?

  function limit_words ($text){
    $length = 40; // The number of words you want
    $explodewords = explode(' ', $text); // Creates an array of words
    $slicewords = array_slice($explodewords, 0, $length);
    $showtext = implode(' ', $slicewords);
	return $showtext;
  }  

  $sec='notions';

  $q="SELECT ".$sec."_title AS title, ".$sec."_content AS content, ".$sec."_id AS id, ".$sec."_date AS date 
  FROM $sec	
  ORDER BY date DESC 
  LIMIT 3";  
  
  $output=mysql_query($q);   

  while($row = mysql_fetch_array($output)){
    $titles=$row['title'];
	$contents=$row['content'];
	
	
?>

<item>
  <title><?=strip_tags($titles);?></title>
  <description><?=strip_tags(limit_words($contents));?>...</description>
  <link>http://www.propculture.com/view.php?id<![CDATA[=]]><?=$row['id'];?><![CDATA[&page=]]><?=$sec?></link>
  <guid isPermaLink="false">http://www.propculture.com/view.php?id<![CDATA[=]]><?=$row['id'];?><![CDATA[&page=]]><?=$sec?></guid>
</item>

<?
  }
?>
















<?
  $sec='flicks';

  $q="SELECT ".$sec."_title AS title, ".$sec."_content AS content, ".$sec."_id AS id, ".$sec."_date AS date 
  FROM $sec	
  ORDER BY date DESC 
  LIMIT 3";  
  
  $output=mysql_query($q);   

  while($row = mysql_fetch_array($output)){
    $titles=$row['title'];
	$contents=$row['content'];

?>

<item>
  <title><?=strip_tags($titles);?></title>
  <description><?=strip_tags(limit_words($contents));?>...</description>
  <link>http://www.propculture.com/view.php?id<![CDATA[=]]><?=$row['id'];?><![CDATA[&page=]]><?=$sec?></link>
  <guid isPermaLink="false">http://www.propculture.com/view.php?id<![CDATA[=]]><?=$row['id'];?><![CDATA[&page=]]><?=$sec?></guid>
</item>

<?
  }
?>














<?
  $sec='tunes';

  $q="SELECT ".$sec."_band AS title, ".$sec."_content AS content, ".$sec."_id AS id, ".$sec."_date AS date 
  FROM $sec	
  ORDER BY date DESC 
  LIMIT 3";  
  
  $output=mysql_query($q);   

  while($row = mysql_fetch_array($output)){
    $titles=$row['title'];
	$contents=$row['content'];

?>

<item>
  <title><?=strip_tags($titles);?></title>
  <description><?=strip_tags(limit_words($contents));?>...</description>
  <link>http://www.propculture.com/view.php?id<![CDATA[=]]><?=$row['id'];?><![CDATA[&page=]]><?=$sec?></link>
  <guid isPermaLink="false">http://www.propculture.com/view.php?id<![CDATA[=]]><?=$row['id'];?><![CDATA[&page=]]><?=$sec?></guid>
</item>

<?
  }
?>





</channel>
</rss>