<?php
include_once("inc/config.php");
header("Content-type: application/xml");
print '<?xml version="1.0" encoding="gb2312"?>';
print '<?xml-stylesheet type="text/xsl" href="blogrss.xsl" version="1.0" encoding="gb2312"?>';
print '<rss version="2.0">';

include_once("inc/publicfun.php");
include_once("inc/ftbbsdbclass.php");
include_once("conn.php");
$layer_1 = $_GET["layer_1"];
$layer_2 = $_GET["layer_2"];

$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=makecache('ftbbsmb.html',$query,86400);

$url=$ftbbsmb[10];
if (substr($url,-1)!="/"){
   $url=$url."/";
}
$userid=intval($_GET["userid"]);
?>
<channel>
<link><?=$ftbbsmb[10]?></link>
<description><?=$ftbbsmb[11]?></description>
<?
$sql = "Select * from {$tablepre}ftblog,{$tablepre}clubuser where {$tablepre}clubuser.clubuser_id={$tablepre}ftblog.userid and {$tablepre}ftblog.userid=".$userid." order by {$tablepre}ftblog.writedate desc limit 0,10";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows=$myrow[0];
if ($numrows==0){
  echo "<item></item>";
}
else{
    do {
    echo "<item>" ;
	echo "<title><![CDATA[".$myrow["blogtitle"]."]]></title>";
	echo "<link>".$url."home.asp?userid=".$myrow["id"]."</link>";
	echo "<author>".$myrow["clubuser_id"]."</author>" ;
	echo "<pubDate>".$myrow["writedate"]."</pubDate>" ;
 	echo "<description><![CDATA[".$myrow["blogcontent"]."]]></description>";
	echo "</item>";
    } 
    while ($myrow = mysql_fetch_array($rs));                
    $db->close(); 
}
?>
</channel>
</rss>