<!--#include file="htm_top.asp"-->
<%
page=request("page")
if page="" then page="1"
Nclassid=request.QueryString("0hao_cn")
if int(page)>1 then
FILENAME="../singer/"&Nclassid&"_"&page&".htm"
else
FILENAME="../singer/"&Nclassid&".htm"
end if
set rs=server.createobject("adodb.recordset")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>生成歌手专集列表HTML文件</title>
<style>
body{font-size:9pt;line-height:140%} 
</style>
</head>
<body>
<%
rs.open ("select geshou from mb"),conn,1,1
pencat=rs("geshou")
rs.close
'################ 读标题 开始 ################
 set rs=conn.execute("SELECT * FROM Special where nclassid="&nclassid)
    if rs.eof and rs.bof then 
	errmsg=errmsg+"参数错误，请输入正确的参数"
	call error()
        Response.End 
        else  
        sclassid=rs("sclassid")
        nclass=rs("nclass")
     set trs=conn.execute("SELECT * FROM sclass where sclassid="&sclassid)
     if trs.eof and trs.bof then 
        errmsg=errmsg+"参数错误，请输入正确的参数"
	call error()
        Response.End 
        else    
Nclass_Mtv_Top="<html><head>"&vbCrLf
Nclass_Mtv_Top=Nclass_Mtv_Top&"<TITLE>"&nclass&"|"&trs("sclass")&"|"&SiteName&"-"&Siteurl&"|最新最热的音乐视听</TITLE>"&vbCrLf
Nclass_Mtv_Top=Nclass_Mtv_Top&"<meta name='keywords' content='"&nclass&"最新专集免费下载,"&nclass&"专集在线视听,"&nclass&"最新音乐,"&SiteName&"|"&Siteurl&"'>"&vbCrLf
Nclass_Mtv_Top=Nclass_Mtv_Top&"<meta name='description' content='"&nclass&"最新专集免费下载,"&nclass&"专集在线视听,"&nclass&"最新音乐,"&SiteName&"|"&Siteurl&"'>"
pencat=replace(pencat,"Nclass_Mtv_Top",Nclass_Mtv_Top)
pencat=replace(pencat,"{sclass}",trs("sclass"))
pencat=replace(pencat,"{sclassid}",rs("sclassid"))
pencat=replace(pencat,"{nclassid}",nclassid)
pencat=replace(pencat,"{nclass}",nclass)
rs.close
trs.close
end if
end if
'################ 读左边 开始 ################
set rs=server.createobject("adodb.recordset") 	
sql="select * from Special where nclassid="&nclassid&" order by hits desc" 
rs.open sql,conn,1,1
do while not rs.eof
Nclass_Mtv_Left1=Nclass_Mtv_Left1&"<TR><TD height=22>&nbsp;<img src=../images/pic.gif width=4 height=4> <a href=../special/"&rs("Specialid")&".htm target=_blank>"&left(rs("name"),16)&"</a></TD></TR>"&vbCrLf
i1=i1+1 
if i1>=20 then exit do 
rs.movenext 
loop 
rs.close
set rs=server.createobject("adodb.recordset")
sql="select top 20 * from musiclist where nclassid="&nclassid&" order by hits desc" 
rs.open sql,conn,1,1
do while not rs.eof
Nclass_Mtv_Left2=Nclass_Mtv_Left2&"<TR><TD height=22>&nbsp;<img src=../images/pic.gif width=4 height=4> <a href=../play/play.asp?id="&rs("musicid")&"&.htm>"&left(rs("name"),16)&"</a></TD></TR>"&vbCrLf
j1=j1+1 
if j1>=20 then exit do 
rs.movenext 
loop 
rs.close 
pencat=replace(pencat,"Nclass_Mtv_Left1",Nclass_Mtv_Left1)
pencat=replace(pencat,"Nclass_Mtv_Left2",Nclass_Mtv_Left2)
'################ 读主题 开始 ################
set rs=server.createobject("adodb.recordset") 
              if not isempty(request("page")) then   
	          pagecount=cint(request("page"))   
              else   
	          pagecount=1   
              end if
              sql="select * from special where nclassid="&nclassid&" order by specialid desc"
              rs.open sql,conn,1,1
			  rs.pagesize=30
              if pagecount>rs.pagecount or pagecount<=0 then              
              pagecount=1              
              end if              
			  if rs.eof and rs.bof then
Nclass_Mtv_Center=Nclass_Mtv_Center&"<font size=2><br>对不起，没有找到该歌手的任何专集!</font>"
else
i=1
Nclass_Mtv_Center=Nclass_Mtv_Center&"<TABLE cellSpacing=3 cellPadding=3 width='100%' border=0>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<TBODY><TR><TD bgColor=#ffffff>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<TABLE cellSpacing=1 cellPadding=1 width='100%' bgColor=#cccccc border=0><TBODY>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<TR><TD align=middle bgColor=#f7f7f7><TABLE cellSpacing=0 cellPadding=0 width='100%' border=0><TBODY>"&vbCrLf
Nclass_Mtv_Center=Nclass_Mtv_Center&"<TR><TD>"&vbCrLf
Nclass_Mtv_Center=Nclass_Mtv_Center&"<table width='100%' border=0 cellpadding='0' cellspacing='0' bgcolor=#ffffff>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<tr align=center><td width=283 height=24>专辑名称</td><td width=150>演唱歌手</td>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<td width=71 align=center>歌曲数目</td><td width=114 align=center>发行日期</td>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<td width=109 align=center>语言</td></tr><tr>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<td colspan=5 height=1 bgcolor=#C7E3A0></td></tr></table></TD></TR>"&vbCrLf
Nclass_Mtv_Center=Nclass_Mtv_Center&"<TR><TD height=25>"
rs.AbsolutePage=pagecount
do while not rs.eof
Set Trs= Server.CreateObject("ADODB.Recordset")                 
Tsql="SELECT * FROM musiclist where specialid="+cstr(rs("specialid"))                                               
Trs.open Tsql,conn,1,1                                               
TotalSNum=Trs.recordcount                                               
Trs.close

