include "../rcontrol/config.php";
include "../rcommon/database.php";
$remove = array("\x92", "\x96","\x97");
$query="select * from blog_header where visible='0' and parent='0' order by postid desc limit 10";
$result=mysql_db_query($DATABASE,$query);
$num = mysql_num_rows($result);
if ($num != 0)
{
$file= fopen("blogs.xml", "wb");
$_xml .="\r\n";
$_xml .="\r\n";
$_xml .="\r\n";
$_xml .="Textile Blogs by YarnsandFibers\r\n";
$_xml .="http://www.yarnsandfibers.com\r\n";
$_xml .="YarnsandFibers Textile Blogs\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 .="YarnsandFibers Textile Blogs\r\n";
$_xml .="http://www.yarnsandfibers.com/preferredsupplier/images/nhp/ynfx_logo.png\r\n";
$_xml .="http://www.yarnsandfibers.com\r\n";
$_xml .="\r\n";
for($i=0; $i<$num; $i++)
{
$postid = mysql_result($result,$i,"postid");
$title = htmlentities(mysql_result($result,$i,"title"));
$posted =mysql_result($result,$i,"posted");
$category = mysql_result($result,$i,"category");
$blogfolder = mysql_result($result,$i,"blogfolder");
$message = htmlentities(strip_tags(substr(mysql_result($result,$i,"message"),0,200)));
$_xml .="- \r\n";
$_xml .="".str_replace($remove,"",$title)."\r\n";
$_xml .="http://yarnsandfibers.com/ynfxblogs/fullstorynonlogger.php?id=$postid\r\n";
$_xml .="".$category."\r\n";
$_xml .="".date("r",$posted)."\r\n";
$_xml .="".str_replace($remove,"",$message)."\r\n";
$_xml .="
\r\n";
}
$_xml .="\r\n";
$_xml .="\r\n";
fwrite($file, $_xml);
fclose($file);
}
header("location:blogs.xml");
?>