\r\n"; $_xml .="\r\n"; $_xml .="\r\n"; $_xml .="YarnsandFibers\r\n"; $_xml .="http://www.yarnsandfibers.com\r\n"; $_xml .="News on textile market, textile products like cotton, fiber, spun etc, news about textile market updates\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"; $_xml .="\r\n"; $_xml .="Textile News\r\n"; $_xml .="http://www.yarnsandfibers.com/preferredsupplier/images/nhp/ynfx_logo.png\r\n"; $_xml .="http://www.yarnsandfibers.com/news/index.php\r\n"; $_xml .="\r\n"; while($findMainNews = mysql_fetch_assoc($result)) { $nid=$findMainNews['nid']; ; $created=$findMainNews['created']; ; $selectposting = "Select title, body from node_revisions where nid = '$nid' "; //echo "selectposting - ".$selectposting; $selectpostingexe = mysql_query($selectposting) or die(mysql_error().__LINE__); $selectpostingrow = mysql_num_rows($selectpostingexe); $row = mysql_fetch_assoc($selectpostingexe); $title=$row['title']; $body=strip_tags($row['body']); //$tag = array("
","

"); //$body = strip_tags($body,$tag); //$body = html_entity_decode($body, ENT_COMPAT); $body = htmlentities($body); $body =substr($body,0,200); $body=str_replace("&","&",$body); $title=str_replace("&","&",$title); $src = "node/$nid"; $findlink = "Select dst from url_alias where src = '$src' and dst NOT like '%WWW%' and dst NOT like '%http%'"; //echo "findlink".$findlink; $findlinkresults = mysql_query($findlink) or die(mysql_error().__LINE__); $findlinkresultsrow = mysql_num_rows($findlinkresults); $findlinkrow = mysql_fetch_assoc($findlinkresults); $dst= $findlinkrow['dst']; //echo $dst; //die; $_xml .="\r\n"; $_xml .="".str_replace($remove,"",$title)."\r\n"; $_xml .="http://www.yarnsandfibers.com/news/$dst\r\n"; $_xml .="".$product."\r\n"; $_xml .="".date("r",$created)."\r\n"; $remove = array("\x92", "\x96","\x97"); $_xml .="".str_replace($remove,"",$body)."...\r\n"; $_xml .="\r\n"; } $_xml .="\r\n"; $_xml .="\r\n"; fwrite($file, $_xml); fclose($file); } header("location:news.xml"); ?>