y98cnmtv-htm.asp

来自「全站生成htm静态页面」· ASP 代码 · 共 114 行

ASP
114
字号
<!--#include file="function.asp"-->
<%CheckAdmin1%>
<!--#include file="../play/conn.asp"-->
<title>在线MTV - 生成MTV排行列表</title>    
<%
sql="select * from MtvList order by hits desc"               
set rs=server.createobject("adodb.recordset")       
rs.open sql,connstr,1,1
                
'###开始分页###
const maxperpage=160
mpage=rs.pagecount    
dim currentpage
rs.pagesize=40
currentpage=request.querystring("d")
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
	if currentpage > rs.pagecount then
	currentpage=rs.pagecount
	end if
end if

if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
For i = 1 to rs.PageSize
if rs.EOF then     
Exit For 
end if
%>                 
<%                                           
L_B=L_B&"<tr><td height=20>&nbsp;<a href=../html/"&rs("mtvlistid")&".htm target=_blank>"&rs("name")&"</a>-<a href=../mtv/"&rs("NClassID")&"_1.htm target=_blank>"&rs("NClass")&"</a>&nbsp;</td>"&rs.movenext&"<td>&nbsp;<a href=../html/"&rs("mtvlistid")&".htm target=_blank>"&rs("name")&"</a>-<a href=../mtv/"&rs("NClassID")&"_1.htm target=_blank>"&rs("NClass")&"</a>&nbsp;</td>"&rs.movenext&"<td>&nbsp;<a href=../html/"&rs("mtvlistid")&".htm target=_blank>"&rs("name")&"</a>-<a href=../mtv/"&rs("NClassID")&"_1.htm target=_blank>"&rs("NClass")&"</a>&nbsp;</td>"&rs.movenext&"<td>&nbsp;<a href=../html/"&rs("mtvlistid")&".htm target=_blank>"&rs("name")&"</a>-<a href=../mtv/"&rs("NClassID")&"_1.htm target=_blank>"&rs("NClass")&"</a>&nbsp;</td>"&rs.movenext&"</tr>"                 
%>    
<%                                                                                                     
rs.MoveNext
next
rs.close
set rs=nothing
conn.close
set conn=nothing                                                              
%>
<%                            
L_B1=L_B1&"<tr>"               
L_B1=L_B1&"<td width=770 colspan=4 align=center height=10 align=left>&nbsp;页数:"&currentpage&"/"&n&"&nbsp;"                                                                                
   	 k=currentpage                                                                                                         
     if k<>1 then                                                                                   
L_B1=L_B1&"<a href=list1.htm>第一页</a>&nbsp;"                                                                                                         
L_B1=L_B1&"<a href=list"&k-1&".htm>上一页</a>&nbsp;"                                                                                                         
   	 else                                                                                     
L_B1=L_B1&"第一页&nbsp;上一页&nbsp;"                                                                                                         
   	end if                                                                                   
   	if k<>n then                                                                                                        
L_B1=L_B1&"<a href=list"&k+1&".htm>下一页</a>&nbsp;"                                                                                                         
L_B1=L_B1&"<a href=list"&n&".htm>尾页</a>&nbsp;"                                                                                                         
   	else                                                                                     
L_B1=L_B1&"下一页&nbsp;尾页&nbsp;"                                                                                                         
   	end if                                                                                    
L_B1=L_B1&"共收录<font color=#FF0000>"&totalput&"</font>首MTV</td></tr>"
%>
<%                            
L_B=L_B&"</table><table width=770 border=0 cellspacing=0 cellpadding=0 align=center bgcolor=#FFFFFF><tr>"               
L_B=L_B&"<td width=770 colspan=4 align=center height=10 align=left>&nbsp;页数:"&currentpage&"/"&n&"&nbsp;"                                                                                
   	 k=currentpage                                                                                                         
     if k<>1 then                                                                                   
L_B=L_B&"<a href=list1.htm>第一页</a>&nbsp;"                                                                                                         
L_B=L_B&"<a href=list"&k-1&".htm>上一页</a>&nbsp;"                                                                                                         
   	 else                                                                                     
L_B=L_B&"第一页&nbsp;上一页&nbsp;"                                                                                                         
   	end if                                                                                   
   	if k<>n then                                                                                                        
L_B=L_B&"<a href=list"&k+1&".htm>下一页</a>&nbsp;"                                                                                                         
L_B=L_B&"<a href=list"&n&".htm>尾页</a>&nbsp;"                                                                                                         
   	else                                                                                     
L_B=L_B&"下一页&nbsp;尾页&nbsp;"                                                                                                         
   	end if                                                                                    
L_B=L_B&"共收录<font color=#FF0000>"&totalput&"</font>首MTV</td></tr></table>"
%>
<%
Set fso = Server.CreateObject("Scripting.FileSystemObject")
set type_d = fso.opentextfile(server.mappath("list.asp"),1,True)
pencat= type_d.ReadAll
pencat=replace(pencat,"L_B1",L_B1)
pencat=replace(pencat,"L_B",L_B)
Set type_x = fso.CreateTextFile(server.mappath("../list/list"&currentPage&".htm"))
type_x.WriteLine pencat
set fso = nothing
type_d.close
type_x.close
%>
<%
 response.write "<br>已生成/要生成分类:<font color=#FF0000>"&currentPage&"</font>/<font color=#FF0000><b>"&n&"</b></font>个,"
 if n=<currentPage then
 response.write "操作完成!"
 response.end
 else
 response.write "<br>已生成/此类分页:<font color=#FF0000>"&currentPage&"</font>/<font color=#FF0000><b>"&n&"</b></font>个,"
 response.write "<meta http-equiv=Refresh content='0; URL=y98cnmtv-htm.asp?d="&currentPage+1&"'>"
end if
%>

⌨️ 快捷键说明

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