笑话站

<% const MaxPerPage=25 dim totalPut dim CurrentPage dim TotalPages dim i,j dim keyword keyword=request("txtitle") if not isempty(request("page")) then currentPage=cint(request("page")) else currentPage=1 end if dim sql dim rs dim rstype dim typesql dim typeid,typename if not isEmpty(request("typeid")) then typeid=request("typeid") else typeid=1 end if set rstype=server.createobject("adodb.recordset") typesql="select * from type where typeid="&cstr(typeid) rstype.open typesql,conn,1,1 typename=rstype("type") rstype.close %>

<% set rstype=server.createobject("adodb.recordset") typesql="select * from type order by typeid" rstype.open typesql,conn,1,1 if rstype.eof and rstype.bof then response.write "

还 没 有 任 何 栏 目

" else %>

<%do while not rstype.eof%> "><%=rstype("type")%>
<% rstype.movenext loop end if rstype.close %>

>>>笑话点击排行<<<

<% sql="select * from learning where title like '%"&keyword&"%' and typeid="+cstr(typeid)+" order by articleid desc" Set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "

没有或没有找到任何程序

" else totalPut=rs.recordcount totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showpage totalput,MaxPerPage,"index.asp" showContent showpage totalput,MaxPerPage,"index.asp" else if (currentPage-1)*MaxPerPage

<%do while not rs.eof%>
·)"><%=rs("title")%> [提交时间:<%=rs("dateandtime")%>] (阅读:<%=rs("hits")%>)
<% i=i+1 if i>=MaxPerPage then exit do rs.movenext loop %>

<% end sub function showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if response.write "" response.write "

"&typename&" " if CurrentPage<2 then response.write "首页 上一页 " else response.write "首页 " response.write "上一页 " end if if n-currentpage<1 then response.write "下一页 尾页" else response.write "" response.write "下一页 尾页" end if response.write " 页次："&CurrentPage&"/"&n&"页 " response.write " 共"&totalnumber&"篇笑话 " response.write " 转到：" response.write "

" end function %>