<!-- #include file="config.asp" -->
<!-- #include file="config_nsort.asp" -->
<!-- #include file="skin.asp" -->
<%
dim atb,sk_bar,sk_class,nid,sqladd,name,movie,downtype

dim uploadpic,pic	
atb=" target=_blank":sk_bar=16:sk_class="end"
index_url="video":n_sort="video"
tit_fir=format_menu(index_url)

sub video_movie(vm)
if vm="rm" then
movie="<img src=images/video/real.gif align=absmiddle alt=该影片为Real格式>"
elseif vm="mov" then
movie="<img src=images/video/mov.gif align=absmiddle alt=该影片为mov格式>"
else
movie="<img src=images/video/f_wmp.gif align=absmiddle alt=该影片为微软格式>"
end if
end sub

function video_sort()
dim t

  video_sort=vbcrlf&"<table border='0'><tr><td height='3'></td></tr>"

  sql="select * from videotype order by typeid"
  set rs=conn.execute(sql)


  do while not rs.eof
video_sort=video_sort&vbcrlf&"<tr>"
for t=1 to 2
if NOT rs.EOF then
  video_sort=video_sort&vbcrlf&"<td>&nbsp;<img src=""images/video/fk00.gif"" width=""11"" height=""11"" border=""0"">&nbsp;&nbsp;<a href='video_list.asp?action="&rs("type")&"&c_id="&rs("typeid")&"'>"&rs("type")&"</a></td>"
rs.MoveNext                          
end if
next
  
video_sort=video_sort&vbcrlf&"</tr>" 
  loop
  rs.close:set rs=nothing
    video_sort=video_sort&vbcrlf&"<tr><td align=center>&nbsp;<img src=""images/video/fk00.gif"" width=""11"" height=""11"" border=""0"">&nbsp;&nbsp;<a href=video_list.asp?action=desc>所有视频</a></td><td align=center>&nbsp;<img src=""images/video/fk00.gif"" width=""11"" height=""11"" border=""0"">&nbsp;&nbsp;<a href=video_list.asp?action=hot1>推荐视频</a></td></tr><tr><td colspan=2 align=center>"&put_type("video")&"</td></tr></table>"
end function


sub video_new_hot(n_jt,nnhead,nmore,nsql,nt,n_num,n_m,c_num,et,tt,tupian)
  dim di,temp1,pic_temp,tim,counter,nhead:nhead=nnhead
  if n_jt<>"" then n_jt=img_small(n_jt)
  temp1=vbcrlf&"<table border=0 width='100%' cellspacing=0 cellpadding=2 class=tf>"

  sql="select top "&n_num+n_m&" id,type,title,username,tim,counter,pic,lang,power,remark,hot,emoney,name from video where hidden=1"&nsql
  select case nt
  case "hot"
    sql=sql&" order by counter desc,id desc"
    if nhead="" then nhead="观看排行"
  case "good"
    sql=sql&" and hot=5 order by id desc"
    if nhead="" then nhead="影片推荐"
  case else
    sql=sql&" order by id desc"
    if nhead="" then nhead="影片更新"
  end select
  set rs=conn.execute(sql)
  for di=1 to n_m

    if rs.eof or rs.bof then exit for
    rs.movenext
  next
  if tupian="tu" then
  do while not rs.eof
    pic_temp="<img src='"&uploadpic&rs("pic")&"' border=0 width=100 height=80>"
    name=rs("title"):tim=rs("tim"):counter=rs("counter"):movie=rs("type"):emoney=rs("emoney"):power=rs("power")
dim emoney,power

