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

📄 sub.asp

📁 1、采用4.5修改而成。 2、添加了求片区
💻 ASP
字号:
<%
'------------------功能主程序-------------------------------
function server_v(zt_dy)
If zt_dy="iask" Then
server_v="新浪"
ElseIf zt_dy="56" Then
server_v="56"
ElseIf zt_dy="tudou" Then
server_v="土豆"
ElseIf zt_dy="ouou" Then
server_v="偶偶"
ElseIf zt_dy="6rooms" Then
server_v="六房间"
ElseIf zt_dy="youku" Then
server_v="优酷"
ElseIf zt_dy="tvix" Then
server_v="第九频道"
ElseIf zt_dy="xunlei" Then
server_v="迅雷P2P"
ElseIf zt_dy="xunlei2" Then
server_v="迅雷联盟"
ElseIf zt_dy="real" Then
server_v="real"
ElseIf zt_dy="media" Then
server_v="media"
ElseIf zt_dy="play" Then 
server_v="FLV"
Else
server_v="未知"
End If 
End function

Function search_list(search_key,search_path)'热门搜索
search_key1=Split(search_key,",")
search_list="<A HREF="""&search_path&"search.asp?keyword="&search_key1(0)&""">"&search_key1(0)&"</A>"
For search_i=1 To UBound(search_key1)
search_list=search_list&"	<A HREF="""&search_path&"search.asp?keyword="&search_key1(search_i)&""">"&search_key1(search_i)&"</A>"
next
end Function

Function item(temp_path)'分类导航
item="<ul><li><a href="""&temp_path&"index.html"">首页</a></li>"
set rs1=conn.execute("select * from zt_type order by zt_n asc")
while not rs1.eof
item=item&"<li><a href="""&temp_path&rs1("zt_en")&""">"&rs1("zt_typename")&"</a></li>"
rs1.movenext
wend
item=item&"<li class=""kong""><a href="""&temp_path&"allmovie.html"">全部影片</a></li></ul>"
rs1.close
set rs1=Nothing
end Function

function get_classname(class_id)'读取分类中文名称
set rs1=conn.execute("select zt_typename from zt_type where zt_typeid="&cint(class_id))
if not rs1.eof then
get_classname=rs1("zt_typename")
else
get_classname=""
end if 
rs1.close
set rs1=nothing
End Function

function get_classenname(class_id)'读取分类英文名称
set rs1=conn.execute("select zt_en from zt_type where zt_typeid="&cint(class_id))
if not rs1.eof then
get_classenname=rs1("zt_en")
else
get_classenname=""
end if 
rs1.close
set rs1=nothing
End Function

