define( array( columnMain => "main.tpl", bbstype => "bbstype.tpl", //循环主题 bbstyperow => "bbstyperow.tpl", bottom => "bottom.tpl" ) ); $colinfo=fdPermitColumn($loginlast); $sql="select id,fdName,fdIsColumn,fdParent from $bbscolumn where id=$parentid order by id"; $sql="select id,fdName,fdIsColumn,fdParent from $bbscolumn where id=$parentid and (( fdIsClose=1 and fdIsPublic=1 ) or ( id in (".$colinfo."))) order by fdOrderId desc,id asc"; $result=$DB_web->query($sql); $tpl->define_dynamic ( "showLine", "bbstype" ); while($rows=$DB_web->fetch_array($result)){ //大类别 $href1=''; if ($rows[fdIsColumn]){ $href1=(($bbsColumnFlage)?"bbscolumn.php":"showcolumn.php")."?fdColumnId=$rows[id]&parentid=$rows[id]"; } else{ $href1="bbstypes.php?parentid=$rows[id]"; } $tpl->assign( array( bbstype => $rows[fdName], href => $href1, loginform => $logininfo, bgmusic => "", JSCODE => $javascriptcode ) ); $sSql="select id,fdName,fdPost,fdReply from $bbscolumn where fdParent=$rows[id] and fdIsPublic=1 order by fdPost DESC"; $sSql="select id,fdName,fdIsColumn,fdParent,fdPost,fdReply from $bbscolumn where fdParent=$rows[id] and (( fdIsClose=1 and fdIsPublic=1 ) or ( id in (".$colinfo."))) order by fdOrderId desc,id asc"; $rResult=$DB_web->query($sSql); if ($DB_web->num_rows($rResult)>0){ $tpl->define_dynamic ( "rowtype", "bbstyperow" ); while($rRows=$DB_web->fetch_array($rResult)){ $sSQL="select fdCreateDate from $bbsarticle where fdColumnId=$rRows[id] order by fdCreateDate DESC LIMIT 1"; $rROWS=$DB_web->query_first($sSQL); $fdCreateDate=($rROWS[fdCreateDate])?$rROWS[fdCreateDate]:" "; $sSQL="select $member.fdLogin from $bbsbaner,$member where $bbsbaner.fdColumnId=$rRows[id] and $bbsbaner.fdGroupId=2 and $bbsbaner.fdMemberId=$member.id order by $member.id"; $rRESULT=$DB_web->query($sSQL); $bannerName=''; if ($DB_web->num_rows($rRESULT)>0){ while($rROWS=$DB_web->fetch_array($rRESULT)) $bannerName.=$rROWS[fdLogin]." "; } else{ $bannerName.=" "; } //小类别 $tpl->assign( array( name => "$rRows[fdName]", postreply => ($rRows[fdPost]+$rRows[fdReply]), post => $rRows[fdPost], createdate => $fdCreateDate, bannername => $bannerName ) ); $tpl->parse(rowType,".rowtype"); } $tpl->parse(row_type,"rowType"); }//end if ($DB_web->num_rows($rResult)>0){ else{ $tpl->assign( array( row_type => "" ) ); } $tpl->parse(show_Line, ".showLine"); } $tpl->parse(main,"bbstype"); $tpl->parse(bottominfo,"bottom"); $tpl->parse(main,"columnMain"); $tpl->FastPrint(); } list_type(); ?>