if left(rs("pic"),4)<>"http" then
uploadpic=web_var(web_upload,1)
else
uploadpic=""
end if	

	call video_movie(movie)
    temp1=temp1&vbcrlf&"<tr><td class=bw width=120><TABLE border=0><TR><TD>"&format_rk(pic_temp,2,4,100,80)&"</TD></TR><TR><TD align=center height=25><a href='video_view.asp?id="&rs("id")&"'><font color=red><b>观看请从这里进入</B></font></a> </TD></TR></TABLE></td><td >"
    temp1=temp1&"<TABLE border=0 cellPadding=2 cellSpacing=0 ><TR><TD>片名：<a href='video_view.asp?id="&rs("id")&"'><b>"&rs("title")&"</b></A></TD></TR><TR><TD valign=middle>类型："&movie&"&nbsp;&nbsp;"&rs("lang")&"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主演："&rs("name")&"</TD></TR><TR><TD>星级：<img src='images/down/star"&rs("hot")&".gif' border=0>&nbsp;&nbsp;人气：<FONT class=red_3>"&rs("counter")&"</FONT></TD></TR><TR><TD>"&power_pic(emoney,power,1)&"</TD></TR><TR><TD>介绍："&code_html(rs("remark"),2,40)&"</TD></TR></TABLE><tr><td colspan=2><TABLE border=0 cellPadding=2 cellSpacing=0 width='96%'><TBODY><TR><TD background=images/bg_dian.gif height=1 border=0></TD></TR></TBODY></TABLE>"
	temp1=temp1&"</td></tr>"
    rs.movenext
  loop
  else
  do while not rs.eof
    name=rs("title"):tim=rs("tim"):counter=rs("counter")
if left(rs("pic"),4)<>"http" then
uploadpic=web_var(web_upload,1)
else
uploadpic=""
end if	
    temp1=temp1&vbcrlf&"<tr><td width='30%'>&nbsp;<img src='"&uploadpic&rs("pic")&"' border=0 width=50 height=40></td><td  class=bw width='70%'>"&n_jt&"<a href='video_view.asp?id="&rs("id")&"' title='影视名称："&code_html(name,1,0)&"<br>发 布 人："&rs("username")&"<br>观看人次："&counter&"<br>整理时间："&time_type(tim,88)&"'>"&code_html(name,1,c_num)&"</a>"
    if tt>0 then temp1=temp1&format_end(et,time_type(tim,tt)&",<font class=blue>"&counter&"</font>")
    temp1=temp1&"</td></tr>"
    rs.movenext
  loop
  end if
  rs.close
  temp1=temp1&vbcrlf&"</table>"

  response.write kong&temp1
end sub


sub video_sea()
  dim temp1,nid,nid2,rs,sql,rs2,sql2
  temp1=vbcrlf&"<table border=0 cellspacing=2 cellpadding=3 width='100%' align=center>" & _
        vbcrlf&"<script language=javascript><!--" & _
        vbcrlf&"function video_sea()" & _
        vbcrlf&"{" & _
        vbcrlf&"  if (video_sea_frm.keyword.value==""请输入关键字"")" & _
        vbcrlf&"  {" & _
        vbcrlf&"    alert(""请在搜索影片前先输入要查询的 关键字 ！"");" & _
        vbcrlf&"    video_sea_frm.keyword.focus();" & _
        vbcrlf&"    return false;" & _
        vbcrlf&"  }" & _
        vbcrlf&"}" & _
        vbcrlf&"--></script>" & _
        vbcrlf&"<form name=video_sea_frm action='video_list.asp' method=get onsubmit=""return video_sea()"">" & _
        vbcrlf&"<tr><td height=5></td></tr>" & _
        vbcrlf&"<tr><td>搜索选项：<select name=sea_type sizs=1><option value='title'>影片标题&nbsp;&nbsp;&nbsp;</option><option value='username'>发布人</option></seelct></td></tr>" & _

        vbcrlf&"<tr><td>视频分类：<select name=c_id sizs=1><option value=''>影片类别&nbsp;&nbsp;&nbsp;</option>"
  sql="select * from videotype order by typeid"
  set rs=conn.execute(sql)
  do while not rs.eof
    nid=int(rs(0))
    temp1=temp1&vbcrlf&"<option value='"&nid&"' class=bg_2"
    if cid=nid then temp1=temp1&" selected"
    temp1=temp1&">"&rs(1)&"</option>"

    
    rs.movenext
  loop
  rs.close:set rs=nothing
  temp1=temp1&vbcrlf&"</select></td></tr>" & _

		vbcrlf&"<tr><td>关&nbsp;键&nbsp;字：&nbsp;<input type=text name=keyword value='请输入关键字' onfocus=""if (value =='请输入关键字'){value =''}"" onblur=""if (value ==''){value='请输入关键字'}"" size=11 maxlength=20>" & _

        vbcrlf&"</td></tr>" & _
		vbcrlf&"<tr><td align=center><input type=image src='images/video/sea_button.gif' border=0></td></tr>" & _
        vbcrlf&"</form><tr><td height=1></td></tr></table>"
  response.write kong
  call tab5("<img src='images/video/left_sea.gif' border=0>",temp1)