Nclass_Mtv_Center=Nclass_Mtv_Center&"<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0><TBODY><TR><TD height=30><TABLE cellSpacing=0 cellPadding=0 width=98% align=center border=0><TBODY><TR>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<TD width=300 height=20> "&(pagecount-1)*30+i&". <FONT color=#ff6633><a href='../special/"&rs("Specialid")&".htm'  alt='<img src=http://www.0hao.cn/"&rs("pic")&">' target='_blank'>"&rs("name")&"</a></TD><TD align=center width=130>"&nclass
Nclass_Mtv_Center=Nclass_Mtv_Center&"</TD><TD align=middle width=72>"&TotalSNum&"</TD><TD align=middle width=114>"
Nclass_Mtv_Center=Nclass_Mtv_Center&rs("times")&"</TD><TD align='center' width=102>"&rs("yuyan")&"</TD>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"</TR></TBODY></TABLE></TD></TR><TR><TD bgColor=#e0e0e0 height=1></TD></TR></TBODY></TABLE>"
 i=i+1                                                                                                  
 rs.movenext                                                                                                  
    if i>rs.pagesize then exit do 
	loop  
Nclass_Mtv_Center=Nclass_Mtv_Center&"</TD></TR></table></tr></table>"
if rs.pagecount=1 then
Nclass_Mtv_Center=Nclass_Mtv_Center&"<table width=510 border=0 align=center cellpadding=0 cellspacing=0>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<tr align=right><td height=30 colspan=5><font color=#000000>"&nclass&" <b><font color=#ff0000>"&rs.recordcount&"</font></b> 张</font></td></tr></td></tr></table>"
 else
Nclass_Mtv_Center=Nclass_Mtv_Center&"<table width=100% border=0 align=center cellpadding=0 cellspacing=0>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<tr align=right><td width=60% height=30 align=center valign=middle><font color=#000000>"
 page_start=(pagecount-1)*rs.pagesize
            if pagecount=1 then page_start=1
		    page_end=rs.pagesize*pagecount
		    if pagecount*rs.pagesize=>rs.recordcount then page_end=rs.recordcount end if
allpagecount=rs.pagecount
Nclass_Mtv_Center=Nclass_Mtv_Center&nclass&" 共 <b><font color=#ff0000>"&rs.recordcount&"</font></b> 张  第 <b><font color=ffoooo>"&pagecount&"</font></b> 页 / 共 <b><font color=ffoooo>"&rs.pagecount&"</font></b> 页 / 每页30</font></td>"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<td width=40% height=30 align=center valign=middle><font color=#000000>"
		     if pagecount=1 then                                                        
Nclass_Mtv_Center=Nclass_Mtv_Center&"<font color='#000064'>首页 上一页</font>&nbsp;"
			 else                                                        
Nclass_Mtv_Center=Nclass_Mtv_Center&"<a href="&nclassid&".htm><font color='0000BE'>首页</font></a>&nbsp;" 
if int(pagecount-1)=1 then
Nclass_Mtv_Center=Nclass_Mtv_Center&"<a href="&nclassid&".htm><font color='0000BE'>上一页</font></a>&nbsp;"
else
Nclass_Mtv_Center=Nclass_Mtv_Center&"<a href="&nclassid&"_"+cstr(pagecount-1)+".htm><font color='0000BE'>上一页</font></a>&nbsp;"
end if
			 end if                                             
             if rs.PageCount-pagecount<1 then                                                        
Nclass_Mtv_Center=Nclass_Mtv_Center&"<font color='#000064'>下一页 尾页</font>" 
			 else                                                        
Nclass_Mtv_Center=Nclass_Mtv_Center&"<a href="&nclassid&"_"+cstr(pagecount+1)+".htm><font color='0000BE'>下一页</font></a>&nbsp;"
Nclass_Mtv_Center=Nclass_Mtv_Center&"<a href="&nclassid&"_"&cstr(rs.PageCount)&".htm><font color='0000BE'>尾页</font></a>"           
             end if 
Nclass_Mtv_Center=Nclass_Mtv_Center&"</font></td>"
      end if
Nclass_Mtv_Center=Nclass_Mtv_Center&"</table></td></tr></table>"
    end if
Nclass_Mtv_Center=Nclass_Mtv_Center&"</td><td width=2 bgcolor=5abf49></td></tr></table>"
rs.close
set rs=nothing
conn.close
set conn=nothing
pencat=replace(pencat,"Nclass_Mtv_Center",Nclass_Mtv_Center)
'################ 读结束 ################
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath(FILENAME))
fout.Write pencat
fout.close
'************** 生成HTML页 结束 ***************
%>
<font color="#FF0000">·</font><font color="#FF0000">生成歌手<%=nclass%>MTV列表HTML文件完成</font><br>
<font color="#FF0000">·</font><a target="_blank" href="<%=FILENAME%>">点此浏览<%=FILENAME%></a>
</body></html>