Function upnew(n,cut)'最近更新TOP榜带时间
n=CInt(n):cut=CInt(cut)
set rs1=conn.execute("select top "&n&" zt_id,zt_name,zt_color,zt_type,zt_date from zt_data  order by zt_date desc")
i=0
If rs1.bof Or rs1.eof Then upnew=upnew&"暂无数据"
Do while not rs1.eof
i=i+1
zt_names=rs1("zt_name")
if len(zt_names)>cut then
zt_name=left(zt_names,cut)&"..."
else
zt_name=zt_names
end If
zt_date=FormatDateTime(rs1("zt_date"),2)
If CStr(zt_date)=CStr(Date) Then
zt_date_s=" class=""red"""
Else
zt_date_s=" class=""bl"""
End If 
z_view_path=rs1("zt_id")
zt_color=rs1("zt_color")
If zt_color<>"" or IsNull(zt_color)=false Then zt_name="<font color="""&zt_color&""">"&zt_name&"</font>"
z_view_path=get_classenname(rs1("zt_type"))&"/"&z_view_path
upnew=upnew&"<div class=""indexmovie13""></div><div class=""indexmovie14""><a href="""&z_view_path&""" title="""&zt_names&""">"&zt_name&"</a><span"&zt_date_s&">("&zt_date&")</span></div>"&chr(13)
If i>=n Then Exit Do 
rs1.movenext
Loop 
rs1.close
set rs1=nothing
End Function

Function get_left(n,cut,m,classid,temp_path)
n=CInt(n):cut=CInt(cut):m=CInt(m):classid=CInt(classid)
If m=1 Then '分类推荐,包括推荐1和2
mm=" where zt_tj>0 and zt_type="&classid&" order by zt_date desc"
ElseIf m=2 Then '分类排行
mm=" where zt_type="&classid&" order by zt_hits desc"
ElseIf m=3 Then '推荐1
mm=" where zt_tj=1 order by zt_date desc"
ElseIf m=4 Then '推荐2
mm=" where zt_tj=1 order by zt_date desc"
ElseIf m=5 Then '全部推荐
mm=" where zt_tj=2 order by zt_date desc"
ElseIf m=6 Then '总排行
mm=" order by zt_hits desc"
Else 
mm=" order by zt_date desc"'最近更新带点击数
End If 
set rs1=conn.execute("select top "&n&" zt_id,zt_name,zt_color,zt_type,zt_date,zt_hits from zt_data"&mm)
get_left_i=0
Do while not rs1.eof
get_left_i=get_left_i+1
zt_names=rs1("zt_name")
if len(zt_names)>CInt(cut) then
zt_name=left(zt_names,cut)&"..."
else
zt_name=zt_names
end If
zt_hits=rs1("zt_hits")
z_view_path=rs1("zt_id")
z_view_path=temp_path&get_classenname(rs1("zt_type"))&"/"&z_view_path
zt_color=rs1("zt_color")
If zt_color<>"" or IsNull(zt_color)=false Then zt_name="<font color="""&zt_color&""">"&zt_name&"</font>"
get_left=get_left&"<div class=""indexmovie13""></div><div class=""indexmovie14""><a href="""&z_view_path&""" title="""&zt_names&""">"&zt_name&"</a><span>("&zt_hits&")</span></div>"&chr(13)
If get_left_i>=n Then Exit Do 
rs1.movenext
Loop 
rs1.close
End Function

Function get_hits(zt_id)'统计播放次数
n=CInt(zt_id)
If zt_id<>"" Then 
set rs=server.createobject("adodb.recordset")
sql="select zt_hits from zt_data where zt_id="&zt_id
rs.Open sql,conn,3,3
If rs.eof And rs.bof Then
get_hits="无此数据"
Else 
get_hits=rs("zt_hits")
End If 
Else 
get_hits="参数不能为空"
End If 
rs("zt_hits")=get_hits+1
rs.update
rs.close
Set rs=nothing
End Function 

'------------------------------------动态调用部分
sub news(n,cut,m)'首页电影图片+文字
n=CInt(n):cut=CInt(cut):m=CInt(m)
If m=0 Then 
news_sql=" where zt_tj>0 order by zt_date desc"
ElseIf m=1 Then 
news_sql=" where zt_tj=1 order by zt_date desc"
ElseIf m=2 Then 
news_sql=" where zt_tj=2 order by zt_date desc"
ElseIf m=3 Then 
news_sql=" order by zt_hits desc"
ElseIf m=4 Then 
news_sql=" where zt_tj>0 order by zt_hits desc"
End If 
set rs=conn.execute("select top "&n&" zt_id,zt_name,zt_color,zt_type,zt_pic from zt_data"&news_sql)
news_i=0
Do while not rs.eof
news_i=news_i+1
zt_names=rs("zt_name")
if len(zt_names)>cut then
zt_name=left(zt_names,cut)&"..."
else
zt_name=zt_names
end If
z_view_path=rs("zt_id")
z_view_path=get_classenname(rs("zt_type"))&"/"&z_view_path
zt_color=rs("zt_color")
If zt_color<>"" or IsNull(zt_color)=false Then zt_name="<font color="""&zt_color&""">"&zt_name&"</font>"
response.write"<li><p><a href="""&z_view_path&"""><img src="""&rs("zt_pic")&""" onerror=""src='images/nopic.gif'"" title="""&zt_names&""" /></a></p><h3><a href="""&z_view_path&""" title="""&zt_names&""">"&zt_name&"</a></h3></li>"&chr(13)
If news_i>=n Then Exit Do 
rs.movenext
Loop 
rs.close
Set rs=nothing
end Sub

Sub zt_link(a)'友情链接
maxz_link=FSOFileRead(a)
maxz_link=Replace(maxz_link,Chr(13)&Chr(10),"#")
maxz_link_1=Split(maxz_link,"#")
maxz_link_2=UBound(maxz_link_1)
If maxz_link_2>=0 Then 
For maxz_link_i=0 To maxz_link_2
	If maxz_link_1(maxz_link_i)<>"" Then 
		maxz_link_3=Split(maxz_link_1(maxz_link_i),"|")
		If maxz_link_3(3)="" Then 
		response.write"<a target=""_blank"" href="""&maxz_link_3(1)&""" title="""&maxz_link_3(2)&""">"&maxz_link_3(0)&"</a>&nbsp;"
		Else 
		response.write"<a target=""_blank"" href="""&maxz_link_3(1)&""" title="""&maxz_link_3(2)&"""><img src="""&maxz_link_3(3)&""" width=""88"" height=""31"" border=""0"" /></a>&nbsp;"
		End If 
	End If 
Next 
End If 
End Sub 

sub index_new(m,cut1,n)'首页按分类最近更新
m=CInt(m):cut1=CInt(cut1)
If n=0 Then 
nn=""
Else 
nn=" where zt_typeid in("&n&")"
End If 
set rs=conn.execute("select * from zt_type"&nn&"  order by zt_n asc")
If rs.bof And rs.eof Then
response.write"<div class=""middle2a""><div class=""middle2a1"">没有数据</div></div>"
Else 
i=0
Do while not rs.eof
i=i+1
zt_typeid=rs("zt_typeid")
zt_typename=rs("zt_typename")
zt_en=rs("zt_en")
z_item_path=zt_en
response.write"<div class=""middle2a1"">"&chr(13)
response.write"<div class=""middle2a1_h""><a href="""&z_item_path&""">"&zt_typename&"</a><span><a href="""&z_item_path&""">More...</a></span></div>"&chr(13)
response.write"<ul>"&chr(13)
'-----------------------------------------
If m=-1 Then 
Set rs1=conn.execute("select zt_id,zt_name,zt_color,from zt_data where zt_type="&zt_typeid&" order by zt_date desc")
Else 
Set rs1=conn.execute("select top "&m&" zt_id,zt_name,zt_color from zt_data where zt_type="&zt_typeid&" order by zt_date desc")
End If 
If rs1.bof And rs1.eof Then
response.write"<li><p>没有数据</p></li>"
End If 
mm_i=0
Do while not rs1.eof
mm_i=mm_i+1
zt_names=rs1("zt_name")
if len(zt_names)>cut1 then
zt_name=left(zt_names,cut1)&"..."
else
zt_name=zt_names
end If
z_view_path=rs1("zt_id")
z_view_path=zt_en&"/"&z_view_path
zt_color=rs1("zt_color")
If zt_color<>"" or IsNull(zt_color)=false Then zt_name="<font color="""&zt_color&""">"&zt_name&"</font>"
response.write"<li><a href="""&z_view_path&""" title="""&zt_names&""">"&zt_name&"</a></li>"&chr(13)
If mm_i>=m Then Exit Do 
rs1.movenext
Loop
rs1.close
'---------------------------------------------------
response.write"</ul>"&chr(13)
response.write"</div>"&chr(13)
rs.movenext
Loop
rs.close
Set rs=nothing
End If 
end Sub

sub search(pagenum,cut)'搜索影片
pagenum=CInt(pagenum):cut=CInt(cut)
k=Trim(request("keyword"))
if k="" then
response.write"请输入关键字"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select zt_id,zt_name,zt_color,zt_type,zt_zy,zt_dy,zt_pic,zt_hits,zt_date from zt_data where zt_name like '%"&k&"%' or zt_zy like '%"&k&"%' order by zt_date desc"
rs.open sql,conn,1,1
if rs.bof and rs.eof then response.write"<div class=""classpage7"">没有找到相关记录</div>"
i=0
page=cint(request("page"))
rs.pagesize=pagenum
if page="" or page<1 then page=1
total=rs.pagecount
tot=rs.recordcount
if page>total then
page=total
else
rs.absolutepage = page
end if
do while not rs.eof
i=i+1
zt_zy=rs("zt_zy")
if len(zt_zy)>cut then zt_zy=left(zt_zy,cut)&"..."
zt_names=rs("zt_name")
if len(zt_names)>cut Then
zt_name=left(zt_names,cut)&"..."
Else
zt_name=zt_names
End If 
zt_dy=rs("zt_dy")
If i Mod 2 =0 Then
c_s=" cl_s"
Else
c_s=""
End If 
zt_typeid=rs("zt_type")
classname=get_classname(zt_typeid)
z_view_path=rs("zt_id")
z_view_path=get_classenname(zt_typeid)&"/"&z_view_path
zt_color=rs("zt_color")
If zt_color<>"" or IsNull(zt_color)=false Then zt_name="<font color="""&zt_color&""">"&zt_name&"</font>"
response.write"<div class=""classpage7"&c_s&""">"&chr(13)
response.write"<div class=""classpage8"">"&chr(13)
response.write"<a href="""&z_view_path&"""><img src="""&rs("zt_pic")&""" onerror=""src='images/nopic.gif'"" alt="""&zt_names&""" width=""120"" height=""168"" /></a>"&chr(13)
response.write"</div>"&chr(13)
response.write"<div class=""classpage9"">"&chr(13)
response.write"<h3><a href="""&z_view_path&""" title="""&zt_names&""">"&zt_name&"</a></h3>"&chr(13)
response.write"<P>主演:"&zt_zy&"</p>"&chr(13)
response.write"<P>分类:"&classname&"</p>"&chr(13)
response.write"<P>来源:"&server_v(zt_dy)&"</p>"&chr(13)
response.write"<P>人气:"&rs("zt_hits")&"</p>"&chr(13)
response.write"<P>时间:"&formatdatetime(rs("zt_date"),2)&"</p>"&chr(13)
response.write"</div>"&chr(13)
response.write"</div>"&chr(13)
rs.movenext
if i>=rs.pagesize then exit do
loop
rs.close
Set rs=nothing
response.write"</div>"
response.write"<div id=""classpage10"">共"&tot&"条记录 "&pagenum&"条/页 页次:"&page&"/"&total&"页 "
if total<=1 then
response.write""
elseif total>page and page<=1 then
response.write"首页 上一页 <A HREF=search.asp?page="&page+1&"&keyword="&k&">下一页</A> <A HREF=search.asp?page="&total&"&keyword="&k&">尾页</a>"
elseif total>page and page>1 then
response.write"<A HREF=search.asp?page="&page+1&"&keyword="&k&">首页</a> <A HREF=search.asp?page="&page-1&"&keyword="&k&">上一页</A> <A HREF=search.asp?page="&page+1&"&keyword="&k&">下一页</A> <A HREF=search.asp?page="&total&"&keyword="&k&">尾页</a>"
elseif total<=page then
response.write"<A HREF=search.asp?page="&page+1&"&keyword="&k&">首页</a> <A HREF=search.asp?page="&page-1&"&keyword="&k&">上一页</A> 下一页 尾页"
end if
end Sub

Sub movie_view'不生成播放页需要使用的函数
id=request.querystring("id")
n=request.querystring("n")
u=request.querystring("u")
v=request.querystring("v")
s=request.querystring("s")
conn.execute("update zt_data set zt_hits=zt_hits+1 where zt_id="&id)
set rs=conn.execute("select zt_name,zt_url,zt_dy,zt_url1,zt_dy1,zt_dq,zt_type from zt_data where zt_id="&id)
If rs.bof And rs.eof Then
response.redirect"./"
End If 
v_name=rs("zt_name")
If s=1 Then 
v_url=rs("zt_url1")
v_play=rs("zt_dy1")
Else
v_url=rs("zt_url")
v_play=rs("zt_dy")
End If 
v_dq=rs("zt_dq")
zt_type=rs("zt_type")
v_typename=get_classname(zt_type)
z_view_path=id
rs.close
Set rs=nothing
v_url=replace(v_url,chr(10),"")
v_url=replace(v_url,chr(13),"#")
v_url=replace(v_url,"##","")
If Right(v_url,1)="#" Then v_url=Mid(v_url,1,Len(v_url)-1)
v_a=Split(v_url,"#")
v_b=UBound(v_a)
If v_b>0 Then
	v_c=v_a(n-1)
	v_url_1=Split(v_c,"|")(v-1)
Else
	v_d=Split(v_url,"|")
	v_e=UBound(v_d)
	If v_e>0 Then 
		v_url_1=v_d(v-1)
	Else
		v_url_1=v_url
	End If 
End If
If InStr(v_url_1,"$")>0 Then 
v_url_3=Split(v_url_1,"$")
v_url_1=v_url_3(1)
v_url_2=v_url_3(0)
Else 
v_url_2=""
End If 
v_url_1=Trim(v_url_1)
End Sub

'----------------FSO操作------------------------------
'读取文件
Function FSOFileRead(Template_Name) 
Dim objFSO,objCountFile,FiletempData 
Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 
Set objCountFile = objFSO.OpenTextFile(Server.MapPath(Template_Name),1,True) 
If objCountFile.AtEndOfStream = false Then FSOFileRead = objCountFile.ReadAll 
objCountFile.Close 
Set objCountFile=Nothing 
Set objFSO = Nothing 
End Function

'创建文件夹
Function CreateFolder(fldr) 
on error resume next
	Dim fso, f
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set f = fso.CreateFolder(Server.MapPath(fldr))
	CreateFolder = f.Path
	Set f=nothing
	Set fso=nothing
End Function

'创建文件
Function createhtml(path,str)
GetFold=split(path,"/")
For e=0 to Ubound(GetFold)-1
    if fldr="" then
	    fldr=GetFold(e)
    else
	    fldr=fldr&"/"&GetFold(e)
    end if
	If IsFolder(fldr)=false then
		CreateFolder fldr
	End if
Next
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath(path))
fout.Write str
fout.close
set fso = nothing
End Function

'删除文件夹
Function delfolder(path)
If IsFolder(path)=True Then
	Set fso = CreateObject("Scripting.FileSystemObject")
	fso.DeleteFolder(server.mappath(path))
	set fso = Nothing
End If 
End Function 

'删除文件
Function delfile(path)
If IsExists(path)=True Then 
	set fso = server.CreateObject("Scripting.FileSystemObject")
	fso.DeleteFile(server.mappath(path))
	set fso = nothing
End If
End Function 

'检测文件是否存在
Function IsExists(filespec) 
	Dim fso
	Set fso = CreateObject("Scripting.FileSystemObject")
	If (fso.FileExists(server.MapPath(filespec))) Then
	IsExists = True
	Else
	IsExists = False
	End If
	Set fso=nothing
End Function

'检测文件夹是否存在
Function IsFolder(Folder)
    Set fso = CreateObject("Scripting.FileSystemObject")
	If FSO.FolderExists(server.MapPath(Folder)) Then  
	IsFolder = True
	Else
	IsFolder = False
	End If
	Set fso=nothing
End Function
%>

⌨️ 快捷键说明

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