<!--#include file="conn.Asp"-->
<!--#include file="function.Asp"-->
<!--#include file="function_www_888wang_com.Asp"-->
<!--#include file="../inc/config_list.Asp"-->
<!--#include file="../inc/code.asp"-->
<!--#include file="../inc/md5.asp"-->
<%CheckAdmin3%>
<%
'===========请保留版权信息,如果去除，将不提供相关服务==============
' 888网音乐系统 V8.1 版
' 管方网址：www.
' 技术支持: QQ:56566918
' 客服：见www.网站的客服QQ
' 电话:15918529718
'==================================================================
%>

<%const MaxPerPage2=48 '设置每页显示多少专集
'******声明变量
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

auto = request("auto")
sclassid=request("sclassid")
nexts=request("next")
response.write "开始生成歌手专辑列表页面"

Set fso = CreateObject("Scripting.FileSystemObject")

'**********读取模板文件
if application("load_singer1")<>"ok" then
tmp = Server.MapPath("../mb/music_list_father.asp")
Set tmp = fso.OpenTextFile(tmp)
DO While not tmp.AtEndOfStream
application("t_singer1")=tmp.ReadAll
Loop
tmp.close

Set tmp = fso.OpenTextFile(Server.MapPath("../mb/Music_List_son.asp"))
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 SClassid,SClass,Classid from SClass order by SClassid desc"
  else
sql="select SClassid,SClass,Classid from SClass order by SClassid desc"
  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 auto ="yes" then
		'采集完成，转至生成分类页
		Response.Write("<p><font color=0033ff>您使用的是《一键采集并生成》3秒后转至生成首页</font>")
		Response.write "<meta http-equiv=""refresh"" content=""3;url='Make_index.asp?auto="&auto&"'"">"
		Response.End
	 end if	
	
'判断是否为生成单个页面
	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='/'>首页</a>&nbsp;&gt;&nbsp;<a href='"&sclassid&".html'>"&Sclass&"</a>&nbsp;&gt;&nbsp;所有DJ舞曲列表" 
	

sql="select ID,Wma,MusicName,SClassID,hits,IsGood from MusicList where sclassid="+cstr(sclassid)+" order by SClassID desc"
'call res(sql)
	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,"{sclassid}",Sclassid)
pencat=replace(pencat,"Special_list",Special_list)
pencat=replace(pencat,"Page_list1",pagelist1(currentPage2,MaxPerPage2,sclassid,mpage2,allshu))
pencat=replace(pencat,"Page_list",pagelist(currentPage2,MaxPerPage2,sclassid,mpage2,allshu))
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("id")<>"" then
	musucid=rs("id")
	else
	musucid="未知"
	end if
	if rs("MusicName")<>"" then
	MusicName=rs("MusicName")
    MusicName=replace(MusicName,"'","’")
	else
	MusicName="未知"
	end if
	
Special_list=Special_list&application("t_special_list1")
Special_list = Replace(Special_list, "{musicid}", rs("Id"))
Special_list = Replace(Special_list, "{name}", MusicName)
Special_list = Replace(Special_list, "{sclassid}", sclassid)
Special_list = Replace(Special_list, "{trueid}", rs("Id"))

playLink=urlPlay(musucid)
Special_list = Replace(Special_list, "{playLink}", playLink)

if i mod 3 =0 then
Special_list=Special_list&"<TR align=middle>"
end if
if i>=MaxPerPage2 then exit do     
rs.movenext
loop
Special_list=Special_list&"</TR>"
rs.close


'################ 以下是歌手分类 #888wang.com音乐网###############

i=0
MaxList=15
	set rs=server.createobject("adodb.recordset")
		sql="SELECT * FROM Sclass"
rs.open sql,conn,1,1
'set rs=conn.execute("SELECT * FROM Sclass order by Sclassid ASC")
do while not rs.eof
i=i+1
fenlei=fenlei&"<LI><A href=/index/"&rs("Sclassid")&"/index.Html target=_self>"&rs("sclass")&"</A></LI>"
if i>=MaxList then exit do
rs.movenext
loop
rs.close

'*****进行模板替换---大框架



pencat=application("t_singer1")
pencat=replace(pencat,"{fenlei}",fenlei)
pencat=replace(pencat,"{pagename}",pagename)
pencat=replace(pencat,"{sclassid}",sclassid)
pencat=replace(pencat,"{sclass}",sclass)

