\r\n"; $_xml .="\r\n"; $_xml .="\r\n"; $_xml .="YarnsandFibers Polyester News\r\n"; $_xml .="http://www.yarnsandfibers.com\r\n"; $_xml .="YarnsandFibers Polyester News\r\n"; $_xml .="en\r\n"; $_xml .="[email protected]\r\n"; $_xml .="YarnsandFibers\r\n"; $_xml .="".date("r")."\r\n"; $_xml .="".date("r")."\r\n"; while($row=mysql_fetch_array($result)) { //fakhruddin: for adding paid news to all xml file $status_ = "status ='a' or status='r'"; // r for paid news a for free //end $product_id=$row['id']; $product_name=$row['name']; $query1="Select * from ynfx_mis_news WHERE visibility='1' AND ($status_) order by id desc limit 250"; $result1=mysql_db_query($DATABASE,$query1); $count = mysql_num_rows($result1); for($i=0; $i<$count; $i++) { $id = mysql_result($result1,$i,"id"); $product = mysql_result($result1,$i,"product"); if($product != "N;") { $PROD_news = unserialize($product); foreach($PROD_news as $value) { if($product_id == $value) { $title = mysql_result($result1,$i,"header"); $description =substr(mysql_result($result1,$i,"body"),0,200); $tag = array("
","

"); $description = strip_tags($description,$tag); $date_news = mysql_result($result1,$i,"date_display_from"); $_xml .="\r\n"; $_xml .="".str_replace($remove,"",$title)."\r\n"; $_xml .="http://www.yarnsandfibers.com/news/index_fullstory.php?id=$id\r\n"; $_xml .="".$product_name."\r\n"; $_xml .="".date("r",$date_news)."\r\n"; $remove = array("\x92", "\x96","\x97","\x80","\x9c","\x80,","\x99","�","&"); $_xml .="".str_replace($remove,"",$description)."...\r\n"; $_xml .="\r\n"; } } } } } $_xml .="\r\n"; $_xml .="\r\n"; fwrite($file, $_xml); fclose($file); } header("location:polyester.xml"); echo "XML has been written. View the XML."; ?>