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

📄 fso_mtv_list.asp

📁 全站生成htm静态页面
💻 ASP
字号:
<!--#include file="function.asp"-->
<%CheckAdmin3%>
<!--#include file=Conn.asp-->
<!--#include file="config.asp"-->
<%const MaxPerPage2=50 '设置每页显示多少专集
'******声明变量
dim fso,tmp,rs,sql,sclassid,sclass,pagename,nexts
   if request("page")<>"" then
      if cint(request("page"))<1 then
         currentPage=1
	application("load_singer1")=""
      else
         currentPage=cint(request("page"))
      end if
   else        
      currentPage=1     
	application("load_singer1")=""
   end if

   if request("page2")<>"" then
      if cint(request("page2"))<1 then
         currentPage2=1
      else
         currentPage2=cint(request("page2"))
      end if
   else        
      currentPage2=1        
   end if
sclassid=request("sclassid")
nexts=request("next")
Nclassid=request("Nclassid")
response.write "开始生成歌手专mtv表页面"
Set fso = CreateObject("Scripting.FileSystemObject")

'**********读取模板文件
if application("load_singer1")<>"ok" then
tmp = Server.MapPath("mtv_list_father.htm")
Set tmp = fso.OpenTextFile(tmp)
DO While not tmp.AtEndOfStream
application("t_singer1")=tmp.ReadAll
Loop
tmp.close
Set tmp = fso.OpenTextFile(Server.MapPath("mtv_List_son.htm"))
DO While not tmp.AtEndOfStream
application("t_special_list1")=tmp.ReadAll
Loop
tmp.close
set tmp=nothing
application("load_singer1")="ok"
end if
'**********读取模板文件完成
'*******读取歌手总数和总页数
set rs = Server.CreateObject("ADODB.Recordset")
     MaxPerPage=1
  if request("all")="page" then
sql="select Nclass.Nclassid,Sclass.Sclassid,Sclass.Sclass,Nclass.Nclass FROM Nclass,Sclass where Nclass.Sclassid=Sclass.SCLASSID and Nclass.Nclassid="&Nclassid
  else
sql="SELECT Nclass.Nclassid,Sclass.Sclassid,Sclass.Sclass,Nclass.Nclass FROM Nclass,Sclass where Nclass.Sclassid=Sclass.SCLASSID order by Nclass.Nclassid"
     end if
	rs.open sql,conn,1,1
     rs.pagesize=MaxPerPage
    mpage=rs.pagecount     '得到总页数
     rs.move  (currentPage-1)*MaxPerPage
if NOT rs.EOF then
Nclassid=rs("Nclassid")
Sclassid=rs("Sclassid")
Sclass=rs("Sclass")
Nclass=rs("Nclass")
end if
rs.close
''***读取完成
    response.write "<br>已生成/要生成页数:<font color=#FF0000>"&currentPage-1&"</font>/<font color=#FF0000><b>"&mpage&"</b></font>个, "
'判断是否为生成单个页面
    if mpage<currentPage then
      response.write "操作完成!"   
'判断是否为生成单个页面
	if request("all")="page" and nexts="" then%>
<script LANGUAGE="JavaScript">
<!--
setTimeout('window.close();', 500);
// -->
</script>
<%elseif request("all")="page" and nexts="album" and sclassid<>"" then
   response.write "<meta http-equiv=Refresh content='0; URL=fso_album.asp?all=page&sclassid="&sclassid&"'>"
end if
    else
pagename="<a href='../index.htm'><font class=font2 color=""#FFFFFF"">MTV首页</font></a><font class=font2 color=""#FFFFFF""> → </font><a href='../index/mtv_"&sclassid&".htm'><font class=font2 color=""#FFFFFF"">"&Sclass&"</font></a><font class=font2 color=""#FFFFFF""> → </font><a href='../mtv/"&Nclassid&"_1.htm'><font class=font2 color=""#FFFFFF"">"&Nclass&"(<script src='../play/gshits.asp?ID="&NClassID&"'></script>)</font></a>  <font class=font2 color=""#FFFFFF"">→ MTV歌曲列表</font></td>"
'读取歌手下的所有MTV
sql="SELECT mtvlistid,name,singer,NClassID,pic FROM mtvlist where Nclassid="+cstr(Nclassid)+" order by mtvlistid desc"
	rs.open sql,conn,1,1
