www.gusucode.com > 中网景企业网站管理系统 2008源码程序 > common/bbsjs.asp
<!--#include file="../opendb.asp" --> javastr="" <% dim bbspath bbspath="../bbs/" dim p,b,m,n p=Trim(Request.QueryString("p")) b=Trim(Request.QueryString("b")) m=Trim(Request.QueryString("m")) n=Trim(Request.QueryString("n")) if b<>"" then i=clng(b) if m<>"" then m=clng(m) if n<>"" then n=clng(n) select case p case "board" %> javastr=javastr+'<%= show_allboard(b,m,n) %>'; document.write (javastr) <% case "suboard" %> javastr=javastr+'<%= show_allsuboard(b,m,n) %>'; document.write (javastr) <% case "jinghua" %> javastr=javastr+'<%= show_goodbbs(m,n) %>'; document.write (javastr) <% case "ding" %> javastr=javastr+'<%= show_newtop(m,n) %>'; document.write (javastr) <% case "newindex" %> javastr=javastr+'<%= show_newindex(m,n) %>'; document.write (javastr) <% case "newrep" %> javastr=javastr+'<%= show_newrep(m,n) %>'; document.write (javastr) <% case "tophit" %> javastr=javastr+'<%= show_tophit(m,n) %>'; document.write (javastr) <% case "toprep" %> javastr=javastr+'<%= show_toprep(m,n) %>'; document.write (javastr) <% end select Call closedb() %> <% Function show_allboard(b,m,n) Dim rs n = Int(n) m = Int(m) show_allboard="" Set rs = conn.execute("select top "&m&" indexid,bid,subid,title from yfindex where stopflag=0 and recycle=0 and bid="&b&" order by retime DESC") While Not rs.EOF show_allboard=show_allboard&"· <a href="""&bbspath&"index.asp?indexid="&rs(0)&"&bid="&rs(1)&"&subid="&rs(2)&""" target=""_blank"" title="""&ClearHTMLCode(rs(3))&""">"&left(ClearHTMLCode(rs(3)),n)&"</a><br />" rs.MoveNext Wend Set rs = Nothing End Function Function show_allsuboard(b,m,n) Dim rs n = Int(n) m = Int(m) show_allsuboard="" Set rs = conn.execute("select top "&m&" indexid,bid,subid,title from yfindex where stopflag=0 and recycle=0 and subid="&b&" order by retime DESC") While Not rs.EOF show_allsuboard=show_allsuboard&"· <a href="""&bbspath&"index.asp?indexid="&rs(0)&"&bid="&rs(1)&"&subid="&rs(2)&""" target=""_blank"" title="""&ClearHTMLCode(rs(3))&""">"&left(ClearHTMLCode(rs(3)),n)&"</a><br />" rs.MoveNext Wend Set rs = Nothing End Function Function show_goodbbs(m,n) Dim rs n = Int(n) m = Int(m) show_goodbbs="" Set rs = conn.execute("select top "&m&" yfindex.indexid,yfindex.bid,yfindex.subid,yfindex.title,cnk_board.board,cnk_suboard.suboard from (yfindex INNER JOIN cnk_board ON yfindex.bid=cnk_board.bid) INNER JOIN cnk_suboard ON yfindex.subid=cnk_suboard.subid where yfindex.good=1 and yfindex.stopflag=0 and yfindex.recycle=0 and cnk_suboard.userlevel=0 order by yfindex.retime DESC") While Not rs.EOF show_goodbbs=show_goodbbs&"· <a href="""&bbspath&"index.asp?indexid="&rs(0)&"&bid="&rs(1)&"&subid="&rs(2)&""" target=""_blank"" title="""&ClearHTMLCode(rs(3))&""">"&left(ClearHTMLCode(rs(3)),n)&"</a><br />" rs.MoveNext Wend Set rs = Nothing End Function Function show_newtop(m,n) Dim rs n = Int(n) m = Int(m) show_newtop="" Set rs = conn.execute("select top "&m&" yfindex.indexid,yfindex.bid,yfindex.subid,yfindex.title,cnk_board.board,cnk_suboard.suboard from (yfindex INNER JOIN cnk_board ON yfindex.bid=cnk_board.bid) INNER JOIN cnk_suboard ON yfindex.subid=cnk_suboard.subid where yfindex.istoped=1 and yfindex.stopflag=0 and yfindex.recycle=0 and cnk_suboard.userlevel=0 order by yfindex.retime DESC") While Not rs.EOF show_newtop=show_newtop&"· <a href="""&bbspath&"index.asp?indexid="&rs(0)&"&bid="&rs(1)&"&subid="&rs(2)&""" target=""_blank"" title="""&ClearHTMLCode(rs(3))&""">"&left(ClearHTMLCode(rs(3)),n)&"</a><br />" rs.MoveNext Wend Set rs = Nothing End Function Function show_newindex(m,n) Dim rs n = Int(n) m = Int(m) show_newindex="" Set rs = conn.execute("select top "&m&" yfindex.indexid,yfindex.bid,yfindex.subid,yfindex.title,cnk_board.board,cnk_suboard.suboard from (yfindex INNER JOIN cnk_board ON yfindex.bid=cnk_board.bid) INNER JOIN cnk_suboard ON yfindex.subid=cnk_suboard.subid where yfindex.stopflag=0 and yfindex.recycle=0 and cnk_suboard.userlevel=0 order by yfindex.initime DESC") While Not rs.EOF show_newindex=show_newindex&"· <a href="""&bbspath&"index.asp?indexid="&rs(0)&"&bid="&rs(1)&"&subid="&rs(2)&""" target=""_blank"" title="""&ClearHTMLCode(rs(3))&""">"&left(ClearHTMLCode(rs(3)),n)&"</a><br />" rs.MoveNext Wend Set rs = Nothing End Function Function show_newrep(m,n) Dim rs n = Int(n) m = Int(m) show_newrep="" Set rs = conn.execute("select top "&m&" yfindex.indexid,yfindex.bid,yfindex.subid,yfindex.title,cnk_board.board,cnk_suboard.suboard from (yfindex INNER JOIN cnk_board ON yfindex.bid=cnk_board.bid) INNER JOIN cnk_suboard ON yfindex.subid=cnk_suboard.subid where yfindex.stopflag=0 and yfindex.recycle=0 and cnk_suboard.userlevel=0 order by yfindex.retime DESC") While Not rs.EOF show_newrep=show_newrep&"· <a href="""&bbspath&"index.asp?indexid="&rs(0)&"&bid="&rs(1)&"&subid="&rs(2)&""" target=""_blank"" title="""&ClearHTMLCode(rs(3))&""">"&left(ClearHTMLCode(rs(3)),n)&"</a><br />" rs.MoveNext Wend Set rs = Nothing End Function Function show_tophit(m,n) Dim rs,xh n = Int(n) m = Int(m) show_tophit="" Set rs = conn.execute("select top "&m&" yfindex.indexid,yfindex.bid,yfindex.subid,yfindex.title,cnk_board.board,cnk_suboard.suboard from (yfindex INNER JOIN cnk_board ON yfindex.bid=cnk_board.bid) INNER JOIN cnk_suboard ON yfindex.subid=cnk_suboard.subid where yfindex.focus=1 and yfindex.stopflag=0 and yfindex.recycle=0 and cnk_suboard.userlevel=0 order by yfindex.visit DESC") xh=1 Do While Not rs.EOF show_tophit=show_tophit&""&xh&". <a href="""&bbspath&"index.asp?indexid="&rs(0)&"&bid="&rs(1)&"&subid="&rs(2)&""" target=""_blank"" title="""&ClearHTMLCode(rs(3))&""">"&left(ClearHTMLCode(rs(3)),n)&"</a><br />" rs.MoveNext xh=xh+1 if xh>m then exit do Loop Set rs = Nothing End Function Function show_toprep(m,n) Dim rs,xh n = Int(n) m = Int(m) show_toprep="" Set rs = conn.execute("select top "&m&" yfindex.indexid,yfindex.bid,yfindex.subid,yfindex.title,cnk_board.board,cnk_suboard.suboard from (yfindex INNER JOIN cnk_board ON yfindex.bid=cnk_board.bid) INNER JOIN cnk_suboard ON yfindex.subid=cnk_suboard.subid where yfindex.focus=1 and yfindex.stopflag=0 and yfindex.recycle=0 and cnk_suboard.userlevel=0 order by yfindex.renum DESC") xh=1 Do While Not rs.EOF show_toprep=show_toprep&""&xh&". <a href="""&SitePath&"index.asp?indexid="&rs(0)&"&bid="&rs(1)&"&subid="&rs(2)&""" target=""_blank"" title="""&ClearHTMLCode(rs(3))&""">"&left(ClearHTMLCode(rs(3)),n)&"</a><br />" rs.MoveNext xh=xh+1 if xh>m then exit do Loop Set rs = Nothing End Function %>