<?
include_once("inc/meconn.php");
$n=$_GET["n"];
$m=$_GET["m"];
$a=$_GET["a"];
$b=$_GET["b"];
$c=$_GET["c"];
$d=$_GET["d"];
$e=$_GET["e"];
ft_na($n,$m,$a,$b,$c,$d,$e);
Function ft_na($n,$m,$a,$b,$c,$d,$e){
if ($d==1){
$sql="SELECT * from ft_bbs_cate,ft_bbstitle where ft_bbs_cate.BBS_Cate_ID = ft_bbstitle.BoardID_2 and ft_bbstitle.deleted=0 and ft_bbstitle.BoardID_1=A_".$m." and ft_bbstitle.huati=1 order by redate desc limit 0,".$n."";
}
elseif ($d==2){
$sql="SELECT * from {$tablepre}bbs_cate,bbstitle where bbs_cate.BBS_Cate_ID = bbstitle.BoardID_2 and bbstitle.deleted=0 and bbstitle.BoardID_1=A_".$m." and bbstitle.sign=1 order by redate desc limit 0,".$n."";
}
else{
$sql="SELECT * from {$tablepre}bbs_cate,bbstitle where bbs_cate.BBS_Cate_ID = bbstitle.BoardID_2 and bbstitle.deleted=0 and bbstitle.BoardID_1=A_".$m." and bbs_cate.BBS_Cate_Qs=0 order by redate desc limit 0,".$n."";
}
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
if ($numrows!=0){
$nl="";
do {
$id=$myrow[0];
$title=substr($myrow["title"],0,$e);
$boardid_1=$myrow["BoardID_1"];
$boardid_2=$myrow["BoardID_2"];
$BBS_Cate_Name=$myrow["BBS_Cate_Name"];
$tk1="default.php?a=".$boardid_1."&b=".$boardid_2."";
if ($a==1){
$astring="[<a href=".$tk1.">".$myrow["BBS_Cate_Name"]."</a>]";
}
if ($b==1){
$bstring=dateFormat($myrow["redate"],'y-m-d');
}
if ($c==1){
$cstring="<a href=ftbbsmyinfo.php?ftbbsuser=".$myrow["user_id"].">".$myrow["user_id"]."</a>";
}
$nl=$nl.$astring."<a href=ftbbs.php?id=".$id." target=\"_blank\">".$title."</a> ".$cstring. " ".$bstring."<br>";
}
while ($myrow = mysql_fetch_array($rs));
}
else{
$nl="记录为空";
}
echo "document.write('".$nl."');";
}
?>