if rs.eof and rs.bof then
Special_list="<p align='center'><br>Sorry, 暂 时 没 有 任 何 歌 曲<br><br><a href=javascript:history.go(-1)><br> 请 返 回 </a><br><br></p>"
pencat=application("t_singer1")
pencat=replace(pencat,"{webname}",webname)
pencat=replace(pencat,"{weburl}",weburl)
pencat=replace(pencat,"{master}",master)
pencat=replace(pencat,"{masterQQ}",masterQQ)
pencat=replace(pencat,"{Nclass}",nclass)
pencat=replace(pencat,"{Nclassid}",Nclassid)
pencat=replace(pencat,"{pic}",pic)
pencat=replace(pencat,"{Sclass}",Sclass)
pencat=replace(pencat,"webname",webname)
pencat=replace(pencat,"pagename",pagename)
pencat=replace(pencat,"Special_list",Special_list)
pencat=replace(pencat,"Page_list1",pagelist1(currentPage2,MaxPerPage2,Nclassid,mpage2,allshu))
pencat=replace(pencat,"Page_list",pagelist(currentPage2,MaxPerPage2,Nclassid,mpage2,allshu))

'生成歌手文件
setf = Server.MapPath("../mtv/"&Nclassid&"_"&currentPage2&".htm")
Set setf = fso.OpenTextFile(setf,2,True)
Setf.WriteLine pencat
end if


if not rs.eof then
rs.pagesize=MaxPerPage2 '得到每页数
mpage2=rs.pagecount     '得到总页数
rs.move  (currentPage2-1)*MaxPerPage2
allshu=rs.recordcount
i=0
do while not rs.eof
i=i+1
	if rs("mtvlistid")<>"" then
	musucid=rs("mtvlistid")
	else
	musucid="未知"
	end if
	if rs("name")<>"" then
	name=rs("name")
        name=replace(name,"'","’")
	else
	name="未知"
	end if
	if rs("pic")<>"" then
	pic=rs("pic")
	else
	pic="未知"
	end if
	if rs("NClassID")<>"" then
	NClassID=rs("NClassID")
	else
	NClassID="未知"
	end if
Special_list=Special_list&application("t_special_list1")
Special_list = Replace(Special_list, "{musucid}", rs("mtvlistid"))
Special_list = Replace(Special_list, "{name}", name)
Special_list = Replace(Special_list, "{pic}", rs("pic"))
Special_list = Replace(Special_list, "{NClassID}", rs("NClassID"))
Special_list = Replace(Special_list, "{trueid}", rs("mtvlistid"))
if i mod 2 =0 then
Special_list=Special_list&"<TR bgColor=#ffffff>"
end if
if i>=MaxPerPage2 then exit do     
rs.movenext
loop
Special_list=Special_list&"</TR>"
rs.close


	set rs=nothing
	conn.close
	set conn=nothing
'*****进行模板替换
pencat=application("t_singer1")
pencat=replace(pencat,"{webname}",webname)
pencat=replace(pencat,"{weburl}",weburl)
pencat=replace(pencat,"{master}",master)
pencat=replace(pencat,"{masterQQ}",masterQQ)
pencat=replace(pencat,"{Nclass}",nclass)
pencat=replace(pencat,"{Nclassid}",Nclassid)
pencat=replace(pencat,"{pic}",pic)
pencat=replace(pencat,"{Sclass}",Sclass)
pencat=replace(pencat,"webname",webname)
pencat=replace(pencat,"pagename",pagename)
pencat=replace(pencat,"Special_list",Special_list)
pencat=replace(pencat,"Page_list1",pagelist1(currentPage2,MaxPerPage2,Nclassid,mpage2,allshu))
pencat=replace(pencat,"Page_list",pagelist(currentPage2,MaxPerPage2,Nclassid,mpage2,allshu))
'生成歌手文件
setf = Server.MapPath("../mtv/"&Nclassid&"_"&currentPage2&".htm")
Set setf = fso.OpenTextFile(setf,2,True)
Setf.WriteLine pencat
end if
'**********转向
if currentPage2<mpage2 then
  response.write "<br>已生成/此类分页:<font color=#FF0000>"&currentPage2&"</font>/<font color=#FF0000><b>"&mpage2&"</b></font>个,"
  response.write "<meta http-equiv=Refresh content='0; URL=fso_Mtv_List.asp?all="&request("all")&"&Nclassid="&Nclassid&"&page="&currentPage&"&page2="&cint(currentPage2+1)&"&next="&nexts&"&sclassid="&sclassid&"'>"
else
  response.write "<meta http-equiv=Refresh content='0; URL=fso_Mtv_List.asp?all="&request("all")&"&Nclassid="&Nclassid&"&page="&currentPage+1&"&next="&nexts&"&sclassid="&sclassid&"'>"
  response.end
end if
end if
'#########设置分页函数
function pagelist1(currentPage2,MaxPerPage2,Nclass_id,mpage2,allshu)
pageno=currentPage2
if cint(pageno)>1 then
Nclass_show=Nclass_show&"<a href="&Nclass_id&"_1.htm title=""最前页"">"
end if
Nclass_show=Nclass_show&"</a>&nbsp;"
if cint(pageno)>1 then
Nclass_show=Nclass_show&"<a href="&Nclass_id&"_"&pageno-1&".htm title=""上一页"">"
end if
Nclass_show=Nclass_show&"</a>"
pp=cint(pageno)-2            
  if pp<1 then            
  pp=1            
  end if            
for pno=pp to mpage2
p=p+1
if pno*1=cint(pageno)*1 then
Nclass_show=Nclass_show&"&nbsp;<font color=""#FF0000"">["&pno&"]</font>"
else
Nclass_show=Nclass_show&"&nbsp;<a href="&Nclass_id&"_"&pno&".htm>["&pno&"]</a>"
end if                                                                        
if p>=50 then exit for            
next
Nclass_show=Nclass_show&"&nbsp;"
if cint(pageno)< mpage2 then
Nclass_show=Nclass_show&"<a href="&Nclass_id&"_"&pageno+1&".htm title=""下一页"">"
end if
Nclass_show=Nclass_show&"</a>"
if cint(pageno)< mpage2 then
Nclass_show=Nclass_show&"<a href="&Nclass_id&"_"&mpage2&".htm title=""最后页"">"
end if
Nclass_show=Nclass_show&"</a>"
Nclass_show=Nclass_show&""
    pagelist1 = Nclass_show
end function


function pagelist(currentPage2,MaxPerPage2,Nclass_id,mpage2,allshu)
Nclass_show=""
Nclass_show=Nclass_show&"<table border=""0"" width=""100%"" cellspacing=""0"" bgColor=""#e7eff7"" borderColorLight=""#3972b4"" cellpadding=""0""><tr><td width=""15%"" nowrap>页次:<b><font color=""#0000FF"">"&currentPage2&"</font></b>/<b><font color=""#FF0000"">"&mpage2&"</font></b> 每页<b>"&MaxPerPage2&"</b> 歌曲数<b><font color=""#0000FF"">"&allshu&"</font></b></td><td width=""65%"" nowrap><p align=""center"">"
pageno=currentPage2
if cint(pageno)>1 then
Nclass_show=Nclass_show&"<a href="&Nclass_id&"_1.htm title=""最前页"">"
end if
Nclass_show=Nclass_show&"</a>&nbsp;"
if cint(pageno)>1 then
Nclass_show=Nclass_show&"<a href="&Nclass_id&"_"&pageno-1&".htm title=""上一页"">"
end if
Nclass_show=Nclass_show&"</a>"
pp=cint(pageno)-2            
  if pp<1 then            
  pp=1            
  end if            
for pno=pp to mpage2
p=p+1
if pno*1=cint(pageno)*1 then
Nclass_show=Nclass_show&"&nbsp;<font color=""#FF0000"">["&pno&"]</font>"
else
Nclass_show=Nclass_show&"&nbsp;<a href="&Nclass_id&"_"&pno&".htm>["&pno&"]</a>"
end if                                                                        
if p>=20 then exit for            
next
Nclass_show=Nclass_show&"&nbsp;"
if cint(pageno)< mpage2 then
Nclass_show=Nclass_show&"<a href="&Nclass_id&"_"&pageno+1&".htm title=""下一页"">"
end if
Nclass_show=Nclass_show&"</a>&nbsp;"
if cint(pageno)< mpage2 then
Nclass_show=Nclass_show&"<a href="&Nclass_id&"_"&mpage2&".htm title=""最后页"">"
end if
Nclass_show=Nclass_show&"</a></p></td>"
Nclass_show=Nclass_show&"</tr></table>"
    pagelist = Nclass_show
end function
%>

⌨️ 快捷键说明

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