📄 topic.asp
字号:
<!--#include file="conn.asp"-->
<%
'调用参数
'ismusic=(显示歌曲或专辑,0默认显示歌曲,1显示专辑)
'action= (new最新歌曲/专辑)(best推荐歌曲/专辑)(hot热门歌曲/专辑)
'num=(显示条数,0默认10条)
'type=(显示指定歌手的歌曲/专辑,0默认所有分类)
'tlen=(每条显示的字符数,0默认所有)
'shtype=(是否显示歌曲/专辑所在的歌手,0默认不显示,1显示,如果type不为0则不显示)
'imgurl="<img border=0 src=img/forum.gif>" 或者 imgurl="⊙" (每条前面的标志,可以为空,里面不能包含单引号或双引号)
imgurl="<img border=0 src=images/arrow.gif>"
'=======================================
' 以下程序部分请不要修改! - 叶孤帆
'=======================================
Dim action,num,JS_type,shtype,tlen,HostURL
action=Trim(Request.QueryString("action"))
num=Request.QueryString("num")
JS_type=Request.QueryString("type")
shtype=Request.QueryString("shtype")
tlen=Request.QueryString("tlen")
IsMusic=Request.QueryString("ismusic")
If num="" Then
num=10
Else
num=Cint(num)
End If
If IsMusic="" or not IsNumeric(IsMusic) Then
IsMusic=0
Else
IsMusic=Cint(IsMusic)
End If
If JS_type="" or not IsNumeric(JS_type) Then
JS_type=0
Else
JS_type=Cint(JS_type)
End If
If shtype="" or not IsNumeric(shtype) Then
shtype=0
Else
shtype=Cint(shtype)
End If
If tlen="" or not IsNumeric(tlen) Then
tlen=0
Else
tlen=Cint(tlen)
End If
HostURL="http://"&Request.Servervariables("server_name")&replace(Request.Servervariables("url"),"topic.asp","")
ShowJS()
Sub ShowJS()
Dim rs,sql,Type_rs,JS_BY,JS_where,Film_Type
Select Case action
case "new"
If IsMusic=0 Then
JS_BY="id"
Else
JS_BY="SpecialID"
End If
Case "best"
If IsMusic=0 Then
JS_BY="id"
Else
JS_BY="SpecialID"
End If
Js_where="where IsGood=true"
Case "hot"
JS_BY="hits"
End Select
If JS_type<>0 Then
If JS_where="" Then
JS_where="where NClassID="&JS_type
Else
JS_where=JS_where&" and NClassID="&JS_type
End If
End If
If IsMusic=0 Then
sql="select top "&num&" id,MusicName,Singer,NClassID,SpecialID from [MusicList] "&JS_where&" ORDER BY "&JS_BY&" desc"
Else
sql="select top "&num&" SpecialID,name,NClass,NClassID from [Special] "&JS_where&" ORDER BY "&JS_BY&" desc"
End If
Set rs=conn.execute(sql)
response.write ("document.write('<!--最新歌曲JS代码开始 -->');")
Do while Not rs.eof
If IsMusic=0 Then
response.write ("document.write('"&imgurl&" <span style=""font-size:12px;line-height: 15pt""><a href=# onclick=plays("""&HostURL&"player.asp?id="&rs(0)&""") title="&htmlencode(rs(1))&">');")
Else
response.write ("document.write('"&imgurl&" <span style=""font-size:12px;line-height: 15pt""><a href="""&HostURL&"show.asp?specialid="&rs(0)&""" title="&htmlencode(rs(1))&">');")
End If
If tlen=0 or len(rs(1))<tlen Then
response.write ("document.write('"&rs(1)&"');")
Else
response.write ("document.write('"&left(rs(1),tlen)&"..');")
End IF
response.write ("document.write('</a>');")
If shtype=1 and js_type=0 Then
response.write ("document.write(' - [<a href="&HostURL&"special.asp?id="&rs(3)&" target=_top>"&rs(2)&"</a>]');")
End If
response.write ("document.write('</span><br>');")
rs.movenext
Loop
response.write ("document.write('<script language=""javaScript"" SRC="""&HostURL&"images/js.js""></SCRIPT>');")
response.write ("document.write('<!--最新歌曲JS代码结束 -->');")
rs.close
set rs=nothing
End Sub
CloseDatabase
Rem 过滤HTML代码
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
HTMLEncode = fString
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -