fso_album.asp

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

ASP
108
字号
<!--#include file="function.asp"-->
<%CheckAdmin3%>
<!--#include file=Conn.asp-->
<!--#include file="config.asp"-->
<%dim fso,tmp,rs,sql,sclassid,sclass,pagename
   if request("page")<>"" then
      if cint(request("page"))<1 then
         currentPage=1
	application("load_album")=""
      else
         currentPage=cint(request("page"))
      end if
   else        
      currentPage=1     
	application("load_album")=""   
   end if

response.write "开始生成歌手列表"

Set fso = CreateObject("Scripting.FileSystemObject")
if application("load_album")<>"ok" then
tmp = Server.MapPath("album.htm")
Set tmp = fso.OpenTextFile(tmp)
DO While not tmp.AtEndOfStream
album=tmp.ReadAll
Loop
tmp.close
set tmp=nothing
application("t_album")=top&album&bottom
application("load_album")="ok"
end if

set rs = Server.CreateObject("ADODB.Recordset")
     MaxPerPage=1
    if request("all")="page"then
sql="select * FROM sClass where sClassid= " & request("sClassid")
else
sql="select * FROM sClass order by sClassid"
     end if
	rs.open sql,conn,1,1
     rs.pagesize=MaxPerPage
     mpage=rs.pagecount     '得到总页数
     rs.move  (currentPage-1)*MaxPerPage
if NOT rs.EOF then
sclassid=rs("sclassid")
SClass=rs("SClass")
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" then	%>
<script LANGUAGE="JavaScript">
<!--
setTimeout('window.close();', 500);
// -->
</script>
<%end if
  response.end
    else
pagename=SClass
'###########################################################################
'///////////////////////////////////////////////////////////////////////////
if Sclassid<>"" then
	set rs=conn.execute("SELECT * FROM Nclass where Sclassid="&Sclassid&" order by Abcd")
        
		if not rs.eof then
		   i=0
		    do while not rs.eof
		      i=i+1
		        if thischar<>rs("Abcd") then
		           thischar=rs("Abcd")
		           i = 1
		geshou_2=geshou_2&"<tr bgcolor=#f7ebe7 onmouseover=this.bgColor='#eeeeee' this.style cursor='hand' onmouseout=this.bgColor='#f7ebe7'><td colspan=5  align=right><a name="&thischar&"><font color=#FF6600>"&thischar&"</font>  <a href=#><img border=0 src=../images/top.gif width=9 height=9></a>&nbsp;</td></tr><tr>"         
                        end if
'///////////////////////////////////////////
geshou_2=geshou_2&"<td width=20% height=22>&nbsp;&nbsp;<img border=0 src=../images/orange_marker.gif><a href=../mtv/"&rs("NClassid")&"_1.htm>"&rs("NClass")&"</a></td>"
'end if
                        if (i mod 5)=0 and i>=4 then
geshou_2=geshou_2&"</tr><tr>"
                        end if
	     rs.movenext
             loop
	         else
	         end if
'###########################################################################
'///////////////////////////////////////////////////////////////////////////
rs.close
	set rs=nothing
	conn.close
	set conn=nothing
pencat=application("t_album")
pencat=replace(pencat,"{webname}",webname)
pencat=replace(pencat,"{weburl}",weburl)
pencat=replace(pencat,"{master}",master)
pencat=replace(pencat,"{masterQQ}",masterQQ)
pencat=replace(pencat,"webname",webname)
pencat=replace(pencat,"{pagename}",pagename)
pencat=replace(pencat,"{Sclass}",sclass)
pencat=replace(pencat,"Geshou_2",geshou_2)
setf = Server.MapPath("../index/mtv_"&sclassid&".htm")
Set setf = fso.OpenTextFile(setf,2,True)
Setf.WriteLine pencat
  response.write "<meta http-equiv=Refresh content='0; URL=fso_album.asp?all="&request("all")&"&sclassid="&sclassid&"&page="&currentPage+1&"'>"
  response.end
end if
end if
%>

⌨️ 快捷键说明

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