end sub


sub video_remark(njt)
  dim temp1
  temp1=vbcrlf&"<table border=0 width='98%' align=center>" & _
	vbcrlf&"<tr><td class=htd>视频影院相关说明：</td></tr>" & _ 
	vbcrlf&"<tr><td class=htd>&nbsp;&nbsp;"&img_small(njt)&"本站视频来源于互联网和会员交流，相关链接站点提供下载的影片仅供宽带网用户测试研究用途， 请于下载后24小时内删除，影片版权归相关影音公司所有。</td></tr>" & _
	vbcrlf&"<tr><td class=htd>&nbsp;&nbsp;"&img_small(njt)&"欢迎大家到本站论坛：<a href='forum.asp'"&atb&">"&format_menu("forum")&"</a> 发表和交流您的见解。多谢您的访问！</td></tr>" & _
	vbcrlf&"</table>"
  response.write kong&temp1
end sub

sub video_tool()
  dim temp1
  temp1=vbcrlf&"<table border=0 cellspacing=0 cellpadding=2><tr><td height=5></td></tr>" & _
	vbcrlf&"<tr><td><a href='down_view.asp?id=519'><img src='images/video/tool_wmp.gif' border=0 align=absmiddle></a></td></tr><tr><td><a href='down_view.asp?id=518'><img src='images/video/tool_real.gif' border=0 align=absmiddle></a></td></tr><tr><td><a href='down_view.asp?id=604'><img src='images/video/tool_divx.gif' border=0 align=absmiddle></a></td></tr>" & _
	vbcrlf&"</table>"
  call tab5("<img src='images/video/left_tool.gif' border=0>",temp1)
end sub


sub video_stat()
  dim temp1,num1,num2,num3
  sql="select count(id) from video where hidden=1 and tim>=#"&formatdatetime(formatdatetime(now_time,2))&"#"
  set rs=conn.execute(sql)
  num1=rs(0)
  rs.close
  sql="select num_video from configs where id=1"
  sql="select count(id) from video where hidden=1"
  set rs=conn.execute(sql)
  num2=rs(0)
  rs.close
  sql="select sum(counter) from video where hidden=1"
  set rs=conn.execute(sql)
  num3=rs(0)
  rs.close
  temp1=vbcrlf&"<table border=0 cellspacing=0 cellpadding=3><tr><td height=5></td></tr>" & _
	vbcrlf&"<tr><td>今日更新：<font class=red>"&num1&"</font>个影片</td></tr>" & _
	vbcrlf&"<tr><td>影片总数：<font class=red>"&num2&"</font>个影片</td></tr>" & _
	vbcrlf&"<tr><td>观看总数：<font class=red>"&num3&"</font>人次</td></tr>" & _
	vbcrlf&"<tr><td>[ <a href='gbook.asp?action=write'>→ 影片链接报错</a> ]</td></tr>" & _
	vbcrlf&"<tr><td>[ <a href='user_put.asp?action=video'>→ 快速影片发布</a> ]</td></tr>" & _
	vbcrlf&"<tr><td>"&put_type("video")&"</td></tr>" & _
	vbcrlf&"</table>"
  response.write kong&format_bar("<font class="&sk_class&">栏目统计</font>",temp1,sk_bar,0,0,"||","")
end sub


function video_new()

sql="select top 8 id,pic from video where hidden=1 order by id desc"
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,1

for i=1 to 8
if rs.eof then exit for


if left(rs("pic"),4)<>"http" then
uploadpic=web_var(web_upload,1)
else
uploadpic=""
end if	
video_new=video_new&vbcrlf & "leftrightslide["""&i-1&"""]='<a href=""video_view.asp?id="&rs("id")&""""&atb&"><img src="""&uploadpic&rs("pic")&""" border=0 width=100 height=80></a>'"
rs.movenext
next
rs.close
end function

sub tab5(ltv,pn)
%>
<br>
<table border=0 width=177 cellspacing=0 cellpadding=0>
<tr><td><%=ltv%></td></tr>
<tr><td background='images/video/left_bg.gif' align=center>
<%=pn%>
</td></tr>
<tr><td><img src='images/video/left_end.gif' border=0></td></tr>
</table>
<%
end sub
%>