⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 info_makesort.asp

📁 一个网上flash网站源码
💻 ASP
字号:
<%Admin="InfoMake"%>
<!--#include file="check.asp"-->
<!--#include file="mdb_path_info.asp"-->
<%
set rs=server.createobject("adodb.recordset")
rs.open ("select info_list from mb"),conn,1,1
pencat=rs("info_list")
rs.close

tid=request("tid")
currentPage=cint(request("page"))
MaxPerPage=cint(request("MaxPerPage"))
     
'################ 读取标题 等.. 开始 ################
  rs.open "select * from infotype where id="&tid,conn,1,1
  if not rs.eof then
    ts=rs("ts")   
        TN=split(rs("tname"),"|")
        TI=split(rs("ts"), ",")
          for i = 0 to ubound(TN)-1
               if i=ubound(TN)-2 and ubound(TN)>1 then
                 TTY_id=TI(i)
                 TTY_name=TN(i)
               end if
                 all_type_top_id=TI(i)
                 all_type_name=TN(i)
             thistype=thistype & " <img src=""../images/j1.gif"" border=""0"" width=""8"" height=""11""><a href=""../joke/"&TI(i)&"_1.htm"">"&TN(i)&"</a>"
             thistitle=thistitle & " - "&TN(i)&""
          next
  end if
  rs.close

sql="select * from infotype where ts like '"&ts&"%'"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
   sqqq=sqqq& ""&rs("id")&", "
rs.MoveNext
loop
end if
rs.close

''########读取下级分类
rs.open "select * from infotype where tn="&tid&" order by id",conn,1,1
if NOT rs.EOF then
TTY="NO"
Tname=all_type_name
do while NOT rs.EOF
TTNN=split(rs("tname"),"|")(rs("tj")-1)
  TXlist=TXlist&"<tr><td width=""100%"" bgcolor=""#F7F7F7"" height=""20"" onmouseover=""this.bgColor='#F5F5DC'"" onmouseout=""this.bgColor='#F7F7F7'"" align=""right""><a href=""../joke/"&rs("id")&"_1.htm"">"&TTNN&"</a><img border=""0"" src=""../images/fenleij1.gif"" width=""22"" height=""11"" align=""absMiddle""></td></tr>"
rs.MoveNext
loop
end if
rs.close
if TTY_id<>"" and TTY<>"NO" then
rs.open "select * from infotype where tn="&TTY_id&" order by id",conn,1,1
if NOT rs.EOF then
Tname=TTY_name
do while NOT rs.EOF
TTNN=split(rs("tname"),"|")(rs("tj")-1)
  TXlist=TXlist&"<tr><td width=""100%"" bgcolor=""#F7F7F7"" height=""20"" onmouseover=""this.bgColor='#F5F5DC'"" onmouseout=""this.bgColor='#F7F7F7'"" align=""right""><a href=""../joke/"&rs("id")&"_1.htm"">"&TTNN&"</a><img border=""0"" src=""../images/fenleij1.gif"" width=""22"" height=""11"" align=""absMiddle""></td></tr>"
rs.MoveNext
loop
end if
rs.close
end if
''########读取本类top10
sql="select * from info where tid in("&sqqq&") order by hits desc"
rs.open sql,conn,1,1
Txtop=Txtop&"<table cellSpacing=""0"" cellPadding=""0"" width=""100%"" border=""0""><tr>"
if rs.eof then
Txtop="·还没有笑话"
else
do while not rs.eof
h=h+1
Txtop=Txtop&"<td style=""LINE-HEIGHT: 18px"" vAlign=""top"">·</td><td style=""LINE-HEIGHT: 18px""><a href=""../joke/"&rs("id")&".htm"">"&rs("title")&"</a></td></tr>"
if h>=10 then exit do
rs.movenext
loop
end if
rs.close
h=0
Txtop=Txtop&"</table>"
'读取笑话列表
               
sql="select * from info where tid in("&sqqq&") order by date desc"
rs.open sql,conn,1,1
if rs.eof then
 lb=lb&"Sorry!还没有任何笑话!<p>如果有问题,请联系:ygs@myflash.cn"