pencat=replace(pencat,"{Nclass}",nclass)
pencat=replace(pencat,"{Nclassid}",Nclassid)
pencat=replace(pencat,"Special_list",Special_list)
pencat=replace(pencat,"Page_list1",pagelist1(currentPage2,MaxPerPage2,sclassid,mpage2,allshu))
pencat=replace(pencat,"Page_list",pagelist(currentPage2,MaxPerPage2,sclassid,mpage2,allshu))
'################ 系统信息 #888wang.com网音乐网###############

pencat=replace(pencat,"{webname}",webname)
pencat=replace(pencat,"{weburl}",weburl)
pencat=replace(pencat,"{Adminqq}",Adminqq)
pencat=replace(pencat,"{AdminEmail}",AdminEmail)
pencat=replace(pencat,"{keywords}",keywords)
pencat=replace(pencat,"{Descriptions}",Descriptions)
pencat=replace(pencat,"{record}",record)
pencat=replace(pencat,"{Copyright}",Copyright)

'生成歌手文件
'x=""&Nclassid&""
'call CheckDir(x)
mp3path="index/"&sclassid&"/"

fldr=""
If CheckDir1(mp3path)=false then 
GetNewsFold=split(mp3path,"/")
For i=0 to Ubound(GetNewsFold)-1

if fldr="" then
fldr=GetNewsFold(i)
else
fldr=fldr&"/"&GetNewsFold(i)
end if
If CheckDir1(fldr)=false then
  a=MakeNewsDir1(fldr)
  if a = false then
    errmsg=errmsg+"参数错误，请输入正确的参数"
   else
    errmsg=errmsg+"确的参数"
  end if
  else
    errmsg=errmsg+"确的参数"
End if
next
end if

if currentPage2=1 then
	setf = Server.MapPath("../"&mp3path&"index.html")
else
	setf = Server.MapPath("../"&mp3path&"index"&currentPage2&".html")
end if

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=make_MList.asp?auto="&auto&"&all="&request("all")&"&page="&currentPage&"&page2="&cint(currentPage2+1)&"&next="&nexts&"&sclassid="&sclassid&"'>"
else
  response.write "<meta http-equiv=Refresh content='0; URL=make_MList.asp?auto="&auto&"&all="&request("all")&"&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=index"&Nclass_id&".html title=""最前页"">"
end if
Nclass_show=Nclass_show&"</a>&nbsp;"
if cint(pageno)>1 then
Nclass_show=Nclass_show&"<a href=index"&Nclass_id&"_"&pageno-1&".html 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=index"&Nclass_id&"_"&pno&">["&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=mlist_"&Nclass_id&"_"&pageno+1&".asp title=""下一页"">"
end if
Nclass_show=Nclass_show&"</a>"
if cint(pageno)< mpage2 then
Nclass_show=Nclass_show&"<a href=mlist_"&Nclass_id&"_"&mpage2&".asp 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=""#fffffff"" borderColorLight=""#3972b4"" cellpadding=""0"" height=""24"" align=""center""><tr><td width=""35%"" nowrap>页次：<b>"&currentPage2&"</b>/<b>"&mpage2&"</b> 每页<b>"&MaxPerPage2&"</b> 歌曲数<b>"&allshu&"</b>"
pageno=currentPage2
if cint(pageno)>1 then
Nclass_show=Nclass_show&"<a href=index.html title=""最前页"">最前页"
end if
Nclass_show=Nclass_show&"</a>&nbsp;"

if cint(pageno)=2 then
	Nclass_show=Nclass_show&"<a href=index.html title=""上一页"">上一页"
elseif cint(pageno)>2 then
	Nclass_show=Nclass_show&"<a href=index"&pageno-1&".html 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
	if pno=1 then
		Nclass_show=Nclass_show&"&nbsp;<a href=index.html>["&pno&"]</a>"
	else
		Nclass_show=Nclass_show&"&nbsp;<a href=index"&pno&".html>["&pno&"]</a>"
	end if
	
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=index"&pageno+1&".html title=""下一页"">下一页"
end if
Nclass_show=Nclass_show&"</a>&nbsp;"
if cint(pageno)< mpage2 then
Nclass_show=Nclass_show&"<a href=index"&mpage2&".html title=""最后页"">最后页"
end if
Nclass_show=Nclass_show&"</a></td>"
Nclass_show=Nclass_show&"</tr></table>"
    pagelist = Nclass_show
end function
%>







