最高在线人数:".highpeople(); $sql = "select fdIsClose,fdIsPublic from $bbscolumn where id='$fdColumnId'"; $columninfo = $DB_web->query_first($sql); $return=$columninfo[fdIsClose]; $return=($fdIsClose)?$return:"0"; $permituse=$columninfo[fdIsPublic]; if(!$permituse) { $permituse=fdPermitUse((passcheck("fdLogin")),$fdColumnId); } if($flag) { $sortarticle=$sortarticle1; $sortdesc=$sortdesc1; $sorttype=($sortdesc=='asc')?"":""; } else { $sorttype=($sortdesc=='asc')?"":""; } $hrefstring="showcolumn.php?totalpages=$totalpages&intGotoPage=$intShowPage&fdColumnId=$fdColumnId&flag=1&isCool=$isCool&sortdesc1=".(($sortdesc=="asc")?"desc":"asc"); if($return)//版面开放 { list($sortstr,$pagenumber)=explode("&&",getsortype($loginstr)); if($permituse)//判断是不是私有栏目 { require "./config/class.fasttemplate.php"; $tpl = new FastTemplate("./templates".$bbsStyleOrder); //弹出广告 if($fdColumnId) { $bulltinmessage=''; $ToDay = date("Y-m-d"); $sql="SELECT id,fdTitile FROM $bbsbulletin where fdColumnId=$fdColumnId and fdEndDate>='$ToDay' order by id desc" ; $result=$DB_web->query($sql); if($DB_web->num_rows($result)>0) { $bulltinmessage=""; while($row=$DB_web->fetch_array($result)) { $bulltinmessage.="$row[fdTitile]   "; } $bulltinmessage.=""; } }#if($fdColumnId) //定义使用到的模板 $tpl->define( array( columnMain => "main.tpl", //显示栏目信息主模板 threadCircleInfo => "column_row.tpl", //循环主题 bottom => "bottom.tpl", erroInfo => "erro.tpl" //错误提示 ) ); //定义一个用来循环的模板 $sql = "select * from $bbscolumn where id='$fdColumnId'"; $columninfo = $DB_web->query_first($sql); if($columninfo[id]>0)//栏目存在 { //找出要该栏目下每页显示的文章条数 $sql="select fdMemberId from $bbsbaner where fdGroupId=2 and fdColumnId=$fdColumnId"; $columninfomember = $DB_web->query_first($sql); $sql="select fdName,fdDispTitleNum,fdBgSound,fdContent,fdHotHits,fdHotReply from $bbscolumn where id=$fdColumnId"; $columninfo1 = $DB_web->query_first($sql); $bannerName=$columninfo1[fdName]; $fdDispTitleNum=$columninfo1[fdDispTitleNum]; $fdBgSound=$columninfo1[fdBgSound]; $fdContent=$columninfo1[fdContent]; if(!$columninfomember[fdMemberId]) { $justbanner="暂无正斑竹"; } else { //$sql="select id,fdLogin,fdName from $member where id=$columninfomember[fdMemberId]"; //$columninfo1 = $DB_web->query_first($sql); //$justbanner="".$columninfo1[fdLogin].""; //找到了正斑竹 //$sql = "SELECT id,fdLogin FROM $member WHERE id=".intval($columninfomember[fdMemberId]); $sql="select a.id,a.fdLogin,a.fdName from $member a,$bbsbaner b where a.id=b.fdMemberId and b.fdGroupId=2 and b.fdColumnId=$fdColumnId"; $resultColInfo1 = $DB_web->query($sql); $justbanner = ""; while ( $columninfo1 = $DB_web->fetch_array($resultColInfo1) ) // 找到了正斑竹 { $justbanner .= "".$columninfo1[fdLogin]." "; } } //找副斑竹 $sql="select a.id,a.fdLogin,a.fdName from $member a,$bbsbaner b where a.id=b.fdMemberId and b.fdGroupId=3 and b.fdColumnId=$fdColumnId"; $Result=$DB_web->query($sql); if($DB_web->num_rows($Result)) { $assistantbanner=""; // xdju 注意不要老是把空格加在代码里面,修改不方便。 while($Row=$DB_web->fetch_array($Result)) { $assistantbanner.="".$Row[fdLogin]." "; } } if ($pagenumber) $intLineNum=$pagenumber; else $intLineNum=$fdDispTitleNum; if($intGotoPage <= 0) $intGotoPage=1; $start = ($intGotoPage-1)*$intLineNum; //起始记录数 //某个栏目下的文章总数 if($isCool) { $sql="SELECT count(id) as id from $bbsarticle where fdColumnId='$fdColumnId' and fdVisible=0 and fdCool=1 and fdForbidCheck=0"; } else { $sql="SELECT count(id) as id from $bbsarticle where fdColumnId='$fdColumnId' and fdVisible=0 and fdForbidCheck=0"; } $totals = $DB_web->query_first($sql); $totalnum = $totals[id]; if(!$intLineNum) $intLineNum=1; $totalpages = intval($totalnum/$intLineNum); if( ($totalnum%$intLineNum)<>0 ) $totalpages = $totalpages+1; if($totalpages<=0) $totalpages=1; $select_field = "id,fdColumnId,fdIsClose,fdTitle,fdMemberId,fdByte,fdCreateDate,fdIsTop,fdCool,fdWebCool,fdWebOrderId,fdImage,fdFlash,fdAttack,fdGraph,fdReply,fdHits,fdVisible,fdPoint,fdHitPoint,fdEditDate,fdEditLogin,fdReplyDate,fdLogin,fdReplyAuthor,fdSign,fdSupportHtml,fdSupportImgCode,fdSupportFaceCode,fdSupportVbCode"; if($isCool) { $mainsql = "SELECT $select_field from $bbsarticle where fdColumnId='$fdColumnId' and fdVisible=0 and fdCool=1 and fdForbidCheck=0 order by fdIsTop desc,$sortstr $sortarticle $sortdesc limit $start,$intLineNum"; } else { $mainsql = "SELECT $select_field from $bbsarticle where fdColumnId='$fdColumnId' and fdVisible=0 and fdForbidCheck=0 order by fdIsTop desc,$sortstr $sortarticle $sortdesc limit $start,$intLineNum"; } //print $mainsql; $result = $DB_web->query( $mainsql ); $rowsNum = $DB_web->num_rows( $result ); $i = $rowsNum; $tpl->define_dynamic ( "row", "threadCircleInfo" ); while($i>0) { $i--; $threadinfo = $DB_web->fetch_array( $result ); $attribute1=$threadinfo[fdAttack]?"附件":""; $attribute2=$threadinfo[fdFlash]?"FLASH、":""; $attribute3=$threadinfo[fdImage]?"附图、":""; $attribute=$attribute3.$attribute2.$attribute1; if (substr($attribute,-2,2)=="、"){ $attribute=str_replace("、","",$attribute); } $attribute=($attribute)?" [$attribute]":""; $infoimage1=(substr($threadinfo[fdReplyDate],0,10)==date('Y-m-d'))?"新回的帖子":""; $infoimage2=(substr($threadinfo[fdCreateDate],0,10)==date('Y-m-d'))?"新发的帖子":""; $infoimage=$infoimage1; $infoimage=(strlen($infoimage2)>5)?$infoimage2:$infoimage; //定义循环模板中的变量 $cool=($threadinfo[fdCool])?"酷帖 ":""; $fdReplyAuthor=($threadinfo[fdReplyAuthor])?($threadinfo[fdReplyAuthor]):($threadinfo[fdLogin]); $tpl->assign( array( startinfo => "", endinfo => "", infoimage => $infoimage, topimage => ($threadinfo[fdIsTop]) ? "置顶" : "", faceimage => $threadinfo[fdGraph], title_href => "showthread.php?fdColumnId=$fdColumnId&threadid=$threadinfo[id]&sortype=$sortdesc1&sortfield=$sortarticle1", articletitle=> $cool.mark($threadinfo[fdTitle]).$attribute, bity => $threadinfo[fdByte], author => "
".$threadinfo[fdLogin]."
".substr($threadinfo[fdCreateDate],5,11)."
", reply => ($threadinfo[fdReply] >= $columninfo[fdHotReply]) ? "".$threadinfo[fdReply]."" : $threadinfo[fdReply], hits => ($threadinfo[fdHits] >= $columninfo[fdHotHits])? "".$threadinfo[fdHits]."" : $threadinfo[fdHits], score =>"".$threadinfo[fdPoint]."/".$threadinfo[fdHitPoint]."", lastpostdate => "
".$fdReplyAuthor."
".substr($threadinfo[fdReplyDate], 5 ,11)."
" ) );//end: $tpl->assign( $tpl->parse(ROWS,".row"); //解析循环的单元 }//end: while($i>0){ if($totalnum>$intLineNum)//显示分页 { $morepages = intShowPages($totalnum,$intGotoPage,$totalpages); } if(!$rowsNum) { $tpl->assign( array( startinfo => "", column_title => $fdWebSiteName."--".$columninfo[fdName], guide => guide($fdColumnId), totalthreads => $totalnum, bannertitle => $columninfo[fdContent], guideindex => $index, guidetarget => $target, thiscolumnname => $columninfo[fdName], bulltin => $bulltinmessage, banner => ($justbanner) ? $justbanner : "暂无斑竹", assistant => ($assistantbanner) ? $assistantbanner : "暂无副斑竹", bannerwords => $columninfo[fdWords], newthread => "newthread.php?fdColumnId=$fdColumnId", JSCODE => $javascriptcode, totalpeople => totalpeople(), totalpost => totalpost(), highpeople => ($fd_highonlinepeople)?$highpeople_str:" ", bgmusic => (strlen($fdBgSound)>10)?"":"", loginform => $logininfo, morepages => $morepages, sortpublish => $hrefstring."&sortarticle1=fdCreateDate", sortreply => $hrefstring."&sortarticle1=fdReply", sorthit => $hrefstring."&sortarticle1=fdHits", sortreplydate => $hrefstring."&sortarticle1=fdReplyDate", publishsort => ($sortarticle1=='fdCreateDate')?($sorttype):"", replysort => ($sortarticle1=='fdReply')?($sorttype):"", hitsort => ($sortarticle1=='fdHits')?($sorttype):"", replydatesort => ($sortarticle1=='fdReplyDate')?($sorttype):"", isCool => ($isCool)?"?fdColumnId=$fdColumnId":"?fdColumnId=$fdColumnId&isCool=1", isCoolname => ($isCool)?"":"", /* isCool1 => "?fdColumnId=$fdColumnId", isCoolname1 => "", isCool => "?fdColumnId=$fdColumnId&isCool=1", isCoolname => "", */ ) ); } //定义分页模板的单元变量 else $tpl->assign( array( column_title => $fdWebSiteName."--".$columninfo[fdName], totalthreads => $totalnum, bannertitle => $columninfo[fdContent], bulltin => $bulltinmessage, guide => guide($fdColumnId), guideindex => $index, guidetarget => $target, thiscolumnname => $columninfo[fdName], banner => ($justbanner) ? $justbanner : "暂无斑竹", assistant => ($assistantbanner) ? $assistantbanner : "暂无副斑竹", bannerwords => $columninfo[fdWords], newthread => "newthread.php?fdColumnId=$fdColumnId", JSCODE => $javascriptcode, totalpeople => totalpeople(), totalpost => totalpost(), highpeople => ($fd_highonlinepeople)?$highpeople_str:" ", title => $fdWebSiteName, bgmusic => (strlen($fdBgSound)>10)?"":"", loginform => $logininfo, morepages => $morepages, sortpublish => $hrefstring."&sortarticle1=fdCreateDate", sortreply => $hrefstring."&sortarticle1=fdReply", sorthit => $hrefstring."&sortarticle1=fdHits", sortreplydate => $hrefstring."&sortarticle1=fdReplyDate", publishsort => ($sortarticle1=='fdCreateDate')?($sorttype):"", replysort => ($sortarticle1=='fdReply')?($sorttype):"", hitsort => ($sortarticle1=='fdHits')?($sorttype):"", replydatesort => ($sortarticle1=='fdReplyDate')?($sorttype):"", isCool => ($isCool)?"?fdColumnId=$fdColumnId":"?fdColumnId=$fdColumnId&isCool=1", isCoolname => ($isCool)?"":"", /* isCool1 => "?fdColumnId=$fdColumnId", isCoolname1 => "", isCool => "?fdColumnId=$fdColumnId&isCool=1", isCoolname => "", */ ) ); $tpl->parse(main, ".threadCircleInfo"); //解析循环的模板 $tpl->parse(bottominfo, "bottom"); //解析底部模板模板 $tpl->parse(main, "columnMain"); //解析主模板模板 }//end if($columninfo[id]>0)//栏目存在 else { //定义分页模板的单元变量 $tpl->assign( array( erroinfo => "您输入的栏目号无效,没有该栏目存在", totalpeople => totalpeople(), totalpost => totalpost(), highpeople => ($fd_highonlinepeople)?$highpeople_str:" ", title => $title[7], sitename => $fdWebSiteName, bgmusic => (strlen($fdBgSound)>10)?"":"", loginform => $logininfo, JSCODE => $javascriptcode, sortpublish => $hrefstring."&sortarticle1=fdCreateDate", sortreply => $hrefstring."&sortarticle1=fdReply", sorthit => $hrefstring."&sortarticle1=fdHits", sortreplydate => $hrefstring."&sortarticle1=fdReplyDate", publishsort => ($sortarticle1=='fdCreateDate')?($sorttype):"", replysort => ($sortarticle1=='fdReply')?($sorttype):"", hitsort => ($sortarticle1=='fdHits')?($sorttype):"", replydatesort => ($sortarticle1=='fdReplyDate')?($sorttype):"", isCool => ($isCool)?"?fdColumnId=$fdColumnId":"?fdColumnId=$fdColumnId&isCool=1", isCoolname => ($isCool)?"":"", /* isCool1 => "?fdColumnId=$fdColumnId", isCoolname1 => "", isCool => "?fdColumnId=$fdColumnId&isCool=1", isCoolname => "", */ ) ); $tpl->parse(main, "erroInfo"); //解析非循环的模板 $tpl->parse(bottominfo, "bottom"); //解析底部模板模板 $tpl->parse(main, "columnMain"); //解析主模板模板 } $tpl->FastPrint(); //显示结果 }#if($permituse)//判断是不是私有栏目 else//私有栏目 { require "./config/class.fasttemplate.php"; $tpl = new FastTemplate("./templates".$bbsStyleOrder); //定义使用到的模板 $tpl->define( array( columnMain => "main.tpl", //显示栏目信息主模板 threadCircleInfo => "column_row.tpl", //循环主题 bottom => "bottom.tpl", erroInfo => "erro.tpl" //错误提示 ) ); //定义分页模板的单元变量 $tpl->assign( array( erroinfo => $permissionword, totalpeople => totalpeople(), totalpost => totalpost(), highpeople => ($fd_highonlinepeople)?$highpeople_str:" ", title => $title[7], sitename => $fdWebSiteName, bgmusic => (strlen($fdBgSound)>10)?"":"", loginform => $logininfo, JSCODE => $javascriptcode, sortpublish => $hrefstring."&sortarticle1=fdCreateDate", sortreply => $hrefstring."&sortarticle1=fdReply", sorthit => $hrefstring."&sortarticle1=fdHits", sortreplydate => $hrefstring."&sortarticle1=fdReplyDate", publishsort => ($sortarticle1=='fdCreateDate')?($sorttype):"", replysort => ($sortarticle1=='fdReply')?($sorttype):"", hitsort => ($sortarticle1=='fdHits')?($sorttype):"", replydatesort => ($sortarticle1=='fdReplyDate')?($sorttype):"", isCool => ($isCool)?"?fdColumnId=$fdColumnId":"?fdColumnId=$fdColumnId&isCool=1", isCoolname => ($isCool)?"":"", /* isCool1 => "?fdColumnId=$fdColumnId", isCoolname1 => "", isCool => "?fdColumnId=$fdColumnId&isCool=1", isCoolname => "", */ ) ); $tpl->parse(main, ".erroInfo"); //解析非循环的模板 $tpl->parse(bottominfo, "bottom"); //解析底部模板模板 $tpl->parse(main, "columnMain"); $tpl->FastPrint(); } }#if($return)//版面开放 else//版面关闭 { require "./config/class.fasttemplate.php"; $tpl = new FastTemplate("./templates".$bbsStyleOrder); //定义使用到的模板 $tpl->define( array( columnMain => "main.tpl", //显示栏目信息主模板 threadCircleInfo => "column_row.tpl", //循环主题 bottom => "bottom.tpl", erroInfo => "erro.tpl" //错误提示 ) ); //定义分页模板的单元变量 $tpl->assign( array( erroinfo => $closeword, totalpeople => totalpeople(), totalpost => totalpost(), highpeople => ($fd_highonlinepeople)?$highpeople_str:" ", title => $title[7], sitename => $fdWebSiteName, bgmusic => (strlen($fdBgSound)>10)?"":"", loginform => $logininfo, JSCODE => $javascriptcode, sortpublish => $hrefstring."&sortarticle1=fdCreateDate", sortreply => $hrefstring."&sortarticle1=fdReply", sorthit => $hrefstring."&sortarticle1=fdHits", sortreplydate => $hrefstring."&sortarticle1=fdReplyDate", publishsort => ($sortarticle1=='fdCreateDate')?($sorttype):"", replysort => ($sortarticle1=='fdReply')?($sorttype):"", hitsort => ($sortarticle1=='fdHits')?($sorttype):"", replydatesort => ($sortarticle1=='fdReplyDate')?($sorttype):"", isCool => ($isCool)?"?fdColumnId=$fdColumnId":"?fdColumnId=$fdColumnId&isCool=1", isCoolname => ($isCool)?"":"", /* isCool1 => "?fdColumnId=$fdColumnId", isCoolname1 => "", isCool => "?fdColumnId=$fdColumnId&isCool=1", isCoolname => "", */ ) ); $tpl->parse(main, ".erroInfo"); //解析非循环的模板 $tpl->parse(bottominfo, "bottom"); //解析底部模板模板 $tpl->parse(main, "columnMain"); $tpl->FastPrint(); } //分页函数 function intShowPages($intLineNum,$intGotoPage,$totalpages){ global $fdColumnId,$flag,$sortdesc,$sortarticle1,$isCool; $intWhileNum=10; $intSelfLine=$intGotoPage; #本页 $intStartPage=(($intSelfLine-1)-(($intSelfLine-1)%$intWhileNum)); $intEndPage=$intStartPage+$intWhileNum-1; if($totalpages<$intEndPage){ $intEndPage=$totalpages-1; $intWhileNum=$intEndPage-$intStartPage+1; } $sortdesc1=($sortdesc=="asc")?"desc":"asc"; $return=""; $next_page=$intSelfLine+1; #下一页的页数 $return.="
  "; for($i=1;$i<$intWhileNum+1;$i++){ $intOffsetNum=($intStartPage+($i-1))*$intLineNum; $intShowPage=($intStartPage+$i); if($intSelfLine==$intStartPage+$i){ #当前页不做联接 $return.=" ".$intShowPage." "; }else{ if($intShowPage<=$totalpages){ $return.=" ".$intShowPage.""; } } } $return.="   
当前 $intSelfLine/$totalpages 页 跳转到 第"; $return.=""; $return.="
"; return $return; } ?>