mpage=1
allshu=0
else
rs.pagesize=MaxPerPage '得到每页数
mpage=rs.pagecount     '得到总页数
rs.move  (currentPage-1)*MaxPerPage
allshu=rs.recordcount
h=0
do while not rs.eof
h=h+1
  lb=lb&"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%""><tr><td width=""4%""><img height=""12"" src=""../images/j7.gif"" width=""15"" border=""0"" align=""absMiddle""></td><td width=""53%""><a href=""../joke/"&rs("id")&".htm""><font color=""#000099"">"&rs("title")&"</font></a></td><td width=""22%"">类别:"
    set rs_type=server.CreateObject("ADODB.RecordSet")
    rs_type.open "select * from infotype where id="&rs("tid"),conn,1,1
    if not rs_type.EOF then
       TN=split(rs_type("tname"),"|")
  lb=lb&"<a href="""&rs("tid")&"_1.htm"">"&TN(ubound(TN)-1)&"</a></td>"
    end if
    rs_type.close
  lb=lb&"<td width=""21%"">时间:"&year(rs("date"))&"-"&month(rs("date"))&"-"&day(rs("date"))&"</font></td><tr><td width=""100%"" colspan=""4""><hr size=""1"" color=""#F2F1E6""></td></tr></table>"
if h>=MaxPerPage then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
'#########读取页次
lb=lb&"<table border=""0"" width=""518"" cellspacing=""0"" cellpadding=""0"" align=""center""><tr><td width=""518"" bgcolor=""#DEDFDE"" height=""1""></td></tr><tr><td width=""518"" height=""30"" background=""../images/fl_di1.gif"" valign=""middle""><p align=""center"">"
pageno=currentPage
if cint(pageno)>1 then
lb=lb&"<a href=../joke/"&tid&"_1.htm title=""最前页"">"
end if
lb=lb&"<img border=""0"" src=""../images/zq.gif"" width=""48"" height=""22"" align=""absmiddle""></a>&nbsp;"
if cint(pageno)>1 then
lb=lb&"<a href=../joke/"&tid&"_"&pageno-1&".htm title=""上一页"">"
end if
lb=lb&"<img border=""0"" src=""../images/qy.gif"" width=""48"" height=""22"" align=""absmiddle""></a>"
pp=cint(pageno)-2           
  if pp<1 then            
  pp=1            
  end if            
for pno=pp to mpage
p=p+1
if pno*1=cint(pageno)*1 then
lb=lb&"&nbsp;<font color=""#4D9CC8""><b>"&pno&"</b></font> |"
else
lb=lb&"&nbsp;<a href=../joke/"&tid&"_"&pno&".htm>"&pno&"</a> |"
end if                                                                      
if p>=10 then exit for            
next
lb=lb&"&nbsp;"
if cint(pageno)< mpage then
lb=lb&"<a href=../joke/"&tid&"_"&pageno+1&".htm title=""下一页"">"
end if
lb=lb&"<img border=""0"" src=""../images/xy.gif"" width=""48"" height=""22"" align=""absmiddle""></a>&nbsp;"
if cint(pageno)< mpage then
lb=lb&"<a href=../joke/"&tid&"_"&mpage&".htm title=""最后页"">"
end if
lb=lb&"<img border=""0"" src=""../images/zh.gif"" width=""48"" height=""22"" align=""absmiddle""></a></p>"
lb=lb&"</td></tr><tr><td width=""518""><img border=""0"" src=""../images/fl_di2.gif"" width=""518"" height=""6""></td></tr></table>"
 '################ 读取完成 ################
 
pencat=replace(pencat,"T_TITLE",thistitle)
pencat=replace(pencat,"T_NAME",tname)
pencat=replace(pencat,"TXlist",txlist)
pencat=replace(pencat,"TXtop",Txtop)

pencat=replace(pencat,"T_LB",lb)
pencat=replace(pencat,"T_TXT",typetxt)
pencat=replace(pencat,"T_TYPE",thistype)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath("../joke/"&tid&"_"&currentPage&".htm"))
fout.Write pencat
fout.close
'************** 生成HTML页 结束 ***************
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -