<?php  header ("Content-Type: application/xml");?>
<rss version="2.0">

<channel>

<title>Property for Sale France - New Properties on the Market!</title>
<description>French property and real estate for sale by owner and available to buy now. Property for Sale France advertise some of the finest and best cared for traditional french properties available. For your new house in France or related information on insurance, mortgage,lenders, finance, loans and news, visit PFS France.</description>
<link>http://www.propertyforsalefrance.co.uk/</link>
<copyright>Copyright PFS France and eantics Ltd. May be reproduced 'as is' for private and commercial use.</copyright>

<?php

// New properties
include("../dbconnection.php");
$sql="select * from properties where propertyShowing='Y' and propertyActive='Y' order by propertyListingDate DESC limit 30;";
$query=mysql_query($sql);

?>

<?

while($item=mysql_fetch_array($query))
 {
  $id=$item['propertyID'];
  $title=ucwords(strtolower($item['propertyTitle']." in ".$item['propertyRegion']).". Price:".$item['propertyPrice']." Euros.");
  $title = str_replace("'","",$title);
  $title=htmlentities($title,ENT_QUOTES);
  $title = str_replace("&eacute;","e",$title);
  $title = str_replace("&ccedil;","c",$title);
  $title = str_replace("&sup2;","2",$title);
  $title = str_replace("&ocirc;","o",$title);
  $title = str_replace("&pound;","%A3",$title);
  $title = str_replace("€","EURO",$title);
  $title = str_replace("-"," ",$title);
  
  $body=$item['propertyDescription'];
  $body=substr($body,0,200);
  $body = str_replace("'","",$body);
  $body=htmlentities($body,ENT_QUOTES);
  
  //replace non xml compatible chars
  $body = str_replace("&eacute;","e",$body);
  $body = str_replace("&ccedil;","c",$body);
  $body = str_replace("&sup2;","2",$body);
  $body= str_replace("&ocirc;","o",$body);
  $body=str_replace("&plusmn;","plus or minus",$body);
  $body= str_replace("&pound;","%A3",$body);
  $body= str_replace("€","EURO",$body);
  $body= str_replace("-"," ",$body);
   
// output to client
	
?>

  <item>
  <title><?php echo htmlentities($title,ENT_QUOTES);?></title>
  <description><?php echo $body."...";?></description>
  <link>http://www.propertyforsalefrance.co.uk/index.php?action=view&amp;propertyid=<?php echo $id;?></link> 
  </item>

<?php  
 } 
?>

</channel>
</rss>